Skip to content

Add methods for replacing playlist items in Player #8046

Description

@georgi-neykov-hub

[REQUIRED] Use case description

In Exoplayer v2.12.0 the new playlist/MediaItem API is missing methods for replacing an existing item(s) at a given position.
The feature is needed if someone needs to refresh the metadata/clipping data/duration/... of an item already in the playlist. In my case I am using a diffing library to update the playlist via a change script which results in add/remove/change/move calls. Yes, one can always do a remove/add, but calling Player.addMediaItems() then Player.removeMediaItems() results in multiple playlist change notifications. I was a bit amazed that there's even a bulk move method (Player.moveMediaItems()), but nothing for changing an existing item.

Proposed solution

Add Player.replaceItem(int, MediaItem) and Player.replaceItems(Int, List<MediaItem>) methods or something similar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions