mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
Bug 881251 - Add mute/unmute to media context menus. r=lucasr
This commit is contained in:
parent
9f0f0b2d59
commit
d394cb78fc
@ -543,6 +543,18 @@ var BrowserApp = {
|
||||
aTarget.mozRequestFullScreen();
|
||||
});
|
||||
|
||||
NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.mute"),
|
||||
NativeWindow.contextmenus.mediaContext("media-unmuted"),
|
||||
function(aTarget) {
|
||||
aTarget.muted = true;
|
||||
});
|
||||
|
||||
NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.unmute"),
|
||||
NativeWindow.contextmenus.mediaContext("media-muted"),
|
||||
function(aTarget) {
|
||||
aTarget.muted = false;
|
||||
});
|
||||
|
||||
NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.copyImageLocation"),
|
||||
NativeWindow.contextmenus.imageLocationCopyableContext,
|
||||
function(aTarget) {
|
||||
@ -1942,6 +1954,12 @@ var NativeWindow = {
|
||||
let controls = aElt.controls;
|
||||
if (!controls && aMode == "media-hidingcontrols")
|
||||
return true;
|
||||
|
||||
let muted = aElt.muted;
|
||||
if (muted && aMode == "media-muted")
|
||||
return true;
|
||||
else if (!muted && aMode == "media-unmuted")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -164,6 +164,8 @@ contextmenu.playMedia=Play
|
||||
contextmenu.pauseMedia=Pause
|
||||
contextmenu.shareMedia=Share Video
|
||||
contextmenu.showControls2=Show Controls
|
||||
contextmenu.mute=Mute
|
||||
contextmenu.unmute=Unmute
|
||||
contextmenu.saveVideo=Save Video
|
||||
contextmenu.saveAudio=Save Audio
|
||||
contextmenu.addToContacts=Add to Contacts
|
||||
|
Loading…
Reference in New Issue
Block a user