-
Notifications
You must be signed in to change notification settings - Fork 116
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
In "initializePlayer", the player should be prepared before setting the playback state values #49
Comments
Thanks for filing this. Are you seeing unexpected behaviour in the codelab because of preparing the player after setting state? The reason I ask is because the method signature for
Both |
Hello! It seems that after the device is rotated, the player's playback state cannot be properly restored if the player is prepared after the playback state values are set. |
Hello! I didn't realize that in the manifest file, android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" was set. Well, if the app process was shut down due to resource constraints, then the player state wouldn't be properly restored (Nexus 5X, API 29): Sometimes it wouldn't work even if I saved the values in onSaveInstanceState. Sometimes it would work, though. Not sure if this is a platform bug or ExoPlayer-specific issue. |
Thanks for the info.
Yes, that's true but I would assume that's because the fields ( I still don't understand how the ordering of |
Actually I experimented with this several times before and I was able to fix the issue by changing the ordering. I'll follow up with a working sample that can demonstrate this. |
Hello! Here is the sample project. There seems to be a platform bug of the passed in savedInstanceState bundle being null for the first process shutdown after app launch (which is another issue). Anyways, afterwards, the player's playback state just wouldn't be restored if the player was prepared after setting the state values, as shown in the video below: And the issue can be resolved by changing the ordering, as shown in the video below: |
In your In the codelab this line is Could that account for the behaviour you're seeing? |
Missed that! Thanks! Regarding that platform bug, where can I seek help? |
I'm pleased that you found the source of your problem. In future, please ensure that any issues are reproducible in the codelab rather than your own project. For Android platform related issues you can file bugs here. I'd suggest using the "Framework" component for the issue you describe. |
In
initializePlayer
:the player should be prepared before setting the playback position and
playWhenReady
state values.The text was updated successfully, but these errors were encountered: