matvp91 / superstreamer

An open, scalable, online streaming setup. All-in-one toolkit from ingest to adaptive video playback. Built for developers in need of video tooling.
https://matvp91.github.io/superstreamer/
Mozilla Public License 2.0
318 stars 12 forks source link

Cuepoint 0 is always visible in hlsjs-wrapper state. #20

Closed matvp91 closed 1 month ago

matvp91 commented 1 month ago

We should introduce a custom tag for each interstitial X-MIX-TYPES that indicates which types are available in the asset list. The player facade can then have logic to only show interstitial events when the X-MIX-TYPES value contains eg; "ad".

#EXTINF:4,
https://cdn/package/2eb5dfd5-7256-49f5-95c5-e86e1661e733/hls/video_480_1500000_h264/6.m4s
#EXTINF:3.792,
https://cdn/package/2eb5dfd5-7256-49f5-95c5-e86e1661e733/hls/video_480_1500000_h264/7.m4s
#EXT-X-ENDLIST
#EXT-X-DATERANGE:ID="0",CLASS="com.apple.hls.interstitial",START-DATE="2024-09-08T10:48:52.003Z",X-ASSET-LIST="/session/a7b1551f-5baf-4859-b783-b3c674a77690/asset-list.json?timeOffset=0",X-RESUME-OFFSET=0,X-RESTRICT="SKIP,JUMP",X-MIX-TYPES="ad,bumper"

For each EXT-X-DATERANGE, we'll be able to figure out what the inner types are without fetching them. In the example above, the asset list contains both one or more ads, and "one or more" bumpers. Knowing this, it's enough to build a cue points list.

The asset-list.json endpoint should return with a MIX-TYPE property for each interstitial asset. When a player plays this interstitial, it can figure out the type right away.

matvp91 commented 1 month ago

See

https://github.com/matvp91/mixwave/blob/623d647f49c33e64cce1ae726a4ba63698fd2bcf/packages/stitcher/src/playlist.ts#L83