capacitor-plugin-playlist 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -287,7 +287,13 @@ class PlaylistManager(application: Application) :
|
|
|
287
287
|
|
|
288
288
|
fun beginPlayback(@IntRange(from = 0) seekPosition: Long, startPaused: Boolean) {
|
|
289
289
|
currentItem ?: return
|
|
290
|
-
|
|
290
|
+
try {
|
|
291
|
+
super.play(seekPosition, startPaused)
|
|
292
|
+
} catch (e: IllegalStateException) {
|
|
293
|
+
// Android 12+: BackgroundServiceStartNotAllowedException when app is backgrounded
|
|
294
|
+
Log.w(TAG, "beginPlayback: cannot start MediaService while backgrounded: ${e.message}")
|
|
295
|
+
return
|
|
296
|
+
}
|
|
291
297
|
try {
|
|
292
298
|
setVolume(volumeLeft, volumeRight)
|
|
293
299
|
setPlaybackSpeed(playbackSpeed)
|