Add hack to unbreak audio playback through pure JS via new Audio()
Needs ReviewPublic

Authored by broulik on Apr 25 2019, 8:12 PM.


Group Reviewers

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 for which I originally added this.

Can also control them via p-b-i

Diff Detail

R856 Plasma Browser Integration
Lint Skipped
Unit Tests Skipped
broulik created this revision.Apr 25 2019, 8:12 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 25 2019, 8:12 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 25 2019, 8:12 PM
fvogt added a comment.Apr 25 2019, 8:30 PM

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?

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.

apol added a subscriber: apol.EditedSat, Jun 22, 12:42 PM

+1 Fixes the issue for me.