You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to play video with HLS interstitials from a specified position after ads? #2558
If set a seek time for the video(with HLS interstitials) to start playing from a specified position
a. seek positio is after any ad position, the screen is black and not show ad or media contents.
b. seek position is before the ads, the player can work well.
player.setMediaItem(
new MediaItem.Builder()
.setUri("https://www.example.com/media.m3u8")
.setAdsConfiguration(
new AdsConfiguration.Builder(Uri.parse("hls://interstitials"))
.setAdsId("ad-tag-0") // must be unique within playlist
.build())
.build());
player.seekTo(seekPosition); //just add this line for start position
player.prepare();
player.play();
Is this an issue or how to play video with HLS interstitials from a specified position after ads?
That's a bug in HlsInterstitialsAdsLoader. I can repro this with a unit tests and a sample stream with the player when using asset lists. We'll provide a fix for this.
When the timeline is updated and the position is before a mid roll, the content position needs to be resolved for an ad start position before being used to select the next asset list to be fetched. This way, the initial selection when joining the stream is behaving as for a seek, which is the correct behavior for VOD and live.
Activity
marcbaechinger commentedon Jul 1, 2025
Thanks for your report!
That's a bug in
HlsInterstitialsAdsLoader. I can repro this with a unit tests and a sample stream with the player when using asset lists. We'll provide a fix for this.When the timeline is updated and the position is before a mid roll, the content position needs to be resolved for an ad start position before being used to select the next asset list to be fetched. This way, the initial selection when joining the stream is behaving as for a seek, which is the correct behavior for VOD and live.
Fix asset list resolution when joining stream
marcbaechinger commentedon Jul 2, 2025
The commit above fixes this problem. Will be included in the next release snapshot.
Fix asset list resolution when joining stream