Summary: | Safari resumes autoplay audio elements after getUserMedia | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Szymon Witamborski <szymon.witamborski> | ||||||||
Component: | Media | Assignee: | youenn fablet <youennf> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | calvaris, cdumez, commit-queue, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, pauldconlin, philipj, sergio, webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari Technology Preview | ||||||||||
Hardware: | Mac | ||||||||||
OS: | macOS 10.14 | ||||||||||
Attachments: |
|
Description
Szymon Witamborski
2019-05-08 01:24:52 PDT
Here's the stack trace of the play() called after getUserMedia() promise returns: 4 468288 WebCore::HTMLMediaElement::play():entry WebCore`WebCore::HTMLMediaElement::play() WebCore`WebCore::HTMLMediaElement::resumeAutoplaying()+0xac WebCore`WebCore::Document::updateIsPlayingMedia(unsigned long long)+0x29d WebCore`WebCore::MediaStreamTrackPrivate::forEachObserver(WTF::Function<void (WebCore::MediaStreamTrackPrivate::Observer&)> const&) const+0x2bc WebCore`WebCore::MediaStreamTrackPrivate::sourceStarted()+0x39 WebCore`WebCore::RealtimeMediaSource::forEachObserver(WTF::Function<void (WebCore::RealtimeMediaSource::Observer&)> const&) const+0x2bc WebCore`WebCore::RealtimeMediaSource::start()+0xad WebCore`WebCore::MediaStreamPrivate::startProducingData()+0xad WebCore`WebCore::MediaStream::startProducingData()+0xc7 We're also experiencing this same bug with Flipgrid. Our case involves a video tag instead of audio tag, but the result is the same. We also have a codepen here to reproduce - https://codepen.io/mg0stisha/pen/OJPVEzm Steps to reproduce: - Play the video - Pause the video - Click the 'click me' button (this will remove the video from the DOM) - Accept the camera permissions Expected: Camera and audio are now in place of the previous video Actual: Camera is shown but audio from previous video is playing Firefox: no repro Chrome: no repro Edge: no repro This is currently a production issue for us. The user impact is they are watching other students videos, and then they go to record their own video. Upon accepting camera permissions, the audio of the previous videos they watched then plays in the background causing a jarring experience. We really want to create a great experience for Safari users, and currently we are recommending users to download Chrome/New Edge. We're also in the process of developing a workaround for this issue, but would love to help get it resolved if possible instead. Thank you in advance for your help! This is in HTMLMediaElement.h: ``` void mediaStreamCaptureStarted() { resumeAutoplaying(); } ``` This doesn't seem right; as it's broadcast to every element in the page when capture is started. Created attachment 385743 [details]
Patch
Created attachment 385948 [details]
Patch
Comment on attachment 385948 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=385948&action=review > Source/WebCore/ChangeLog:13 > + Previously, we were piggy backing on resuming autoplay, which happens after intteruption. s/tt/t/ Comment on attachment 385948 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=385948&action=review >> Source/WebCore/ChangeLog:13 >> + Previously, we were piggy backing on resuming autoplay, which happens after intteruption. > > s/tt/t/ s/piggy backing/piggybacking/ Created attachment 385969 [details]
Patch for landing
Comment on attachment 385969 [details] Patch for landing Clearing flags on attachment: 385969 Committed r253742: <https://trac.webkit.org/changeset/253742> All reviewed patches have been landed. Closing bug. |