Bug 1354465 P2 - use mozvideoonlyseekbegin event to start throbber timer; r?jwwang,jaws draft
authorKaku Kuo <kaku@mozilla.com>
Fri, 07 Apr 2017 18:06:20 +0800
changeset 560062 7141018acf0780388e83bf535763f6422093d190
parent 560061 107b6863c92f5300a75e9b3013a678aef757e0f4
child 560064 2e12a4f113da8432c555c9a15e0b631d408abbc8
push id53312
push userbmo:kaku@mozilla.com
push dateTue, 11 Apr 2017 02:39:57 +0000
reviewersjwwang, jaws
bugs1354465
milestone55.0a1
Bug 1354465 P2 - use mozvideoonlyseekbegin event to start throbber timer; r?jwwang,jaws MozReview-Commit-ID: 4zwcoB8M3xI
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -217,17 +217,17 @@
 
       textTracksCount: 0,
       randomID: 0,
       videoEvents: ["play", "pause", "ended", "volumechange", "loadeddata",
                     "loadstart", "timeupdate", "progress",
                     "playing", "waiting", "canplay", "canplaythrough",
                     "seeking", "seeked", "emptied", "loadedmetadata",
                     "error", "suspend", "stalled",
-                    "mozexitvideosuspend", "mozvideoonlyseekcompleted"],
+                    "mozvideoonlyseekbegin", "mozvideoonlyseekcompleted"],
 
       showHours: false,
       firstFrameShown: false,
       timeUpdateCount: 0,
       maxCurrentTimeSeen: 0,
       isPausedByDragging: false,
       _isAudioOnly: false,
 
@@ -500,19 +500,19 @@
 
       /*
        * We suspend a video element's video decoder if the video
        * element is invisible. However, resuming the video decoder
        * takes time and we show the throbber UI if it takes more than
        * 250 ms.
        *
        * When an already-suspended video element becomes visible, we
-       * resume its video decoder immediately and queue a seek task to
-       * seek the resumed video decoder to the current position;
-       * meanwhile, we also file a "mozexitvideosuspend" event which
+       * resume its video decoder immediately and queue a video-only seek
+       * task to seek the resumed video decoder to the current position;
+       * meanwhile, we also file a "mozvideoonlyseekbegin" event which
        * we used to start the timer here.
        *
        * Once the queued seek operation is done, we dispatch a
        * "canplay" event which indicates that the resuming operation
        * is completed.
        */
       SHOW_THROBBER_TIMEOUT_MS: 250,
       _showThrobberTimer: null,
@@ -695,17 +695,17 @@
               this.setupStatusFader(true);
               // If video hasn't shown anything yet, disable the controls.
               if (!this.firstFrameShown) {
                 this.startFadeOut(this.controlBar);
               }
               this.controlsSpacer.removeAttribute("hideCursor");
             }
             break;
-          case "mozexitvideosuspend":
+          case "mozvideoonlyseekbegin":
             this._delayShowThrobberWhileResumingVideoDecoder();
             break;
           case "mozvideoonlyseekcompleted":
             this._cancelShowThrobberWhileResumingVideoDecoder();
             this.setupStatusFader();
             break;
           default:
             this.log("!!! event " + aEvent.type + " not handled!");