[Webkit-unassigned] [Bug 176282] autoplay hidden video element with MediaStream src that has audio track

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 22 01:22:55 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=176282

--- Comment #9 from Ben <ben.browitt at gmail.com> ---
@Youenn can you please explain how to use a single audio element with multiple tracks? I can't make the audio play.

I've muted all the video elements:
<video muted autoplay playsinline></video>
I've created a new audio element:
<audio autoplay></audio>
I've created an empty media stream for the audio tracks:
var audioStream = new MediaStream();
and set the source of the audio element:
audioEl.src = audioStream;
Every time the peer connection receive a new audio track I'm adding it to the audio stream:
if(e.track.kind == 'audio') {
  audioStream.addTrack(e.track);
}
When an audio track is removed from the peer connection I'm removing it from the audio stream:
if(e.track.kind == 'audio'){
  audioStream.removeTrack(e.track);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180422/6b34650b/attachment.html>


More information about the webkit-unassigned mailing list