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

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

Details

Reviewers
fvogt
Group Reviewers
Plasma
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

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Thu, Apr 25, 8:12 PM
Restricted Application added a project: Plasma. · View Herald TranscriptThu, Apr 25, 8:12 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Thu, Apr 25, 8:12 PM
fvogt added a comment.Thu, Apr 25, 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.