Autoplay Policy Changes mitigation attempt #2

This commit is contained in:
Evert Prants 2019-01-14 19:31:05 +02:00
parent 6f06d70ff6
commit 79a7177714
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@
// Context bullshit
let playerContext = []
window.resumeContexts = function () {
window.resumeAudioContexts = function () {
for (let i in playerContext) {
let ctx = playerContext[i]
if (ctx && ctx.resume) {
@ -347,11 +347,11 @@
playing.innerHTML = title
document.title = title
window.resumeAudioContexts()
audio.src = '/api/serve/by-id/' + id
audio.play()
window.resumeAudioContexts()
updateQT(q)
nowPlaying = id

View File

@ -167,12 +167,12 @@
audio.addEventListener('stop', togglePlayButton, false)
play.addEventListener('click', function (e) {
window.resumeAudioContexts()
if (audio.paused) {
audio.play()
} else {
audio.pause()
}
window.resumeAudioContexts()
}, false)
mute.addEventListener('click', function (e) {