Bug 1284548 - Use 'Share Audio' label for sharing audio played in <video>. r=?
Vary the 'Share [...]' label depending on the actual use of the <video> tag, as
is done for the 'Save [...]' label.
MozReview-Commit-ID: Ga6RqV5dCby
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -791,27 +791,31 @@ var BrowserApp = {
NativeWindow.contextmenus.add(stringGetter("contextmenu.showControls2"),
NativeWindow.contextmenus.mediaContext("media-hidingcontrols"),
function(aTarget) {
UITelemetry.addEvent("action.1", "contextmenu", null, "web_controls_media");
aTarget.setAttribute("controls", true);
});
NativeWindow.contextmenus.add({
- label: stringGetter("contextmenu.shareMedia"),
+ label: function(aTarget) {
+ return Strings.browser.GetStringFromName(
+ `contextmenu.share${videoClassifier(aTarget)}2`
+ );
+ },
order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1,
selector: NativeWindow.contextmenus._disableRestricted(
"SHARE", NativeWindow.contextmenus.videoContext()),
showAsActions: function(aElement) {
let url = (aElement.currentSrc || aElement.src);
let title = aElement.textContent || aElement.title;
return {
title: title,
uri: url,
- type: "video/*",
+ type: videoClassifier(aElement) === "Audio" ? "audio/*" : "video/*",
};
},
icon: "drawable://ic_menu_share",
callback: function(aTarget) {
// share.1 telemetry is handled in Java via PromptList
UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_media");
}
});
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -310,17 +310,19 @@ contextmenu.setImageAs=Set Image As
# significantly longer than the translation for the "Paste" action then this might trigger an
# Android bug positioning the floating text selection partially off the screen. This issue heavily
# depends on the screen size and the specific translations. For English "Paste" / "Add search engine"
# is working while "Paste" / "Add as search engine" triggers the bug. See bug 1262098 for more details.
# Manual testing the scenario described in bug 1262098 is highly recommended.
contextmenu.addSearchEngine3=Add Search Engine
contextmenu.playMedia=Play
contextmenu.pauseMedia=Pause
-contextmenu.shareMedia=Share Video
+contextmenu.shareMedia2=Share Media
+contextmenu.shareVideo2=Share Video
+contextmenu.shareAudio2=Share Audio
contextmenu.showControls2=Show Controls
contextmenu.mute=Mute
contextmenu.unmute=Unmute
contextmenu.saveVideo=Save Video
contextmenu.saveAudio=Save Audio
# LOCALIZATION NOTE (contextmenu.saveMedia):
# The label that will be used in the contextmenu in place of "Save Video" or "Save Audio", for
# unloaded video elements.