From ba61876b1349f3e47de935eb2a33ff025a31509f Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Wed, 16 Aug 2017 16:38:07 -0500 Subject: [PATCH] Log an error using less scary words --- modules/UI/videolayout/VideoContainer.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js index f554b6a5f..1211ebf8e 100644 --- a/modules/UI/videolayout/VideoContainer.js +++ b/modules/UI/videolayout/VideoContainer.js @@ -10,6 +10,8 @@ export const VIDEO_CONTAINER_TYPE = 'camera'; const FADE_DURATION_MS = 300; +const logger = require('jitsi-meet-logger').getLogger(__filename); + /** * Returns an array of the video dimensions, so that it keeps it's aspect * ratio and fits available area with it's larger dimension. This method @@ -617,6 +619,15 @@ export class VideoContainer extends LargeContainer { */ _showVideoBackground() { this.$videoBackground.css({ visibility: 'visible' }); - this.$videoBackground[0].play(); + + // XXX HTMLMediaElement.play's Promise may be rejected. Certain + // environments such as Google Chrome and React Native will report the + // rejection as unhandled. And that may appear scary depending on how + // the environment words the report. To reduce the risk of scaring a + // developer, make sure that the rejection is handled. We cannot really + // do anything substantial about the rejection and, more importantly, we + // do not care. + this.$videoBackground[0].play() + .catch(reason => logger.error(reason)); } }