mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

The Timeline, Tracks and MediaMetadata are currently provided with a list of MediaItemData objects, that are a declarative version of these classes. This works well for cases where SimpleBasePlayer is used for external systems or custom players that don't have a Timeline object available already. However, this makes it really hard to provide the data if the app already has a Timeline, currently requiring to convert it back and forth to a list of MediaItemData. This change adds an override for `State.Builder.setPlaylist` that allows to set these 3 objects directly without going through MediaItemData. The conversion only happens when needed (e.g. when modifying the playlist). PiperOrigin-RevId: 649667983