Bug 1126282 - Add a 1.25x faster video speed option in the video controls. r=gijs

MozReview-Commit-ID: GRf265vktMR
This commit is contained in:
Jared Wein 2016-05-09 09:39:00 +02:00
Родитель f2b95368c0
Коммит 48b93f48cd
5 изменённых файлов: 34 добавлений и 18 удалений

Просмотреть файл

@ -133,27 +133,33 @@
<menu id="context-media-playbackrate" label="&mediaPlaybackRate.label;" accesskey="&mediaPlaybackRate.accesskey;">
<menupopup>
<menuitem id="context-media-playbackrate-050x"
label="&mediaPlaybackRate050x.label;"
accesskey="&mediaPlaybackRate050x.accesskey;"
label="&mediaPlaybackRate050x2.label;"
accesskey="&mediaPlaybackRate050x2.accesskey;"
type="radio"
name="playbackrate"
oncommand="gContextMenu.mediaCommand('playbackRate', 0.5);"/>
<menuitem id="context-media-playbackrate-100x"
label="&mediaPlaybackRate100x.label;"
accesskey="&mediaPlaybackRate100x.accesskey;"
label="&mediaPlaybackRate100x2.label;"
accesskey="&mediaPlaybackRate100x2.accesskey;"
type="radio"
name="playbackrate"
checked="true"
oncommand="gContextMenu.mediaCommand('playbackRate', 1.0);"/>
<menuitem id="context-media-playbackrate-125x"
label="&mediaPlaybackRate125x2.label;"
accesskey="&mediaPlaybackRate125x2.accesskey;"
type="radio"
name="playbackrate"
oncommand="gContextMenu.mediaCommand('playbackRate', 1.25);"/>
<menuitem id="context-media-playbackrate-150x"
label="&mediaPlaybackRate150x.label;"
accesskey="&mediaPlaybackRate150x.accesskey;"
label="&mediaPlaybackRate150x2.label;"
accesskey="&mediaPlaybackRate150x2.accesskey;"
type="radio"
name="playbackrate"
oncommand="gContextMenu.mediaCommand('playbackRate', 1.5);"/>
<menuitem id="context-media-playbackrate-200x"
label="&mediaPlaybackRate200x.label;"
accesskey="&mediaPlaybackRate200x.accesskey;"
label="&mediaPlaybackRate200x2.label;"
accesskey="&mediaPlaybackRate200x2.accesskey;"
type="radio"
name="playbackrate"
oncommand="gContextMenu.mediaCommand('playbackRate', 2.0);"/>

Просмотреть файл

@ -483,6 +483,7 @@ nsContextMenu.prototype = {
if (onMedia) {
this.setItemAttr("context-media-playbackrate-050x", "checked", this.target.playbackRate == 0.5);
this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0);
this.setItemAttr("context-media-playbackrate-125x", "checked", this.target.playbackRate == 1.25);
this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5);
this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0);
var hasError = this.target.error != null ||
@ -494,6 +495,7 @@ nsContextMenu.prototype = {
this.setItemAttr("context-media-playbackrate", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-050x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-100x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-125x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-150x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-200x", "disabled", hasError);
this.setItemAttr("context-media-showcontrols", "disabled", hasError);

Просмотреть файл

@ -112,6 +112,7 @@ add_task(function* test_video_ok() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", true,
"context-media-playbackrate-100x", true,
"context-media-playbackrate-125x", true,
"context-media-playbackrate-150x", true,
"context-media-playbackrate-200x", true], null,
"context-media-hidecontrols", true,
@ -137,6 +138,7 @@ add_task(function* test_audio_in_video() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", true,
"context-media-playbackrate-100x", true,
"context-media-playbackrate-125x", true,
"context-media-playbackrate-150x", true,
"context-media-playbackrate-200x", true], null,
"context-media-showcontrols", true,
@ -156,6 +158,7 @@ add_task(function* test_video_bad() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", false,
"context-media-playbackrate-100x", false,
"context-media-playbackrate-125x", false,
"context-media-playbackrate-150x", false,
"context-media-playbackrate-200x", false], null,
"context-media-hidecontrols", false,
@ -181,6 +184,7 @@ add_task(function* test_video_bad2() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", false,
"context-media-playbackrate-100x", false,
"context-media-playbackrate-125x", false,
"context-media-playbackrate-150x", false,
"context-media-playbackrate-200x", false], null,
"context-media-hidecontrols", false,
@ -240,6 +244,7 @@ add_task(function* test_video_in_iframe() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", true,
"context-media-playbackrate-100x", true,
"context-media-playbackrate-125x", true,
"context-media-playbackrate-150x", true,
"context-media-playbackrate-200x", true], null,
"context-media-hidecontrols", true,
@ -277,6 +282,7 @@ add_task(function* test_audio_in_iframe() {
"context-media-playbackrate", null,
["context-media-playbackrate-050x", true,
"context-media-playbackrate-100x", true,
"context-media-playbackrate-125x", true,
"context-media-playbackrate-150x", true,
"context-media-playbackrate-200x", true], null,
"---", null,

Просмотреть файл

@ -566,17 +566,19 @@ items are mutually exclusive. -->
<!ENTITY mediaUnmute.accesskey "m">
<!ENTITY mediaPlaybackRate.label "Play Speed">
<!ENTITY mediaPlaybackRate.accesskey "l">
<!ENTITY mediaPlaybackRate050x.label "Slow Motion (0.5×)">
<!ENTITY mediaPlaybackRate050x.accesskey "S">
<!ENTITY mediaPlaybackRate100x.label "Normal Speed">
<!ENTITY mediaPlaybackRate100x.accesskey "N">
<!ENTITY mediaPlaybackRate150x.label "High Speed (1.5×)">
<!ENTITY mediaPlaybackRate150x.accesskey "H">
<!-- LOCALIZATION NOTE: "Ludicrous Speed" is a reference to the
<!ENTITY mediaPlaybackRate050x2.label "Slow (0.5×)">
<!ENTITY mediaPlaybackRate050x2.accesskey "S">
<!ENTITY mediaPlaybackRate100x2.label "Normal">
<!ENTITY mediaPlaybackRate100x2.accesskey "N">
<!ENTITY mediaPlaybackRate125x2.label "Fast (1.25×)">
<!ENTITY mediaPlaybackRate125x2.accesskey "F">
<!ENTITY mediaPlaybackRate150x2.label "Faster (1.5×)">
<!ENTITY mediaPlaybackRate150x2.accesskey "a">
<!-- LOCALIZATION NOTE: "Ludicrous" is a reference to the
movie "Space Balls" and is meant to say that this speed is very
fast. -->
<!ENTITY mediaPlaybackRate200x.label "Ludicrous Speed (2×)">
<!ENTITY mediaPlaybackRate200x.accesskey "L">
<!ENTITY mediaPlaybackRate200x2.label "Ludicrous (2×)">
<!ENTITY mediaPlaybackRate200x2.accesskey "L">
<!-- LOCALIZATION NOTE: The access keys for "Show Controls" and
"Hide Controls" are the same because the two context-menu
items are mutually exclusive. -->

Просмотреть файл

@ -670,7 +670,7 @@ this.BrowserUITelemetry = {
"marklinkMenu", "copyemail", "copylink", "media-play", "media-pause",
"media-mute", "media-unmute", "media-playbackrate",
"media-playbackrate-050x", "media-playbackrate-100x",
"media-playbackrate-150x", "media-playbackrate-200x",
"media-playbackrate-125x", "media-playbackrate-150x", "media-playbackrate-200x",
"media-showcontrols", "media-hidecontrols", "video-showstats",
"video-hidestats", "video-fullscreen", "leave-dom-fullscreen",
"reloadimage", "viewimage", "viewvideo", "copyimage-contents", "copyimage",