How to remove MediaItem after playing in Media3 ExoPlayer

151 Views Asked by At

I need callback that send event when was played ONE MediaItem (not all) Something like "OnNextMediaItemPlayCallback"

I had tried to find callback, but find one only for ALL MEDIA HAS BEEN PLAYED.

I need to remove media item when media item was played.

1

There are 1 best solutions below

1
Tus Die On BEST ANSWER

See the detecting transitions documentation:

Then playback transitions to another media item, or starts repeating the same media item, Listener.onMediaItemTransition(MediaItem, @MediaItemTransitionReason) is called