Bug 180781

Summary: Playing media elements which call "pause(); play()" will have the play promise rejected.
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: MediaAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, eric.carlson, ews-watchlist, jlewis3, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews100 for mac-elcapitan
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Archive of layout-test-results from ews116 for mac-elcapitan
none
Patch
none
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews105 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Archive of layout-test-results from ews113 for mac-elcapitan
none
Patch for landing
none
Follow-up patch
none
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews115 for mac-elcapitan
none
Follow-up patch
none
Archive of layout-test-results from ews103 for mac-elcapitan
none
Follow-up patch
none
Follow-up patch none

Description Jer Noble 2017-12-13 16:24:53 PST
Playing media elements which call "pause(); play()" will have the play promise rejected.
Comment 1 Jer Noble 2017-12-13 16:25:52 PST
<rdar://problem/33191377>
Comment 2 Jer Noble 2017-12-13 16:28:34 PST
Created attachment 329280 [details]
Patch
Comment 3 EWS Watchlist 2017-12-13 17:13:42 PST Comment hidden (obsolete)
Comment 4 EWS Watchlist 2017-12-13 17:13:43 PST Comment hidden (obsolete)
Comment 5 EWS Watchlist 2017-12-13 17:37:13 PST Comment hidden (obsolete)
Comment 6 EWS Watchlist 2017-12-13 17:37:14 PST Comment hidden (obsolete)
Comment 7 EWS Watchlist 2017-12-13 17:42:33 PST Comment hidden (obsolete)
Comment 8 EWS Watchlist 2017-12-13 17:42:35 PST Comment hidden (obsolete)
Comment 9 EWS Watchlist 2017-12-13 18:54:59 PST Comment hidden (obsolete)
Comment 10 EWS Watchlist 2017-12-13 18:55:00 PST Comment hidden (obsolete)
Comment 11 Jer Noble 2017-12-15 11:18:20 PST
Created attachment 329498 [details]
Patch
Comment 12 Eric Carlson 2017-12-15 11:25:12 PST
Comment on attachment 329498 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=329498&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:3501
> +        if (m_readyState <= HAVE_CURRENT_DATA)
> +            scheduleEvent(eventNames().waitingEvent);
> +        else if (m_readyState >= HAVE_FUTURE_DATA)
> +            scheduleNotifyAboutPlaying();

Nit: you should mention this fix in the ChangeLog.
Comment 13 EWS Watchlist 2017-12-15 12:18:50 PST Comment hidden (obsolete)
Comment 14 EWS Watchlist 2017-12-15 12:18:52 PST Comment hidden (obsolete)
Comment 15 EWS Watchlist 2017-12-15 12:28:50 PST Comment hidden (obsolete)
Comment 16 EWS Watchlist 2017-12-15 12:28:51 PST Comment hidden (obsolete)
Comment 17 EWS Watchlist 2017-12-15 12:43:36 PST Comment hidden (obsolete)
Comment 18 EWS Watchlist 2017-12-15 12:43:37 PST Comment hidden (obsolete)
Comment 19 EWS Watchlist 2017-12-15 13:06:39 PST Comment hidden (obsolete)
Comment 20 EWS Watchlist 2017-12-15 13:06:40 PST Comment hidden (obsolete)
Comment 21 Jer Noble 2017-12-15 17:58:06 PST
Created attachment 329551 [details]
Patch for landing
Comment 22 WebKit Commit Bot 2017-12-18 09:43:55 PST
Comment on attachment 329551 [details]
Patch for landing

Clearing flags on attachment: 329551

Committed r226059: <https://trac.webkit.org/changeset/226059>
Comment 23 WebKit Commit Bot 2017-12-18 09:43:56 PST
All reviewed patches have been landed.  Closing bug.
Comment 24 Darin Adler 2017-12-18 10:26:49 PST
Comment on attachment 329551 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=329551&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:3454
> +        return; // Treat as success because we will begin playback on cessation of the interruption.

This comment no longer makes much sense. Before it was explaining the reason this returned true instead of false. But what does "treat as success" mean now? I think we should just remove the comment unless we have something interesting to say here.
Comment 25 Matt Lewis 2017-12-18 16:12:29 PST
This patch caused 3 API test to start Timing out:
 RequiresUserActionForPlaybackTest.DeprecatedRequiresUserActionForVideoButNotAudioPlayback
 RequiresUserActionForPlaybackTest.RequiresUserActionForVideoButNotAudioPlayback
 WebKit.WebsitePoliciesAutoplayEnabled

https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20WK2%20%28Tests%29/builds/2026

https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20WK2%20%28Tests%29/builds/2026/steps/run-api-tests/logs/stdio
Comment 26 Jer Noble 2017-12-19 08:51:53 PST
Reopening to attach new patch.
Comment 27 Jer Noble 2017-12-19 08:51:56 PST
Created attachment 329764 [details]
Follow-up patch
Comment 28 EWS Watchlist 2017-12-19 09:53:39 PST Comment hidden (obsolete)
Comment 29 EWS Watchlist 2017-12-19 09:53:40 PST Comment hidden (obsolete)
Comment 30 EWS Watchlist 2017-12-19 10:13:07 PST Comment hidden (obsolete)
Comment 31 EWS Watchlist 2017-12-19 10:13:09 PST Comment hidden (obsolete)
Comment 32 EWS Watchlist 2017-12-19 10:26:45 PST Comment hidden (obsolete)
Comment 33 EWS Watchlist 2017-12-19 10:26:46 PST Comment hidden (obsolete)
Comment 34 Jer Noble 2017-12-19 12:42:53 PST
Created attachment 329796 [details]
Follow-up patch
Comment 35 EWS Watchlist 2017-12-19 13:31:21 PST
Comment on attachment 329796 [details]
Follow-up patch

Attachment 329796 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5757553

New failing tests:
media/video-load-require-user-gesture.html
Comment 36 EWS Watchlist 2017-12-19 13:31:23 PST
Created attachment 329805 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 37 Jer Noble 2017-12-19 13:55:40 PST
Created attachment 329814 [details]
Follow-up patch
Comment 38 Jer Noble 2017-12-19 13:58:23 PST
Created attachment 329816 [details]
Follow-up patch
Comment 39 WebKit Commit Bot 2017-12-19 15:16:13 PST
Comment on attachment 329816 [details]
Follow-up patch

Clearing flags on attachment: 329816

Committed r226150: <https://trac.webkit.org/changeset/226150>
Comment 40 WebKit Commit Bot 2017-12-19 15:16:15 PST
All reviewed patches have been landed.  Closing bug.