Search code examples
androidkotlinbuilderexoplayerexoplayer2.x

How to extends PlayerNotificationManager with Builder to override for compact view controls Exo player 2.14


I am looking for a way to extends/inherit PlayerNotificationManager.Builder with new Builder approach in ExoPlayer version 2.14. since earlier methods to subclass, it is deprecated now.

Problem Area -

    private class CustomPlayerNotificationManager(
    context: Context,
    channelId: String,
    notificationId: Int,
    mediaDescriptionAdapter: MediaDescriptionAdapter
) : PlayerNotificationManager.Builder(context, notificationId, channelId, mediaDescriptionAdapter)

Here PlayerNotificationManager.Builder return builder instance so PlayerNotificationManager is not being subclassed and I am unable to override it getActionIndicesForCompactView method.

Could anyone help me with subclassing it?


Solution

  • Exo Player version 2.15 has setters for control on compact view. We can set for Seek forward, rewind, etc. In that case we don't need getActionIndicesForCompactView(). But couldn't find a way to subclass PlayerNotificationManager.Builder on 2.14 version