Fix player resuming on page change

This commit is contained in:
WardPearce
2024-05-13 14:11:53 +12:00
parent de275945f8
commit ef06feecae
2 changed files with 1 additions and 16 deletions
-15
View File
@@ -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
View File
@@ -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")