Pārlūkot izejas kodu

Log an error using less scary words

master
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
ba61876b13
1 mainītis faili ar 12 papildinājumiem un 1 dzēšanām
  1. 12
    1
      modules/UI/videolayout/VideoContainer.js

+ 12
- 1
modules/UI/videolayout/VideoContainer.js Parādīt failu

10
 
10
 
11
 const FADE_DURATION_MS = 300;
11
 const FADE_DURATION_MS = 300;
12
 
12
 
13
+const logger = require('jitsi-meet-logger').getLogger(__filename);
14
+
13
 /**
15
 /**
14
  * Returns an array of the video dimensions, so that it keeps it's aspect
16
  * Returns an array of the video dimensions, so that it keeps it's aspect
15
  * ratio and fits available area with it's larger dimension. This method
17
  * ratio and fits available area with it's larger dimension. This method
617
      */
619
      */
618
     _showVideoBackground() {
620
     _showVideoBackground() {
619
         this.$videoBackground.css({ visibility: 'visible' });
621
         this.$videoBackground.css({ visibility: 'visible' });
620
-        this.$videoBackground[0].play();
622
+
623
+        // XXX HTMLMediaElement.play's Promise may be rejected. Certain
624
+        // environments such as Google Chrome and React Native will report the
625
+        // rejection as unhandled. And that may appear scary depending on how
626
+        // the environment words the report. To reduce the risk of scaring a
627
+        // developer, make sure that the rejection is handled. We cannot really
628
+        // do anything substantial about the rejection and, more importantly, we
629
+        // do not care.
630
+        this.$videoBackground[0].play()
631
+            .catch(reason => logger.error(reason));
621
     }
632
     }
622
 }
633
 }

Notiek ielāde…
Atcelt
Saglabāt