From 0cc3b4a40d70c3098f856314dfd4165faf2db11c Mon Sep 17 00:00:00 2001 From: Pavel Tsekov Date: Thu, 1 Dec 2022 01:51:23 +0200 Subject: [PATCH] Remove redundant MediaSession callback --- .../com/jhomlala/better_player/BetterPlayer.kt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/android/src/main/kotlin/com/jhomlala/better_player/BetterPlayer.kt b/android/src/main/kotlin/com/jhomlala/better_player/BetterPlayer.kt index f5e494430..d7333adef 100644 --- a/android/src/main/kotlin/com/jhomlala/better_player/BetterPlayer.kt +++ b/android/src/main/kotlin/com/jhomlala/better_player/BetterPlayer.kt @@ -622,12 +622,6 @@ internal class BetterPlayer( PendingIntent.FLAG_IMMUTABLE ) val mediaSession = MediaSessionCompat(context, TAG, null, pendingIntent) - mediaSession.setCallback(object : MediaSessionCompat.Callback() { - override fun onSeekTo(pos: Long) { - sendSeekToEvent(pos) - super.onSeekTo(pos) - } - }) mediaSession.isActive = true val mediaSessionConnector = MediaSessionConnector(mediaSession) mediaSessionConnector.setPlayer(exoPlayer) @@ -721,14 +715,6 @@ internal class BetterPlayer( } } - private fun sendSeekToEvent(positionMs: Long) { - exoPlayer?.seekTo(positionMs) - val event: MutableMap = HashMap() - event["event"] = "seek" - event["position"] = positionMs - eventSink.success(event) - } - fun setMixWithOthers(mixWithOthers: Boolean) { setAudioAttributes(exoPlayer, mixWithOthers) }