Open acris5 opened 1 month ago
interstitials-controller.ts:1421 [log] > [interstitials]: Removed events 1
interstitials-controller.ts:1427 [warn] > [interstitials]: Interstitial "1" removed while playing
It looks like the date range was removed from the live playlist while playback (active schedule index) was in the event. We haven't confirmed what the expected behavior is here. I think the expectation should be that the the interstitial is exited immediately and throwing playback back to primary at the nearest available resumption offset (you've defined one that might not exist until the interstitial is played through completely).
This one will be a little tricky to replicate, but we can inject dateranges in the parser over live to replicate what's in the logs. Any additional debugging on your end would help. The first thing we might want to try is calling clearInterstitial
if it's not already and then call setSchedulePosition
with the resolved schedule position here https://github.com/video-dev/hls.js/blob/d25ad973048317445e4cacffad16bd637e450c0e/src/controller/interstitials-controller.ts#L1419-L1425
From the HLS side, try keeping the date range in the playlist until the START-DATE + DURATION is less than the first PDT in the playlist (plus some number of target-durations for tardy clients).
You are absolutely right, the thing was that EXT-X-DATERANGE went out of sliding window of playlist. I added it to header and it now works. Also I found that if advert playlist duration is more that tag's duration value then playback also is stalled. I think it will be better to continue main video in all cases.
Now I use both EXT-X-DATERANGE and EXT-CUE tags, it perfectly works with hls.js and safari implementation https://github.com/Eyevinn/hls-interstitials-web-demo/tree/master
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/shaka-project/shaka-packager version 24c9a404bc-release
#EXT-X-TARGETDURATION:3
#EXT-X-MEDIA-SEQUENCE:553
#EXT-X-PROGRAM-DATE-TIME:2024-10-16T16:23:26.032Z
#EXT-X-MAP:URI="video_init.mp4"
#EXT-X-DATERANGE:ID="1",CLASS="com.apple.hls.interstitial",START-DATE="2024-10-16T16:22:54.540Z",DURATION=110.000,X-RESUME-OFFSET=0.000,X-ASSET-URI="advert/index.m3u8",X-TIMELINE-OCCUPIES="RANGE"
#EXTINF:2.000,
video_554.m4s
#EXT-X-CUE-CONT:27.200/110.000
#EXTINF:2.000,
video_555.m4s
#EXT-X-CUE-CONT:29.200/110.000
#EXTINF:2.000,
video_556.m4s
#EXT-X-CUE-CONT:31.200/110.000
#EXTINF:2.000,
video_557.m4s
#EXT-X-CUE-CONT:33.200/110.000
#EXTINF:2.000,
video_558.m4s
#EXT-X-CUE-CONT:35.200/110.000
#EXTINF:2.000,
video_559.m4s
#EXT-X-CUE-CONT:37.200/110.000
#EXTINF:2.000,
video_560.m4s
#EXT-X-CUE-CONT:39.200/110.000
#EXTINF:2.000,
video_561.m4s
#EXT-X-CUE-CONT:41.200/110.000
#EXTINF:2.000,
video_562.m4s
#EXT-X-CUE-CONT:43.200/110.000
#EXTINF:2.000,
video_563.m4s
#EXT-X-CUE-CONT:45.200/110.000
#EXTINF:2.000,
video_564.m4s
#EXT-X-CUE-CONT:47.200/110.000
#EXTINF:2.000,
video_565.m4s
#EXT-X-CUE-CONT:49.200/110.000
#EXTINF:2.000,
video_566.m4s
#EXT-X-CUE-CONT:51.200/110.000
#EXTINF:2.000,
video_567.m4s
#EXT-X-CUE-CONT:53.200/110.000
#EXTINF:2.000,
video_568.m4s
#EXT-X-CUE-CONT:55.200/110.000
#EXTINF:2.000,
video_569.m4s
What version of Hls.js are you using?
c8ee777226212008e21e73e1da8a2569d0cf1849
What browser (including version) are you using?
Chrome
What OS (including version) are you using?
Ubuntu 24.04
Test stream
No response
Configuration
Additional player setup steps
Checklist
Steps to reproduce
Expected behaviour
Interstitial loads and plays while duration of Ext-x-datetime, then video playback resumes
What actually happened?
Interstitial loads and plays first 5 seconds then I see grey screen only, no video resume In browser log "interstitials-controller.ts:1427 [warn] > [interstitials]: Interstitial "1" removed while playing"
Console output
Chrome media internals output
No response