google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Cannot play continuously while source length is changing realtime #9025

Closed ivostefanoff closed 3 years ago

ivostefanoff commented 3 years ago

Hello, while playing continuously size changing http source, the exoplayer stops where the buffer ends, but not continue further. In other words - playing in time shifted offset is not possible - connection drops when buffer ends even the source size is already changed. Is there solution of this problem? Keep alive? Resync http source? Regards

ojw28 commented 3 years ago

The player will continue to play indefinitely if the server does not indicate a fixed content length in one of the response headers, and if the server then serves a contiguous stream of media to the player.

Conversely, if the server is specifying a fixed content length in one of the response headers, then I think the player is doing the right thing in stopping once that length of content has been consumed.

It's not possible to understand your specific use case from the information provided, so if the above doesn't answer your question, please provide a usable test stream that reproduces the issue, so that we can see exactly what you're trying to do.

ivostefanoff commented 3 years ago

Hello, let me be more specific. I need to play timesifted mpg file (or hls) which is contantly growing in time. If now is 12:25 we have a recorded file from 12:00 till 12:25 and i want to seek to 12:24. Of course the http will return whole segment from 12:00 to 12:25 and the player will seek to 12:24. But after 1min (because buffered chunk till 12:26 is gone) the player reports event end of playback and finishes. Meanwhile, now is realtime 12:26 and recorded file is grown with 1min. Obviously, the player does not know this fact, and this is a normal behaviour. The question is: is there any player mode, causing it to rebuffer or resync played sourse? Obviously, this is a specific case and the player should be "instructed" to do some rebuffer or something else? This case is working on MAG322 with vlc/ffmpeg. Any suggestions?

ojw28 commented 3 years ago

Both DASH and HLS are designed to support moving live windows. ExoPlayer correctly handles both if the content is produced according to the relevant specification.

ExoPlayer also supports live streams using progressive formats that can be appended to (e.g., MPEG-TS and MP3), but seeking is not supported in this case. Playback is fixed to be at the live edge.

If you require a moving live window, all you need to do is provide a specification compliant HLS or DASH stream that exposes one, and the player will do the right thing.

Meanwhile, now is realtime 12:26 and recorded file is grown with 1min. Obviously, the player does not know this fact, and this is a normal behaviour.

The player does know this in the case of DASH and HLS playbacks, because DASH manifests and HLS playlist files are designed to be able to convey this information to a player.

ivostefanoff commented 3 years ago

Okay, let be quite specific - DVR hls made from Flussonic , could be seek in this case from MAG322, but not from Exoplayer? Here we have a perfect HLS with moving time window? What should be the player init in this case?Progressive,hls....?

ojw28 commented 3 years ago

As above, if you have a specification compliant HLS stream with a moving window, then playback should just work. Many apps have successfully deployed this in production using ExoPlayer. If you have an HLS stream for which this is not working, you will have to provide us with access to a test stream so that we can debug the issue.

I don't really understand your question about player init. If you're playing an HLS stream then you should init the player for HLS, if that's what you're asking.

ivostefanoff commented 3 years ago

In other words - is there any way for refreshing(periodically) the media source periodically? We are talking about, that while player is ready, the playing content was one thing and meanwile is has been changed to another and we need to refresh this? Simple question

ojw28 commented 3 years ago

As above, DASH and HLS are explicitly designed to support this. If you have an HLS stream for which this is not working, you will have to provide us with access to a test stream so that we can debug the issue.

google-oss-bot commented 3 years ago

Hey @ivostefanoff. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 3 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@ivostefanoff if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.