WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
160092
Media controls should not be displayed for a video until it starts playing
https://bugs.webkit.org/show_bug.cgi?id=160092
Summary
Media controls should not be displayed for a video until it starts playing
Wenson Hsieh
Reported
2016-07-22 12:19:23 PDT
Media controls should not be displayed on pages with multiple videos until a video starts playing
Attachments
Patch
(24.62 KB, patch)
2016-07-22 12:30 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Patch
(23.42 KB, patch)
2016-07-22 13:02 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Patch
(15.12 KB, patch)
2016-07-25 13:06 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Patch for landing
(14.96 KB, patch)
2016-07-25 13:22 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2016-07-22 12:20:00 PDT
<
rdar://problem/26986673
>
Wenson Hsieh
Comment 2
2016-07-22 12:30:09 PDT
Created
attachment 284361
[details]
Patch
Wenson Hsieh
Comment 3
2016-07-22 13:02:10 PDT
Created
attachment 284364
[details]
Patch
Darin Adler
Comment 4
2016-07-25 09:58:21 PDT
Comment on
attachment 284364
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=284364&action=review
> Source/WebCore/html/HTMLMediaElement.cpp:7149 > + size_t numberOfSessionsLargeEnoughForMainContent = PlatformMediaSessionManager::sharedManager().sessionsMatching([] (const PlatformMediaSession& session) {
I suggest auto here instead of size_t.
> Source/WebCore/html/HTMLMediaElement.cpp:7153 > + PlatformMediaSession* session = PlatformMediaSessionManager::sharedManager().currentSessionMatching([numberOfSessionsLargeEnoughForMainContent] (const PlatformMediaSession& session) {
I suggest auto* here instead of a specific type.
> Source/WebCore/html/HTMLMediaElement.cpp:7154 > + MediaElementSession::ShowControlsManagerReason reasonForControlsManager = session.reasonForControllingControlsManager();
I think auto would make this line of code shorter without loss of readability.
> Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:292 > + Vector<PlatformMediaSession *> matchingSessions;
Extra space here before the "*".
Wenson Hsieh
Comment 5
2016-07-25 09:59:52 PDT
Comment on
attachment 284364
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=284364&action=review
>> Source/WebCore/html/HTMLMediaElement.cpp:7149 >> + size_t numberOfSessionsLargeEnoughForMainContent = PlatformMediaSessionManager::sharedManager().sessionsMatching([] (const PlatformMediaSession& session) { > > I suggest auto here instead of size_t.
Got it! Changed to use auto.
>> Source/WebCore/html/HTMLMediaElement.cpp:7153 >> + PlatformMediaSession* session = PlatformMediaSessionManager::sharedManager().currentSessionMatching([numberOfSessionsLargeEnoughForMainContent] (const PlatformMediaSession& session) { > > I suggest auto* here instead of a specific type.
Will do.
>> Source/WebCore/html/HTMLMediaElement.cpp:7154 >> + MediaElementSession::ShowControlsManagerReason reasonForControlsManager = session.reasonForControllingControlsManager(); > > I think auto would make this line of code shorter without loss of readability.
Will use auto for this too.
>> Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:292 >> + Vector<PlatformMediaSession *> matchingSessions; > > Extra space here before the "*".
Good catch!
Wenson Hsieh
Comment 6
2016-07-25 13:06:53 PDT
Created
attachment 284517
[details]
Patch
Wenson Hsieh
Comment 7
2016-07-25 13:08:25 PDT
After talking with Beth, I've learned that we should not be showing media controls for large videos before they've ever begun playing. This (much simpler) patch implements that behavior.
Beth Dakin
Comment 8
2016-07-25 13:13:32 PDT
Comment on
attachment 284517
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=284517&action=review
> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:181 > + __block bool isDoneLoading = NO;
Should be BOOL since it's NO?
> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:205 > + __block bool isDoneLoading = NO;
BOOL?
Wenson Hsieh
Comment 9
2016-07-25 13:16:28 PDT
Comment on
attachment 284517
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=284517&action=review
>> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:181 >> + __block bool isDoneLoading = NO; > > Should be BOOL since it's NO?
Oops, good catch! It should be false instead of NO, since TestWebKitAPI::Util::run() takes a bool*.
>> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:205 >> + __block bool isDoneLoading = NO; > > BOOL?
Fixed!
Wenson Hsieh
Comment 10
2016-07-25 13:22:30 PDT
Created
attachment 284519
[details]
Patch for landing
WebKit Commit Bot
Comment 11
2016-07-25 13:52:48 PDT
Comment on
attachment 284519
[details]
Patch for landing Clearing flags on attachment: 284519 Committed
r203698
: <
http://trac.webkit.org/changeset/203698
>
WebKit Commit Bot
Comment 12
2016-07-25 13:52:53 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug