我正在使用PlayerNotificationManager
在我的应用程序中显示播放通知。一切都正常工作,但我想在通知中添加我的应用程序的标志和自定义字体。
我通过添加drawables.xml
更改了通知上的播放和暂停按钮。但是找不到更改字体的方法。
那么,我如何更改Exoplayer提供的默认通知布局和特性呢?
编辑:
我看到了Github上这个问题,它说我们需要扩展PlayerNotificationManager
才能使用自定义布局。但我似乎无法使其工作。
这是我的代码:
private void setPlayerNotificationManager(Player player) {
playerNotificationManager = new PlayerNotificationManager(context, "123", 1234, mediaDescriptionAdapter);
playerNotificationManager.setUseNavigationActions(false);
playerNotificationManager.setUsePlayPauseActions(true);
playerNotificationManager.setRewindIncrementMs(0);
playerNotificationManager.setFastForwardIncrementMs(0);
//playerNotificationManager.setColor(Color.GREEN);
playerNotificationManager.setColorized(true);
playerNotificationManager.setUseChronometer(false);
playerNotificationManager.setSmallIcon(R.drawable.logo);
playerNotificationManager.setPlayer(player);
}
playerNotificationManager
类以使用自定义布局。但是我不能让它正常工作。对此有什么想法吗? - null_override