首页 > 解决方案 > 我无法解析符号“createWithNotificationChannel”

问题描述

我尝试了所有可用的依赖项,但一无所获......谁能告诉我在这种情况下我能做什么?现在我使用实现 'com.google.android.exoplayer:exoplayer:2.15.0'

这是我的代码...

    PlayerNotificationManager  playerNotificationManager = new PlayerNotificationManager.createWithNotificationChannel(
            context, 1, "marakesh",
            8,
            new PlayerNotificationManager.MediaDescriptionAdapter() {
                @Override
                public CharSequence getCurrentContentTitle(Player player) {
                    return null;
                }

                @Nullable
                @Override
                public PendingIntent createCurrentContentIntent(Player player) {
                    Intent intent = new Intent(context, MainActivity.class);
                    return PendingIntent.getActivity(
                            context,
                            0,
                            intent,
                            PendingIntent.FLAG_UPDATE_CURRENT);
                    }

                @Nullable
                @Override
                public CharSequence getCurrentContentText(Player player) {
                    return null;
                }

                @Nullable
                @Override
                public Bitmap getCurrentLargeIcon(Player player, PlayerNotificationManager.BitmapCallback callback) {
                    //return SampleStream.getBitmap(context, bitmapResource);
                    return null;
                }
            },
            new PlayerNotificationManager.NotificationListener(){
                @Override
                public void onNotificationPosted(int notificationId, Notification notification, boolean ongoing) {
                    startForeground(notificationId, notification);
                }
                @Override
                public void onNotificationCancelled(int notificationId, boolean dissmissedByuser){
                    stopSelf();
                }
            });
    playerNotificationManager.setPlayer(player);
}

标签: exoplayer2.x

解决方案


推荐阅读