-
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
Invalid assertions in SessionPlayerConnector
#8047
Comments
@sim0629 Could you take a look? |
I'll be on leave from tomorrow. Sungsoo, could you take a look? |
@SungsooLim - We should try and get this fixed for a minor release. It's a bit unclear what |
When MediaItem or Playlist becomes becomes null or empty, then the state of SessionPlayer should become idle. |
Fixed. |
Fixed in 2f1c0a5. This will be included in the |
[REQUIRED] Issue description
I am using the new media2 extension for Exoplayer (v2.12.0) and I am trying to use the new playlist APIs in a
Player
connected via aSessionPlayerConnector
to aMediaLibrarySession
. TheSessionPlayer
APIs from AndroidX prohibit callingSessionPlayer.setMediaItem
with anull
MediaItem
argument and callingSessionPlayer.setPlaylist()
with anull
or emptyList<MediaItem>
, but is perfectly fine to callSessionPlayer.removeMediaItem()
until the playlist is empty.In my use case I want to update the playlist of a given
ExoPlayer
instance with a diff change script (add/remove/change/move) applied via the existingPlayer
playlist modification APIs.Everything is mostly fine (#8046 ) until the playlist goes empty and an assertion in
SessionPlayerConnector.handlePlaylistChangedOnHandler()
kicks in:The code above results in inability to have the player playlist cleared either directly via the
com.google.android.exoplayer2.Player
or the APIs fromandroidx.media2.common.SessionPlayer
and have the updates to state reported to media2 related classes.Having this issue together with (#8011) greatly makes the extension unusable if someone wants to use both the playlist APIs and media2 extension introduced in 2.12.0.
[REQUIRED] Reproduction steps
SessionPlayerConnector
with aPlayer
instancePlayer
, either directly or via theSessionPlayer
APIPlayer
, or by callingSessionPlayer.removeMediaItem(0)
until the playlist is empty.[REQUIRED] Link to test content
The issue is not related to media file decoding or playback.
[REQUIRED] A full bug report captured from the device
assertion stacktrace.txt
[REQUIRED] Version of ExoPlayer being used
2.12.0
[REQUIRED] Device(s) and version(s) of Android being used
Any Android-powered device or emulator complying with the minSdk of the Exoplayer library.
The text was updated successfully, but these errors were encountered: