WebKit Bugzilla
Attachment 360195 Details for
Bug 193837
: <video> elements not in the DOM should be allowed to AirPlay
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-193837-20190125170945.patch (text/plain), 6.07 KB, created by
Jer Noble
on 2019-01-25 17:09:46 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2019-01-25 17:09:46 PST
Size:
6.07 KB
patch
obsolete
>Subversion Revision: 240299 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 76676af91c59171c2afeee433a7e88564655180b..3d029a521d6ea9024ff38166bd489435498a52c7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-01-25 Jer Noble <jer.noble@apple.com> >+ >+ <video> elements not in the DOM should be allowed to AirPlay >+ https://bugs.webkit.org/show_bug.cgi?id=193837 >+ <rdar://42559491> >+ >+ Reviewed by Eric Carlson. >+ >+ Test: media/airplay-allows-buffering.html >+ >+ Some websites will switch between <video> elements backed by MSE to one backed by >+ a media file in order to implement an AirPlay control. But when a <video> element is >+ removed from the DOM and paused, further buffering is blocked. For some ports (namely >+ Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for >+ elements who have been asked to play wirelessly, but whose wireless playback has not >+ started yet. >+ >+ * html/MediaElementSession.cpp: >+ (WebCore::MediaElementSession::dataBufferingPermitted const): >+ (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget): >+ > 2019-01-24 Jer Noble <jer.noble@apple.com> > > Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object. >diff --git a/Source/WebCore/html/MediaElementSession.cpp b/Source/WebCore/html/MediaElementSession.cpp >index be6203dd7dc0c5a642167598ab009557503f4b16..71ac9956883102752def4d877501226402645a6f 100644 >--- a/Source/WebCore/html/MediaElementSession.cpp >+++ b/Source/WebCore/html/MediaElementSession.cpp >@@ -385,6 +385,11 @@ bool MediaElementSession::dataBufferingPermitted() const > if (shouldOverrideBackgroundLoadingRestriction()) > return true; > >+#if ENABLE(WIRELESS_PLAYBACK_TARGET) >+ if (m_shouldPlayToPlaybackTarget) >+ return true; >+#endif >+ > if (m_elementIsHiddenUntilVisibleInViewport || m_elementIsHiddenBecauseItWasRemovedFromDOM || m_element.elementIsHidden()) > return false; > >@@ -683,6 +688,7 @@ void MediaElementSession::setShouldPlayToPlaybackTarget(bool shouldPlay) > { > INFO_LOG(LOGIDENTIFIER, shouldPlay); > m_shouldPlayToPlaybackTarget = shouldPlay; >+ updateClientDataBuffering(); > client().setShouldPlayToPlaybackTarget(shouldPlay); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c90ff2522694442acb58d914bdfd086cff8dc8ec..961d384c75e89a8ec945fe52cb2fd76cd69a841b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-25 Jer Noble <jer.noble@apple.com> >+ >+ <video> elements not in the DOM should be allowed to AirPlay >+ https://bugs.webkit.org/show_bug.cgi?id=193837 >+ >+ Reviewed by Eric Carlson. >+ >+ * media/airplay-allows-buffering-expected.txt: Added. >+ * media/airplay-allows-buffering.html: Added. >+ * platform/ios/TestExpectations: >+ > 2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, skip all resource load statistics tests on GTK >diff --git a/LayoutTests/media/airplay-allows-buffering-expected.txt b/LayoutTests/media/airplay-allows-buffering-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d6030e1c1d72d8f919b20a250aab24c5a0d0344d >--- /dev/null >+++ b/LayoutTests/media/airplay-allows-buffering-expected.txt >@@ -0,0 +1,13 @@ >+EVENT(load) >+RUN(internals.setMockMediaPlaybackTargetPickerEnabled(true)) >+RUN(video.src = findMediaFile('video', 'content/test')) >+EVENT(loadedmetadata) >+RUN(video.parentNode.removeChild(video)) >+EXPECTED (internals.elementShouldBufferData(video) == 'false') OK >+RUN(video.webkitShowPlaybackTargetPicker()) >+RUN(internals.setMockMediaPlaybackTargetPickerState('Sleepy TV', 'DeviceAvailable')) >+EVENT(webkitcurrentplaybacktargetiswirelesschanged) >+EXPECTED (video.webkitCurrentPlaybackTargetIsWireless == 'true') OK >+EXPECTED (internals.elementShouldBufferData(video) == 'true') OK >+END OF TEST >+ >diff --git a/LayoutTests/media/airplay-allows-buffering.html b/LayoutTests/media/airplay-allows-buffering.html >new file mode 100644 >index 0000000000000000000000000000000000000000..75f5803cc24200b497983b716aa5a1327d0d2c0f >--- /dev/null >+++ b/LayoutTests/media/airplay-allows-buffering.html >@@ -0,0 +1,37 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] --> >+<html> >+<head> >+ <title>airplay-allows-buffering</title> >+ <script src="media-file.js"></script> >+ <script src="video-test.js"></script> >+ <script> >+ >+ waitFor(window, 'load').then(async event => { >+ findMediaElement(); >+ >+ run('internals.setMockMediaPlaybackTargetPickerEnabled(true)'); >+ >+ run(`video.src = findMediaFile('video', 'content/test')`); >+ await waitFor(video, 'loadedmetadata'); >+ >+ run(`video.parentNode.removeChild(video)`); >+ await testExpectedEventually('internals.elementShouldBufferData(video)', false); >+ >+ run(`video.webkitShowPlaybackTargetPicker()`); >+ await sleepFor(100); >+ >+ run(`internals.setMockMediaPlaybackTargetPickerState('Sleepy TV', 'DeviceAvailable')`); >+ await waitFor(video, 'webkitcurrentplaybacktargetiswirelesschanged'); >+ testExpected('video.webkitCurrentPlaybackTargetIsWireless', true); >+ >+ await testExpectedEventually('internals.elementShouldBufferData(video)', true); >+ >+ endTest(); >+ }); >+ >+ </script> >+</head> >+<body> >+ <video controls preload='metadata'></video> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 49dd3f62eaa93b623958564101387ca50a112558..11679cc8df210e3a11b99098a7049030e70c192d 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -2466,6 +2466,7 @@ webkit.org/b/142969 editing/spelling/copy-paste-crash.html > platform/ios/media/video-interruption-suspendunderlock.html [ Skip ] > > media/accessibility-closed-captions-has-aria-owns.html >+media/airplay-allows-buffering.html > media/airplay-autoplay.html > media/airplay-target-availability.html > media/audio-delete-while-slider-thumb-clicked.html
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193837
:
360140
|
360141
|
360162
| 360195