-
Notifications
You must be signed in to change notification settings - Fork 6k
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
onPlayerStateChanged is not consistent for multiple listeners #4276
Labels
Comments
We are aware of this issue and already have plans to fix this. Marking as bug until it's fixed. |
ojw28
pushed a commit
that referenced
this issue
Jun 5, 2018
When the player state is changed from an event listener callback, we may get recursive listener notifications. These recursions can produce a wrong order, skip or duplicate updates, and send different notifications to different listeners. This change serializes listener notifications by clustering all update data in a helper data class and adding the updates to a queue which can be handled in a loop on the outer layer of the recursion. As playWhenReady updates also reference the current playbackInfo, we need to redirect the listener notifcations for setPlayWhenReady to the same queue. Issue:#4276 ------------- Created by MOE: https:/google/moe MOE_MIGRATED_REVID=198031431
ojw28
pushed a commit
that referenced
this issue
Jun 5, 2018
When the player state is changed from an event listener callback, we may get recursive listener notifications. These recursions can produce a wrong order, skip or duplicate updates, and send different notifications to different listeners. This change serializes listener notifications by clustering all update data in a helper data class and adding the updates to a queue which can be handled in a loop on the outer layer of the recursion. As playWhenReady updates also reference the current playbackInfo, we need to redirect the listener notifcations for setPlayWhenReady to the same queue. Issue:#4276 ------------- Created by MOE: https:/google/moe MOE_MIGRATED_REVID=198031431
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue description
State updates from
Player.EventListener.onPlayerStateChanged()
may be inconsistent between multiple listeners added withPlayer.addListener()
. This happens when one of the listeners callbacks changes thePlayer
state.For example, if a listener call
Player.stop()
when receiving aPlayer.STATE_ENDED
state update, all succeeding listeners will receive aPlayer.STATE_IDLE
state update.The Expected behaviour is that all listeners receive the same state update values.
Reproduction steps
Player.EventListener
:The issue is on the latest 4 state updates. Note that
PlayerLogEventListener
never receives thePlayer.STATE_ENDED
state upate:Link to test content
Can be reproduced with all medias from main demo app.
Version of ExoPlayer being used
r2.8.0
Device(s) and version(s) of Android being used
Reproduced on Galaxy S7 and Motorola G5, both running Android 7.0 (API 24), and on Emulator running Android 8.1.0 (API 27).
A full bug report captured from the device
bugreport-sdk_gphone_x86-OSM1.180201.007-2018-05-21-01-54-13.zip
The text was updated successfully, but these errors were encountered: