Compare commits

...
2 Commits
Author SHA1 Message Date
Vitor Pamplona 78d2a712c5 v0.70.4 2023-07-21 17:29:51 -04:00
Vitor Pamplona 2664292993 Moves wake lock to activate only when the video is actually playing 2023-07-21 17:08:56 -04:00
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ android {
applicationId "com.vitorpamplona.amethyst"
minSdk 26
targetSdk 33
versionCode 260
versionName "0.70.3"
versionCode 261
versionName "0.70.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
@@ -66,7 +66,6 @@ class MultiPlayerPlaybackManager(
repeatMode = Player.REPEAT_MODE_ALL
videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT
volume = 0f
setWakeMode(C.WAKE_MODE_NETWORK)
}
val mediaSession = MediaSession.Builder(context, player).run {
@@ -80,8 +79,10 @@ class MultiPlayerPlaybackManager(
player.addListener(object : Player.Listener {
override fun onIsPlayingChanged(isPlaying: Boolean) {
if (isPlaying) {
player.setWakeMode(C.WAKE_MODE_NETWORK)
playingMap.put(id, mediaSession)
} else {
player.setWakeMode(C.WAKE_MODE_NONE)
cache.put(id, mediaSession)
playingMap.remove(id, mediaSession)
}