From 2e0881564476951c28ffdf161bfe3c2ccf1e847f Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Mon, 5 Jun 2017 16:41:16 -0700 Subject: [PATCH] fix(video): use onplaying to ensure video height and width are set When using onplay in firefox, the event fires before data is flowing, which can cause videoHeight and videoWidth to be 0 during resizing. By using onplaying, there is some assurance data is being received, so videoHeight and videoWidth should be set. --- modules/UI/videolayout/VideoContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js index 25ae512e3..9f1ab8dbc 100644 --- a/modules/UI/videolayout/VideoContainer.js +++ b/modules/UI/videolayout/VideoContainer.js @@ -206,7 +206,7 @@ export class VideoContainer extends LargeContainer { this.avatarHeight = $("#dominantSpeakerAvatar").height(); - var onPlayCallback = function (event) { + var onPlayingCallback = function (event) { if (typeof resizeContainer === 'function') { resizeContainer(event); } @@ -215,7 +215,7 @@ export class VideoContainer extends LargeContainer { // This does not work with Temasys plugin - has to be a property to be // copied between new elements //this.$video.on('play', onPlay); - this.$video[0].onplay = onPlayCallback; + this.$video[0].onplaying = onPlayingCallback; /** * A Set of functions to invoke when the video element resizes.