-
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
ExoPlayerSimpleView updating not on the ui thread and crushing the app #4439
Comments
Discussed with @tonihei. We'll look at posting to the main thread for these callbacks. Thanks for reporting this! |
I have updated my issue comment. this is happening when using PlaybackControlView, I'm using PlaybackControlView and not SimpleExoPlayerView. I don't know if it's happening on SimpleExoPlayerView either so it's for you to check it out too. |
This may actually need to be fixed in a different way (TBD). Out of interest, would it be feasible for you to move all calls to the player onto your app's main thread? If this is difficult it would be useful to know why. Thanks. |
It's exactly what I did. but it's an error prone to do so because of 2 reasons -
as I see it it's much easier for you to manage the threads for the UI operations than it for me... |
Thanks for the feedback. In the current version, we always require to access the player from one thread only (see here (under "threading model") for a summary of our requirements). From what you describe it seems your app should be using the main thread to make the call to And, unfortunately, our UI components do not support using the player from any background thread at the moment. We need to establish how common this usage pattern is first, before deciding whether or not we are going to handle such situations. |
ExoPlayer can be run on a background thread, but some components (UI and IMA) only support players on the main thread. This adds some documentation and assertions for that. To simplify assertions, this also moves the getApplicationLooper method from ExoPlayer to Player. Issue:#4439 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213280359
when the exoplayer is attached to the PlaybackControlView and the player is prepared and ready to play then when I'm calling player.setPlayWhenReady(true) not from the ui thread I get this crush -
The text was updated successfully, but these errors were encountered: