Bug 1566199 - check 'isAudioOnly' for knowing if we have rendering area or not. r=Gijs
authoralwu <alwu@mozilla.com>
Tue, 24 Mar 2020 19:19:07 +0000
changeset 520287 0e7a3ae29aa06ca711de68abbad94c37109b2320
parent 520286 fec7d30f881143c9aa5ed4348bf378385ba8425a
child 520288 fec9a6f7ae39fde00022e7975b7f965fe53018fe
push id110987
push useralwu@mozilla.com
push dateTue, 24 Mar 2020 20:21:56 +0000
treeherderautoland@0e7a3ae29aa0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1566199
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1566199 - check 'isAudioOnly' for knowing if we have rendering area or not. r=Gijs The not-preloaded video would have `0` width and height, so using width and length as a condition of showing caption or not would incorrectly exclude the not-preloaded video. Therefore, we should check `isAudioOnly` instead. Differential Revision: https://phabricator.services.mozilla.com/D68074
toolkit/content/widgets/videocontrols.js
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -1818,17 +1818,17 @@ this.VideoControlsImplWidget = class {
       },
 
       get isCastingAvailable() {
         return !this.isAudioOnly && this.video.mozAllowCasting;
       },
 
       get isClosedCaptionAvailable() {
         // There is no rendering area, no need to show the caption.
-        if (!this.video.videoWidth || !this.video.videoHeight) {
+        if (this.isAudioOnly) {
           return false;
         }
         return this.overlayableTextTracks.length;
       },
 
       get overlayableTextTracks() {
         return Array.prototype.filter.call(
           this.video.textTracks,