Giter Site home page Giter Site logo

Comments (5)

mattpepin avatar mattpepin commented on May 21, 2024 1

Pretty cool! I didn't know the spec allowed this. Totally makes sense now! Thank you.

from m3u8-parser.

gkatsev avatar gkatsev commented on May 21, 2024

Each segment gets a map property that points at the relevant map https://github.com/videojs/m3u8-parser/blob/main/src/parser.js#L654-L655

See the example in the README https://github.com/videojs/m3u8-parser#parsed-output

from m3u8-parser.

mattpepin avatar mattpepin commented on May 21, 2024

What if it's an init segment for fragmented MP4?

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-MAP:URI="init.mp4"
#EXTINF:8.333333,
index0.m4s
#EXTINF:8.333333,
index1.m4s
#EXTINF:8.333333,
index2.m4s
#EXTINF:8.333333,
index3.m4s

Edit: Oh... It's in the first segment, I see...

from m3u8-parser.

gkatsev avatar gkatsev commented on May 21, 2024

Oh, sorry, I should've made it more clear. The way that m3u8-parser models this is that the property is associated with the next segment that comes after it. So, in your example, it'll be the first segment. If there are multiple EXT-X-MAP, each segment following the tag would get the map property.

#EXT-X-MAP:URI="init.mp4"
#EXTINF:8.333333,
index0.m4s
#EXTINF:8.333333,
index1.m4s
#EXTINF:8.333333,
#EXT-X-MAP:URI="init2.mp4"
index2.m4s
#EXTINF:8.333333,
index3.m4s

So, index0 would have a map pointing at init and index2 would have a map pointing at init2.

from m3u8-parser.

gkatsev avatar gkatsev commented on May 21, 2024

You're welcome. Yup, the spec allows for a new map per segment if you really wanted to, even! But I think most commonly you'll find it after a discontinuity.

from m3u8-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.