Media3 ExoPlayer notification artwork overlaps previous ones

121 views Asked by At

Using Exoplayer to play a list of streams, when changing channels and setting MediaMetadata new data and artwork (setArtworkUri), the selected one overlaps the previous one.

enter image description here

Creating a BaseMediaSource

    val mMediaMetadata = MediaMetadata.Builder()
    nPlayerInput?.let { nData ->
        nData.mAssetData.let {
            mMediaMetadata
                .setTitle(it.mTitle)
                .setArtworkUri(Uri.parse(nData.mAudioInBackgroundData.mImageUrl))
                .setSubtitle(it.mSubtitle)
                .setArtist(it.mSubtitle)
                .setExtras(Bundle().apply {
                    putString("mId", "" + it.mId)
                })
        }
    }

    val manifestDataSourceFactory = DefaultHttpDataSource.Factory().setUserAgent(mContext.getString(R.string.player_name))

    val mTempMediaItem = MediaItem.Builder()
        .setMediaMetadata(mMediaMetadata.build())
        .setUri(Uri.parse(nUrl))
        .setDrmConfiguration(mMediaItemDrmConfiguration.build())
        .setMimeType(MimeTypes.APPLICATION_MPD)
        .setTag(null)
        .build()

    val mTempMediaSource = DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory)
        .createMediaSource(mTempMediaItem)

And then applying BaseMediaSource - MediaItem to the player:

 nPlayer.setMediaItem(nBaseMediaSource.mediaItem)
 nPlayer.prepare()

Have tried .replaceMediaItme, .canUpdateMediaItem, .updateMediaItem the mediaItem to the player, but nothing worked.

Has anyone encountered this issue? Thanks in advance.

0

There are 0 answers