forked from FoundKeyGang/FoundKey
stop player on hide/unhide
This commit is contained in:
parent
6b7f13e8ef
commit
79f546d150
1 changed files with 9 additions and 6 deletions
|
@ -117,14 +117,16 @@ function playPause() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop() {
|
function stop(noDisplayUpdate = false) {
|
||||||
player.value.stop();
|
player.value.stop();
|
||||||
playing.value = false;
|
playing.value = false;
|
||||||
try {
|
if (!noDisplayUpdate) {
|
||||||
player.value.play(buffer);
|
try {
|
||||||
display();
|
player.value.play(buffer);
|
||||||
} catch (e) {
|
display();
|
||||||
console.warn(e);
|
} catch (e) {
|
||||||
|
console.warn(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
player.value.stop();
|
player.value.stop();
|
||||||
position.value = 0;
|
position.value = 0;
|
||||||
|
@ -143,6 +145,7 @@ function performSeek() {
|
||||||
|
|
||||||
function toggleVisible() {
|
function toggleVisible() {
|
||||||
hide.value = !hide.value;
|
hide.value = !hide.value;
|
||||||
|
stop(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display() {
|
function display() {
|
||||||
|
|
Loading…
Reference in a new issue