Autoplay Policy Changes mitigation attempt #2
This commit is contained in:
parent
6f06d70ff6
commit
79a7177714
@ -44,7 +44,7 @@
|
|||||||
// Context bullshit
|
// Context bullshit
|
||||||
let playerContext = []
|
let playerContext = []
|
||||||
|
|
||||||
window.resumeContexts = function () {
|
window.resumeAudioContexts = function () {
|
||||||
for (let i in playerContext) {
|
for (let i in playerContext) {
|
||||||
let ctx = playerContext[i]
|
let ctx = playerContext[i]
|
||||||
if (ctx && ctx.resume) {
|
if (ctx && ctx.resume) {
|
||||||
@ -347,11 +347,11 @@
|
|||||||
playing.innerHTML = title
|
playing.innerHTML = title
|
||||||
document.title = title
|
document.title = title
|
||||||
|
|
||||||
|
window.resumeAudioContexts()
|
||||||
|
|
||||||
audio.src = '/api/serve/by-id/' + id
|
audio.src = '/api/serve/by-id/' + id
|
||||||
audio.play()
|
audio.play()
|
||||||
|
|
||||||
window.resumeAudioContexts()
|
|
||||||
|
|
||||||
updateQT(q)
|
updateQT(q)
|
||||||
|
|
||||||
nowPlaying = id
|
nowPlaying = id
|
||||||
|
@ -167,12 +167,12 @@
|
|||||||
audio.addEventListener('stop', togglePlayButton, false)
|
audio.addEventListener('stop', togglePlayButton, false)
|
||||||
|
|
||||||
play.addEventListener('click', function (e) {
|
play.addEventListener('click', function (e) {
|
||||||
|
window.resumeAudioContexts()
|
||||||
if (audio.paused) {
|
if (audio.paused) {
|
||||||
audio.play()
|
audio.play()
|
||||||
} else {
|
} else {
|
||||||
audio.pause()
|
audio.pause()
|
||||||
}
|
}
|
||||||
window.resumeAudioContexts()
|
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
mute.addEventListener('click', function (e) {
|
mute.addEventListener('click', function (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user