Skip to content

Commit

Permalink
Move initialization of media session manager outside init block
Browse files Browse the repository at this point in the history
  • Loading branch information
123mpozzi committed Nov 6, 2024
1 parent a702767 commit cf7c34f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlayerModule(context: ReactApplicationContext) : BitmovinBaseModule(contex
*/
private val players: Registry<Player> = mutableMapOf()

var mediaSessionPlaybackManager: MediaSessionPlaybackManager? = null
var mediaSessionPlaybackManager: MediaSessionPlaybackManager? = MediaSessionPlaybackManager(context)

/**
* JS exported module name.
Expand Down Expand Up @@ -97,7 +97,6 @@ class PlayerModule(context: ReactApplicationContext) : BitmovinBaseModule(contex
}

if (enableMediaSession) {
mediaSessionPlaybackManager = MediaSessionPlaybackManager(context)
promise.unit.resolveOnUiThread {
mediaSessionPlaybackManager?.setupMediaSessionPlayback(nativeId)
}
Expand Down

0 comments on commit cf7c34f

Please sign in to comment.