Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect when LIVE event is ended #2623

Closed
zishanj opened this issue Mar 29, 2017 · 10 comments
Closed

Detect when LIVE event is ended #2623

zishanj opened this issue Mar 29, 2017 · 10 comments

Comments

@zishanj
Copy link

zishanj commented Mar 29, 2017

I am using HlsMediaSource class to render Live events. At the backend I am using Flash Media Live Encoder. Initially when the user click the play button and event is not started, the Flash Media Live Encoder would remove the url due to which ExoPlayer will get 404 message which I can trace easily in onPlayerError listener.

The problem is, once the event is started and later it get ended, is there any specific event that will trigger to notify that the event has ended?

@AquilesCanta
Copy link
Contributor

Have you tried ExoPlayer.EventListener.onPlayerStateChanged(). You can look at the demo app for a usage example.

@zishanj
Copy link
Author

zishanj commented Mar 29, 2017

Yes, its STATE_ENDED only triggered when pre-recorded source is played, for Live content its never triggered.

@ojw28
Copy link
Contributor

ojw28 commented Mar 29, 2017

Perhaps the server is not correctly adding the #EXT-X-ENDLIST tag to the media playlists when the stream ends. In this case the server is technically indicating that it could still add segments, and the player will therefore wait in the buffering state.

@zishanj
Copy link
Author

zishanj commented Mar 29, 2017

Thanks, this explains it well.

@AquilesCanta
Copy link
Contributor

This should be easy to check. onTimelineChanged passes a copy of HlsManifest, from which you can access the media playlist, which has the property hasEndTag. Please update this issue if ExoPlayer is not behaving as expected.

@zishanj
Copy link
Author

zishanj commented Mar 29, 2017

I am using Wowza media server and unfortunately they have not implemented this tag yet. All they do is, remove the stream when Live event ended. We can only detect for 404 response code, perhaps through timer, which is not a good idea. :(

@zishanj
Copy link
Author

zishanj commented Mar 29, 2017

In my older app, in which I was using ExoPlayer 1.5.15, it used to trigger STATE_IDLE after few seconds when it does not receive any more stream data. In this version 2, it returns only STATE_BUFFERING even if there is no more stream data for longer period of time.

Is there any setting for idle state in duration of seconds in this version 2 library?

@ojw28
Copy link
Contributor

ojw28 commented Mar 29, 2017

No. You should ask Wowza to implement the HLS spec properly.

@zishanj
Copy link
Author

zishanj commented Mar 29, 2017

Wowza have not given any timeline yet for its implementation yet but they have added it in their to-do list since March last month and there is no update yet.

I have been using STATE_IDLE as an alternate solution in older 1.5.15 ver. I used to check for response code 404 in this state and display the notification. But this state is not triggering in this version 2 even for longer period of no stream data.

@AquilesCanta
Copy link
Contributor

I am looking into exoplayer not transitioning into IDLE state after not being able to refresh the live window.

ojw28 pushed a commit that referenced this issue May 11, 2017
This imitates DashMediaSource's behavior.

Issue:#2623

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155485738
ojw28 pushed a commit that referenced this issue May 11, 2017
This imitates DashMediaSource's behavior.

Issue:#2623

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155485738
@google google locked and limited conversation to collaborators Aug 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants