-
Notifications
You must be signed in to change notification settings - Fork 575
Description
Issue
We are experiencing UI lags when using big playlists containing podcast urls. Specifically, we are using a MediaController
where we usesetMediaItems
to pass around 600 MediaItem
s. The Items are presented in a RecyclerView
where users can select the desired item. After selecting an item by click, we call MediaController#seekToDefaultPosition
. This call clearly freezes the UI and also makes everything unresponsive for a few milliseconds. We have not checked if the problems also occurs with big playlists of local audio files.
Reproduce
We successfully reproduced the issue in your session demo project by slightly modifying the following line
media/demos/session/src/main/java/androidx/media3/demo/session/PlayableFolderActivity.kt
Line 161 in 72a4fb0
subItemMediaList.addAll(children) |
with
subItemMediaList.addAll(List(500) { children.get(0) })
As you can imagine, this code change only provokes a large playlist.
First select any audio file in the album, artist or genre folder. For example: Artist Folder -> The Kyoto Connection -> click on Intro - The Way ..
You should see the UI lag when you try to scroll in the list immediately after clicking an item in the bottom list view in the PlayerActivity
.
We also found out that switching between two MediaItem
s which have been played before does not produces any lags. So maybe the UI issues are related to ongoing network calls.
For us, the UI lags are visible on the following phones, however, the bug is "better" visible on the Samsung S9:
- Samsung S9 (Android 11)
- OnePlus 6 (Android 11)
media3 Version: 1.0.0-alpha03
Please let us know if you have any further questions or if there is anything we can do to support you in finding the cause.
Thanks for building media3!
Julian