D20830: Add hack to unbreak audio playback through pure JS via new Audio()
This revision was automatically updated to reflect the committed changes. Closed by commit R856:d637f92040c3: Add hack to unbreak audio playback through pure JS via new Audio() (authored by broulik). REPOSITORY R856 Plasma Browser Integration CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D20830?vs=56994&id=62183 REVISION DETAIL https://phabricator.kde.org/D20830 AFFECTED FILES extension/content-script.js To: broulik, #plasma, fvogt Cc: apol, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
D20830: Add hack to unbreak audio playback through pure JS via new Audio()
fvogt added a comment. Still can't reproduce, but doesn't seem to intruduce a regression either REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D20830 To: broulik, #plasma, fvogt Cc: apol, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
D20830: Add hack to unbreak audio playback through pure JS via new Audio()
apol added a comment. Works for me. REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D20830 To: broulik, #plasma, fvogt Cc: apol, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
D20830: Add hack to unbreak audio playback through pure JS via new Audio()
broulik added a comment. Looks like a recent policy change in Chrome, only my Chrome 74 seems affected and I recall it working half a year ago when I implemented this feature. REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D20830 To: broulik, #plasma, fvogt Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D20830: Add hack to unbreak audio playback through pure JS via new Audio()
fvogt added a comment. I'm not sure why this is necessary - during `new Audio` the created object can't play anything by itself as `src` is not set. If just doing `createdAudio.paused = false` after the removeChild is not enough, is that because the DOM modifications are queued and executed after the audio started playing? Here I can let google translate speak and play the radio just fine, but neither of them are visible to pbi. So race condition, browser differences or bug? REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D20830 To: broulik, #plasma, fvogt Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D20830: Add hack to unbreak audio playback through pure JS via new Audio()
broulik created this revision. broulik added reviewers: Plasma, fvogt. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. broulik requested review of this revision. REVISION SUMMARY Let the comment in the code speak for itself. Now, where is my jug of disinfecting agent... TEST PLAN Google translate works again and so does https://www.radio.net/s/cinemix for which I originally added this. Can also control them via p-b-i REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D20830 AFFECTED FILES extension/content-script.js To: broulik, #plasma, fvogt Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart