Fix player resuming on page change
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import 'vidstack/bundle';
|
||||
|
||||
import { App } from '@capacitor/app';
|
||||
import { SponsorBlock, type Category } from 'sponsorblock-api';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { _ } from 'svelte-i18n';
|
||||
@@ -13,7 +12,6 @@
|
||||
instanceStore,
|
||||
miniPlayerSrcStore,
|
||||
playerAlwaysLoopStore,
|
||||
playerAndroidBackgroundPlayStore,
|
||||
playerAutoPlayStore,
|
||||
playerDashStore,
|
||||
playerProxyVideosStore,
|
||||
@@ -250,19 +248,6 @@
|
||||
player.destroy();
|
||||
playerPosSet = false;
|
||||
});
|
||||
|
||||
// Background play for Android.
|
||||
App.addListener('appStateChange', (state) => {
|
||||
// Very much backwards logic, but for whatever reason
|
||||
// Calling play() within a conditional breaks background play.
|
||||
// Maybe a race condition.
|
||||
|
||||
player.play();
|
||||
|
||||
if (!get(playerAndroidBackgroundPlayStore)) {
|
||||
player.pause();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if audioMode}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
|
||||
LATEST_VERSION = "1.0.8"
|
||||
LATEST_VERSION = "1.0.9"
|
||||
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
|
||||
|
||||
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")
|
||||
|
||||
Reference in New Issue
Block a user