forked from rDrama/rDrama
test smth
parent
f785cf2131
commit
caed3272d6
|
@ -279,18 +279,18 @@ function prepare_to_pause(audio) {
|
||||||
|
|
||||||
function handle_playing_music(audio) {
|
function handle_playing_music(audio) {
|
||||||
audio.addEventListener('play', () => {
|
audio.addEventListener('play', () => {
|
||||||
localStorage.setItem("playing_music", Date.now());
|
localStorage.setItem("playing_music2", Date.now());
|
||||||
addEventListener('beforeunload', () => {
|
addEventListener('unload', () => {
|
||||||
localStorage.setItem("playing_music", 0);
|
localStorage.setItem("playing_music2", 0);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
audio.addEventListener('pause', () => {
|
audio.addEventListener('pause', () => {
|
||||||
localStorage.setItem("playing_music", 0);
|
localStorage.setItem("playing_music2", 0);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function playing_music() {
|
function playing_music() {
|
||||||
return (Date.now() - localStorage.getItem("playing_music", 0) < 300000)
|
return (Date.now() - localStorage.getItem("playing_music2", 0) < 300000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload() {
|
function reload() {
|
||||||
|
|
Loading…
Reference in New Issue