From 54d891afa701f98adc594ea15986939909600d1d Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 17 Mar 2017 16:10:45 -0500 Subject: [PATCH] Updates framerate using local statistics. --- modules/UI/videolayout/ConnectionIndicator.js | 9 +++++++++ modules/UI/videolayout/RemoteVideo.js | 10 ++++++++++ modules/UI/videolayout/VideoLayout.js | 13 +++++++++++++ 3 files changed, 32 insertions(+) diff --git a/modules/UI/videolayout/ConnectionIndicator.js b/modules/UI/videolayout/ConnectionIndicator.js index 70b2a990e..0d234e4a5 100644 --- a/modules/UI/videolayout/ConnectionIndicator.js +++ b/modules/UI/videolayout/ConnectionIndicator.js @@ -409,6 +409,15 @@ ConnectionIndicator.prototype.updateResolution = function (resolution) { this.updatePopoverData(); }; +/** + * Updates the framerate + * @param framerate the new resolution + */ +ConnectionIndicator.prototype.updateFramerate = function (framerate) { + this.framerate = framerate; + this.updatePopoverData(); +}; + /** * Updates the content of the popover if its visible * @param force to work even if popover is not visible diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index 3ccb2897c..44f14b98a 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -744,6 +744,16 @@ RemoteVideo.prototype.updateResolution = function (resolution) { } }; +/** + * Updates this video framerate indication. + * @param framerate the value to update + */ +RemoteVideo.prototype.updateFramerate = function (framerate) { + if (this.connectionIndicator) { + this.connectionIndicator.updateFramerate(framerate); + } +}; + RemoteVideo.prototype.removeConnectionIndicator = function () { if (this.connectionIndicator) this.connectionIndicator.remove(); diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index b058218cc..822b7954c 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -875,6 +875,19 @@ var VideoLayout = { remoteVideo.updateResolution(resolutionValue); } }); + + Object.keys(framerate).forEach(function (id) { + if (APP.conference.isLocalId(id)) { + return; + } + + const framerateValue = framerate[id]; + const remoteVideo = remoteVideos[id]; + + if (framerateValue && remoteVideo) { + remoteVideo.updateFramerate(framerateValue); + } + }); }, /**