Skip to content

Commit 2878c13

Browse files
committed
Stop video playback when turning off the screen #490
1 parent adc4431 commit 2878c13

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

app/src/main/java/de/christinecoenen/code/zapp/app/player/AbstractPlayerActivity.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ package de.christinecoenen.code.zapp.app.player
33
import android.annotation.SuppressLint
44
import android.app.PictureInPictureParams
55
import android.content.ComponentName
6-
import android.content.Context
76
import android.content.Intent
87
import android.content.ServiceConnection
98
import android.content.res.Configuration
109
import android.os.Build
1110
import android.os.Bundle
1211
import android.os.IBinder
13-
import android.os.PowerManager
1412
import android.view.Menu
1513
import android.view.MenuInflater
1614
import android.view.MenuItem
@@ -45,9 +43,6 @@ abstract class AbstractPlayerActivity :
4543
private val windowInsetsControllerCompat by lazy {
4644
WindowInsetsControllerCompat(window, binding.fullscreenContent)
4745
}
48-
private val powerManager by lazy {
49-
getSystemService(Context.POWER_SERVICE) as PowerManager
50-
}
5146

5247
protected lateinit var binding: ActivityAbstractPlayerBinding
5348

@@ -255,11 +250,6 @@ abstract class AbstractPlayerActivity :
255250
}
256251

257252
private fun pauseActivity() {
258-
if (!powerManager.isInteractive) {
259-
// resume playback in background, when screen turned off
260-
binder!!.movePlaybackToBackground()
261-
}
262-
263253
try {
264254
unbindService(backgroundPlayerServiceConnection)
265255
} catch (ignored: IllegalArgumentException) {

app/src/main/res/raw-en/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Fixed channel order list being covered by the navigation bar ([#496](https://github.com/mediathekview/zapp/issues/496))
55
* Restricted local result list for the mediathek search ([#486](https://github.com/mediathekview/zapp/issues/486))
66
* Automatic picture in picture mode starts when exiting Zapp via the home button (starting with Android 12) ([#506](https://github.com/mediathekview/zapp/issues/506))
7+
* Stop video playback when turning off the screen ([#490](https://github.com/mediathekview/zapp/issues/490))
78

89
# 9.1.1
910
* Fixed a crash upon start when the channel order has been changed previously

app/src/main/res/raw/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Behoben, dass die Sender-Anordnen-Liste von der Navigation überdeckt wird ([#496](https://github.com/mediathekview/zapp/issues/496))
55
* Lokale Ergebnisliste in der Mediathek-Suche begrenzt ([#486](https://github.com/mediathekview/zapp/issues/486))
66
* Automatischer Picture-in-Picture-Modus startet auch, wenn Zapp über den Home-Button verlassen wird (ab Android 12) ([#506](https://github.com/mediathekview/zapp/issues/506))
7+
* Stoppt die Videowiedergabe, wenn der Bildschirm ausgeschaltet wird ([#490](https://github.com/mediathekview/zapp/issues/490))
78

89
# 9.1.1
910
* Absturz beim Start behoben, wenn schon einmal die Sender-Reihenfolge angepasst wurde

0 commit comments

Comments
 (0)