question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide ways to avoid projection for live streams in a playlist

See original GitHub issue

I’m using HLS event-playlists. There are always two MediaItem’s in a playlist. I wish to have seamless transition, but sometimes ExoPlayer doesn’t play next item from beginning (it skips around 6-30 seconds and start from this position).

What I do is:

override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
    if (reason == MEDIA_ITEM_TRANSITION_REASON_AUTO) {
        Log.d(TAG, "position: ${player.getCurrentPosition()}") // <-- NOT ZERO !!!
        player.moveMediaItem(1, 0)
        player.removeMediaItem(1)
        player.addMediaItem(nextMediaItem)
    }
}

Can you help me? Am i doing something wrong?

All of HLS playlists looks the same:

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-START:TIME-OFFSET=0
#EXT-X-MEDIA-SEQUENCE:26992
#EXT-X-PLAYLIST-TYPE:EVENT
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:34:53.706Z
2021-06-09/15/segment_153453706_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:35:03.960Z
2021-06-09/15/segment_153503960_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:35:13.953Z
2021-06-09/15/segment_153513953_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:35:23.654Z
2021-06-09/15/segment_153523654_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:35:34.034Z
2021-06-09/15/segment_153534034_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T15:35:44.006Z
2021-06-09/15/segment_153544006_010080.ts
...
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T16:26:17.988Z
2021-06-09/16/segment_162617988_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T16:26:28.364Z
2021-06-09/16/segment_162628364_010080.ts
#EXTINF:10.08000
#EXT-X-PROGRAM-DATE-TIME:2021-06-09T16:26:38.226Z
2021-06-09/16/segment_162638226_010080.ts

ExoPlayer version r2.14.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:34 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
apptrashcommented, Jul 7, 2021

@marcbaechinger Thanks for explaining how the workaround works! I tried it - works fine.

0reactions
apptrashcommented, Aug 5, 2021

@marcbaechinger Everything works on version 2.14.2, thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage live stream settings - YouTube Help
Here are some tips: Set up your Premiere before setting up your live stream. Remember to tell your audience that when the live...
Read more >
When is Creating a Playlist Ideal for Pre-Recorded Streaming?
Curate a playlist and live stream pre-recorded videos with OneStream Live. Offer continuous content to your audience with ease and ...
Read more >
Continuous Streaming: How to Produce a 24/7 Live Stream
Learn how to do a 24/7 live stream in 5 steps. Explore linear streaming platforms, how to monetize your continuous stream, and what...
Read more >
LiveBroadcasts | YouTube Live Streaming API
A liveBroadcast resource represents an event that will be streamed, via live video, on YouTube. Methods. The API supports the following methods for ......
Read more >
How to avoid copyright on your live streams... - YouTube
Without doubt, the most asked question at the moment is how to avoid muting, blocking and take downs in your DJ streams.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found