diff --git a/app/src/main/java/com/github/libretube/BackgroundMode.kt b/app/src/main/java/com/github/libretube/BackgroundMode.kt index 76bb4c944..788d322e1 100644 --- a/app/src/main/java/com/github/libretube/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/BackgroundMode.kt @@ -66,8 +66,11 @@ class BackgroundMode { * Initializes the [playerNotification] attached to the [player] and shows it. */ private fun initializePlayerNotification(c: Context) { - playerNotification = PlayerNotificationManager.Builder(c, 1, "background_mode").build() + playerNotification = PlayerNotificationManager + .Builder(c, 1, "background_mode").build() playerNotification.setPlayer(player) + playerNotification.setUsePreviousAction(false) + playerNotification.setUseNextAction(false) playerNotification.setMediaSessionToken(mediaSession.sessionToken) } diff --git a/app/src/main/java/com/github/libretube/PlayerFragment.kt b/app/src/main/java/com/github/libretube/PlayerFragment.kt index ace30e3ab..4f86f9c53 100644 --- a/app/src/main/java/com/github/libretube/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/PlayerFragment.kt @@ -409,13 +409,13 @@ class PlayerFragment : Fragment() { private fun initializePlayerView(view: View, response: Streams) { isLoading = false - var videosNameArray: Array = arrayOf() - videosNameArray += "HLS" - for (vid in response.videoStreams!!) { - val name = vid.quality + " " + vid.format - videosNameArray += name - } runOnUiThread { + var videosNameArray: Array = arrayOf() + videosNameArray += "HLS" + for (vid in response.videoStreams!!) { + val name = vid.quality + " " + vid.format + videosNameArray += name + } var subtitle = mutableListOf() if (response.subtitles!!.isNotEmpty()) { subtitle.add( @@ -871,9 +871,12 @@ class PlayerFragment : Fragment() { } private fun initializePlayerNotification(c: Context) { - playerNotification = PlayerNotificationManager.Builder(c, notificationId, "background_mode") + playerNotification = PlayerNotificationManager + .Builder(c, notificationId, "background_mode") .build() playerNotification.setPlayer(exoPlayer) + playerNotification.setUseNextAction(false) + playerNotification.setUsePreviousAction(false) playerNotification.setMediaSessionToken(mediaSession.sessionToken) }