Bug 1474149 - Allow media seek amount so be configured draft
authorh-h <henrik.hank@aol.de>
Mon, 09 Jul 2018 07:07:07 +0200
changeset 815528 ac31505c57a5af2d129b783f3c36164f911fcebf
parent 815527 ca20160475fdcf131994e8256a619008a1009d6f
push id115530
push userbmo:henrik.hank@aol.de
push dateMon, 09 Jul 2018 05:07:47 +0000
bugs1474149
milestone63.0a1
Bug 1474149 - Allow media seek amount so be configured Satisfied ESLint. MozReview-Commit-ID: 97wsTqRC26M
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -1481,65 +1481,64 @@
             break;
         }
 
         if (String.fromCharCode(event.charCode) == " ") {
           keystroke += "space";
         }
 
         this.log("Got keystroke: " + keystroke);
-        let oldval, newval;
 
         try {
           switch (keystroke) {
             case "space": /* Play */
               let target = event.originalTarget;
               if (target.localName === "button" && !target.disabled) {
                 break;
               }
 
               this.togglePause();
               break;
             case "downArrow": /* Volume decrease */
-              oldval = this.video.volume;
-              this.video.volume = (oldval < 0.1 ? 0 : oldval - 0.1);
+              this.video.volume = this.video.volume < 0.1 ? 0
+                                                          : this.video.volume - 0.1;
               this.video.muted = false;
               break;
             case "upArrow": /* Volume increase */
-              oldval = this.video.volume;
-              this.video.volume = (oldval > 0.9 ? 1 : oldval + 0.1);
+              this.video.volume = this.video.volume > 0.9 ? 1
+                                                          : this.video.volume + 0.1;
               this.video.muted = false;
               break;
             case "accel-downArrow": /* Mute */
               this.video.muted = true;
               break;
             case "accel-upArrow": /* Unmute */
               this.video.muted = false;
               break;
-            case "leftArrow":          /* Seek backward...             */
-            case "rightArrow":         /* ...or forward a fixed amount */
-            case "accel-leftArrow":    /* Seek backward...             */
+            case "leftArrow": /*          Seek backward...             */
+            case "rightArrow": /*         ...or forward a fixed amount */
+            case "accel-leftArrow": /*    Seek backward...             */
             case "accel-rightArrow": { /* ...or forward 10%            */
-              let maxTime = this.video.duration /*s*/ ||
-                            this.maxCurrentTimeSeen /*ms*/ / 1000;
+              let maxTime = this.video.duration /* s */ ||
+                            this.maxCurrentTimeSeen /* ms */ / 1000;
               let seekStepLength = keystroke.startsWith("accel-") ?
                   maxTime * 0.10
-                : this.video.mozSeekStepLength /*s*/;
+                : this.video.mozSeekStepLength /* s */;
               this.video.currentTime = keystroke.endsWith("leftArrow") ?
-                  Math.max(this.video.currentTime - seekStepLength, 0)       // <-
-                : Math.min(this.video.currentTime + seekStepLength, maxTime) // ->
+                  Math.max(this.video.currentTime - seekStepLength, 0) //        <-
+                : Math.min(this.video.currentTime + seekStepLength, maxTime); // ->
               break;
             }
             case "home": /* Seek to beginning */
               this.video.currentTime = 0;
               break;
             case "end": /* Seek to end */
-              if (this.video.currentTime /*s*/ != this.video.duration /*s*/) {
-                this.video.currentTime = this.video.duration /*s*/ ||
-                                         this.maxCurrentTimeSeen /*ms*/ / 1000;
+              if (this.video.currentTime /* s */ != this.video.duration /* s */) {
+                this.video.currentTime = this.video.duration /* s */ ||
+                                         this.maxCurrentTimeSeen /* ms */ / 1000;
               }
               break;
             default:
               return;
           }
         } catch (e) { /* ignore any exception from setting .currentTime */ }
 
         event.preventDefault(); // Prevent page scrolling