WebKit Bugzilla
Attachment 361941 Details for
Bug 194615
: [iOS] Add a hack to work around buggy video control library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194615-20190213150002.patch (text/plain), 5.73 KB, created by
Eric Carlson
on 2019-02-13 15:00:02 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2019-02-13 15:00:02 PST
Size:
5.73 KB
patch
obsolete
>Subversion Revision: 241452 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 22adac6207dfa3690eae59a963fa1db62847e746..d7f289b67d0f1b99b29b33240e48967edfb78a65 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-13 Eric Carlson <eric.carlson@apple.com> >+ >+ [iOS] Add a hack to work around buggy video control library >+ https://bugs.webkit.org/show_bug.cgi?id=194615 >+ <rdar://problem/46146946> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: media/ios/video-volume-ios-quirk.html >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop. >+ (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume. >+ (WebCore::HTMLMediaElement::closeTaskQueues): Close it. >+ * html/HTMLMediaElement.h: >+ > 2019-02-13 John Wilander <wilander@apple.com> > > Store Ad Click Attribution requests in the network process >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 3d1e343284bea68b914558e017d2a32f0a7482da..88eae188a0ea032508a5700663601d0397a960c9 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -3722,10 +3722,10 @@ ExceptionOr<void> HTMLMediaElement::setVolume(double volume) > if (!(volume >= 0 && volume <= 1)) > return Exception { IndexSizeError }; > >-#if !PLATFORM(IOS_FAMILY) > if (m_volume == volume) > return { }; > >+#if !PLATFORM(IOS_FAMILY) > if (volume && processingUserGestureForMedia()) > removeBehaviorsRestrictionsAfterFirstUserGesture(MediaElementSession::AllRestrictions & ~MediaElementSession::RequireUserGestureToControlControlsManager); > >@@ -3738,7 +3738,19 @@ ExceptionOr<void> HTMLMediaElement::setVolume(double volume) > pauseInternal(); > setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); > } >+#else >+ auto oldVolume = m_volume; >+ m_volume = volume; >+ >+ if (m_volumeRevertTaskQueue.hasPendingTask()) >+ return { }; >+ >+ m_volumeRevertTaskQueue.scheduleTask([this, oldVolume] { >+ m_volume = oldVolume; >+ }); >+ > #endif >+ > return { }; > } > >@@ -5527,6 +5539,9 @@ void HTMLMediaElement::cancelPendingTasks() > m_updateMediaStateTask.cancelTask(); > m_mediaEngineUpdatedTask.cancelTask(); > m_updatePlayStateTask.cancelTask(); >+#if PLATFORM(IOS_FAMILY) >+ m_volumeRevertTaskQueue.cancelTask(); >+#endif > } > > void HTMLMediaElement::userCancelledLoad() >@@ -5705,6 +5720,9 @@ void HTMLMediaElement::closeTaskQueues() > m_encryptedMediaQueue.close(); > #endif > m_asyncEventQueue.close(); >+#if PLATFORM(IOS_FAMILY) >+ m_volumeRevertTaskQueue.close(); >+#endif > } > > void HTMLMediaElement::contextDestroyed() >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index b90dc29efaa3d242f0b31f586b7e7a0ef0385d73..34e184ae70ca2001988dd1749fa3ca7579b77852 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -967,6 +967,9 @@ private: > GenericTaskQueue<Timer> m_playbackTargetIsWirelessQueue; > RefPtr<TimeRanges> m_playedTimeRanges; > GenericEventQueue m_asyncEventQueue; >+#if PLATFORM(IOS_FAMILY) >+ DeferrableTask<Timer> m_volumeRevertTaskQueue; >+#endif > > PlayPromiseVector m_pendingPlayPromises; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 5b043279ca759f9f5d4773871d9c2099da99ad47..38deb3d652f6a035d610034fd060b1d14f052bae 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-02-13 Eric Carlson <eric.carlson@apple.com> >+ >+ [iOS] Add a hack to work around buggy video control library >+ https://bugs.webkit.org/show_bug.cgi?id=194615 >+ <rdar://problem/46146946> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * media/ios/video-volume-ios-quirk-expected.txt: Added. >+ * media/ios/video-volume-ios-quirk.html: Added. >+ > 2019-02-13 John Wilander <wilander@apple.com> > > Store Ad Click Attribution requests in the network process >diff --git a/LayoutTests/media/ios/video-volume-ios-quirk-expected.txt b/LayoutTests/media/ios/video-volume-ios-quirk-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..04340b87a3b0c1432baf29ecb62c9ae74f3d04e2 >--- /dev/null >+++ b/LayoutTests/media/ios/video-volume-ios-quirk-expected.txt >@@ -0,0 +1,13 @@ >+ >+Test 'volume' attribute >+ >+EXPECTED (video.volume == '1') OK >+RUN(video.volume = 0.5) >+EXPECTED (video.volume == '0.5') OK >+RUN(video.volume = 0) >+EXPECTED (video.volume == '0') OK >+TEST(video.volume = 1.5) THROWS(DOMException.INDEX_SIZE_ERR) OK >+TEST(video.volume = -0.5) THROWS(DOMException.INDEX_SIZE_ERR) OK >+EXPECTED (video.volume == '1') OK >+END OF TEST >+ >diff --git a/LayoutTests/media/ios/video-volume-ios-quirk.html b/LayoutTests/media/ios/video-volume-ios-quirk.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3be41b38b3333db86b6811118b0a85531a62a4a2 >--- /dev/null >+++ b/LayoutTests/media/ios/video-volume-ios-quirk.html >@@ -0,0 +1,19 @@ >+<video controls></video> >+<p>Test 'volume' attribute<p> >+<script src=../media-file.js></script> >+<script src=../video-test.js></script> >+<script> >+ testExpected("video.volume", 1.0); >+ run("video.volume = 0.5"); >+ testExpected("video.volume", 0.5); >+ run("video.volume = 0"); >+ testExpected("video.volume", 0); >+ testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); >+ testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); >+ video.src = findMediaFile("video", "content/test"); >+ >+ setTimeout(function() { >+ testExpected("video.volume", 1.0); >+ endTest(); >+ } , 100); >+</script>
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 194615
: 361941