WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 163677
[Modern Media Controls] Media Controller: mute support
https://bugs.webkit.org/show_bug.cgi?id=163677
Summary
[Modern Media Controls] Media Controller: mute support
Antoine Quint
Reported
2016-10-19 11:49:50 PDT
We need media controller support for the mute button and when the media is muted via the media API.
Attachments
Patch
(41.09 KB, patch)
2016-10-19 12:34 PDT
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch for landing
(45.69 KB, patch)
2016-10-19 23:10 PDT
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-10-19 11:50:24 PDT
<
rdar://problem/28851582
>
Antoine Quint
Comment 2
2016-10-19 12:34:15 PDT
Created
attachment 292094
[details]
Patch
Dean Jackson
Comment 3
2016-10-19 12:46:31 PDT
Comment on
attachment 292094
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=292094&action=review
> Source/WebCore/ChangeLog:11 > + We introduce the MuteSupport class which brings support for muting the media > + by clicking on the mute button in the media controls and correctly reflecting > + the media's muted state should the media be muted via the media API.
I understand this is the overall goal, but it seems overkill that muting, which is just a toggle button, requires its own class. It only does two things: 1. this.mediaController.media.muted = !this.mediaController.media.muted 2. this.control.muted = this.mediaController.media.muted; This is basically the same as the play button. And the skip back button only has one task. Is there a way to simplify all this so you're not making new classes (and files) for all these basic tasks? Airplay, fullscreen, etc are more complicated, so that makes sense.
Antoine Quint
Comment 4
2016-10-19 13:24:05 PDT
(In reply to
comment #3
)
> Comment on
attachment 292094
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=292094&action=review
> > > Source/WebCore/ChangeLog:11 > > + We introduce the MuteSupport class which brings support for muting the media > > + by clicking on the mute button in the media controls and correctly reflecting > > + the media's muted state should the media be muted via the media API. > > I understand this is the overall goal, but it seems overkill that muting, > which is just a toggle button, requires its own class. It only does two > things: > > 1. this.mediaController.media.muted = !this.mediaController.media.muted > 2. this.control.muted = this.mediaController.media.muted; > > This is basically the same as the play button. And the skip back button only > has one task. > > Is there a way to simplify all this so you're not making new classes (and > files) for all these basic tasks? Airplay, fullscreen, etc are more > complicated, so that makes sense.
It's a relatively basic task and I believe it remains basic. What got the previous codebase so convoluted is how everything was lumped together, event handlers for a given event accomplishing many different things. I don't think adding a file is a big deal… although I did forget, in this patch and the previous patch, to add the file to the WebCore project and the RenderThemeMac::mediaControlsScript() method.
Dean Jackson
Comment 5
2016-10-19 13:34:58 PDT
> > I understand this is the overall goal, but it seems overkill that muting, > > which is just a toggle button, requires its own class. It only does two > > things: > > > > 1. this.mediaController.media.muted = !this.mediaController.media.muted > > 2. this.control.muted = this.mediaController.media.muted; > > > > This is basically the same as the play button. And the skip back button only > > has one task. > > > > Is there a way to simplify all this so you're not making new classes (and > > files) for all these basic tasks? Airplay, fullscreen, etc are more > > complicated, so that makes sense. > > It's a relatively basic task and I believe it remains basic. What got the > previous codebase so convoluted is how everything was lumped together, event > handlers for a given event accomplishing many different things. I don't > think adding a file is a big deal… although I did forget, in this patch and > the previous patch, to add the file to the WebCore project and the > RenderThemeMac::mediaControlsScript() method.
I wonder if we can have a shortcut though. Instead of just new MuteSupport()... maybe we could have: new ControlsSupport({ events: "volumechange", handler: (event) => { this.media.muted = !this.media.muted; }, sync: () => { this.control.muted = this.media.muted } }); ... or whatever the right names are.
Antoine Quint
Comment 6
2016-10-19 13:38:54 PDT
(In reply to
comment #5
)
> > > I understand this is the overall goal, but it seems overkill that muting, > > > which is just a toggle button, requires its own class. It only does two > > > things: > > > > > > 1. this.mediaController.media.muted = !this.mediaController.media.muted > > > 2. this.control.muted = this.mediaController.media.muted; > > > > > > This is basically the same as the play button. And the skip back button only > > > has one task. > > > > > > Is there a way to simplify all this so you're not making new classes (and > > > files) for all these basic tasks? Airplay, fullscreen, etc are more > > > complicated, so that makes sense. > > > > It's a relatively basic task and I believe it remains basic. What got the > > previous codebase so convoluted is how everything was lumped together, event > > handlers for a given event accomplishing many different things. I don't > > think adding a file is a big deal… although I did forget, in this patch and > > the previous patch, to add the file to the WebCore project and the > > RenderThemeMac::mediaControlsScript() method. > > I wonder if we can have a shortcut though. Instead of just new > MuteSupport()... maybe we could have: > > new ControlsSupport({ > events: "volumechange", > handler: (event) => { this.media.muted = !this.media.muted; }, > sync: () => { this.control.muted = this.media.muted } > }); > > ... or whatever the right names are.
That's fine for this specific class, the way it is now. But I don't think it's worth it. A new file keeps things simple. Where is the code related to dealing with mute? I know: the MuteSupport file and class! All features are dealt with the same way, each with their own MediaControllerSupport class and file. It's really kind of a template, there is no real added complexity. I really wouldn't like to treat different kind of media features in different ways for the media controller, it helps keeping things in a strict framework so it doesn't become a mess like the old code did.
Dean Jackson
Comment 7
2016-10-19 13:41:48 PDT
(In reply to
comment #6
)
> That's fine for this specific class, the way it is now. But I don't think > it's worth it. A new file keeps things simple. Where is the code related to > dealing with mute? I know: the MuteSupport file and class! All features are > dealt with the same way, each with their own MediaControllerSupport class > and file. It's really kind of a template, there is no real added complexity. > I really wouldn't like to treat different kind of media features in > different ways for the media controller, it helps keeping things in a strict > framework so it doesn't become a mess like the old code did.
OK. I think it should be MuteButtonSupport then.
Antoine Quint
Comment 8
2016-10-19 23:10:24 PDT
Created
attachment 292154
[details]
Patch for landing
WebKit Commit Bot
Comment 9
2016-10-19 23:46:44 PDT
Comment on
attachment 292154
[details]
Patch for landing Clearing flags on attachment: 292154 Committed
r207587
: <
http://trac.webkit.org/changeset/207587
>
WebKit Commit Bot
Comment 10
2016-10-19 23:46:48 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