You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Override this method to customize the buttons on the notification. Commands of the buttons returned by this method must be contained in MediaController.getAvailableCommands().
Unfortunately it seems to be impossible to extend DefaultMediaNotificationProvider in beta-3, because Java will require a call to the constructor() of the inherited function, but it is private in DefaultMediaNotificationProvider.
Maybe there is some advanced trick to get it working, but it shouldn't not be that complicated, or at least documented how one can do it.
Full code:
@UnstableApi public class CustomProvider extends DefaultMediaNotificationProvider {
public CustomProvider(Context ctx) {
super(new Builder(ctx));
}
@Override
protected List<CommandButton> getMediaButtons(Player.Commands playerCommands, List<CommandButton> customLayout, boolean showPauseButton) {
return super.getMediaButtons(playerCommands, customLayout, showPauseButton);
}
}
The text was updated successfully, but these errors were encountered:
tzugen
changed the title
Private constructor in DefaultMediaNotificationProvider makes overriding hard (or impossible)
Private constructor in DefaultMediaNotificationProvider makes overriding impossible
Nov 27, 2022
Issue: #213
Without a public constructor, it is not possible to extend this class and override its method.
PiperOrigin-RevId: 491673111
(cherry picked from commit f3e450e)
Media3 Version
1.0.0-beta03
Reproduction steps
In getMediaButtons the comment reads:
Unfortunately it seems to be impossible to extend DefaultMediaNotificationProvider in beta-3, because Java will require a call to the constructor() of the inherited function, but it is private in DefaultMediaNotificationProvider.
Maybe there is some advanced trick to get it working, but it shouldn't not be that complicated, or at least documented how one can do it.
Full code:
The text was updated successfully, but these errors were encountered: