Skip to content

Commit

Permalink
fix: crash when an other media session with the same name exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Sep 8, 2023
1 parent 5df822e commit 6a2c83a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import com.github.libretube.R
import com.github.libretube.constants.IntentData
import com.github.libretube.constants.PLAYER_CHANNEL_ID
import com.github.libretube.constants.PLAYER_NOTIFICATION_ID
import com.github.libretube.extensions.TAG
import com.github.libretube.extensions.seekBy
import com.github.libretube.extensions.toMediaMetadataCompat
import com.github.libretube.helpers.BackgroundHelper
import com.github.libretube.helpers.ImageHelper
import com.github.libretube.helpers.PlayerHelper
import com.github.libretube.obj.PlayerNotificationData
import com.github.libretube.ui.activities.MainActivity
import java.util.UUID

@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
class NowPlayingNotification(
Expand Down Expand Up @@ -205,7 +205,7 @@ class NowPlayingNotification(
}
}

mediaSession = MediaSessionCompat(context, TAG())
mediaSession = MediaSessionCompat(context, UUID.randomUUID().toString())
mediaSession.setCallback(sessionCallback)

updateSessionMetadata()
Expand Down

0 comments on commit 6a2c83a

Please sign in to comment.