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
- super.play(seekPosition, startPaused)
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-playlist",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Playlist ",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",