Skip to content

Commit

Permalink
fix(FEC-8566): playlist flashing and control bar with video area move…
Browse files Browse the repository at this point in the history
…d slowly down (#3918)
  • Loading branch information
Dan Ziv authored and OrenMe committed Oct 10, 2018
1 parent 606c329 commit 9117270
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions modules/EmbedPlayer/resources/mw.EmbedPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
// Widget loaded should only fire once
'widgetLoaded': false,

// Holds the current player state
// Holds the current player state
currentState: null,

// If the player supports playbackRate ( currently available on some html5 browsers )
Expand Down Expand Up @@ -841,7 +841,7 @@
this.updatePlaybackInterface();
return;
}

// Auto select player based on default order
if (this.mediaElement.selectedSource) {

Expand Down Expand Up @@ -1434,8 +1434,8 @@
containerHeight + ', components: ' + this.layoutBuilder.getComponentsHeight() +
', videoHolder old height: ' + currentHeight + ', new height: ' + newHeight +
' hight delta: ' + deltaHeight);
// Update videoHolder height if more than 1 px delta
// ( somehow we are hitting the weird iOS resize bug issues again )
// Update videoHolder height if more than 1 px delta
// ( somehow we are hitting the weird iOS resize bug issues again )
if (currentHeight !== newHeight && deltaHeight > 1) {
this.getVideoHolder().height(newHeight);
}
Expand All @@ -1462,10 +1462,15 @@

// add a binding for window resize if we are in an iframe
if (mw.getConfig('EmbedPlayer.IsIframeServer')) {
$(window).off("debouncedresize").on("debouncedresize", function () {
mw.log('debouncedresize:: call doUpdateLayout');
_this.triggerHelper('resizeEvent');
_this.doUpdateLayout();
var windowWidth = $(window).width();
$(window).off("debouncedresize").on("debouncedresize", function () {
if ($(window).width() !== windowWidth) {
// Update the window width for next time
windowWidth = $(window).width();
mw.log('debouncedresize:: call doUpdateLayout');
_this.triggerHelper('resizeEvent');
_this.doUpdateLayout();
}
});
}
}
Expand Down Expand Up @@ -2292,7 +2297,7 @@
mw.log("EmbedPlayer:: play: " + this._propagateEvents + ' isStopped: ' + _this.isStopped());
this.absoluteStartPlayTime = new Date().getTime();

// Ignore play request if player error is displayed:
// Ignore play request if player error is displayed:
if (this.getError()) {
return false;
}
Expand Down Expand Up @@ -2510,7 +2515,7 @@
pauseInterfaceUpdate: function () {
var _this = this;
mw.log("EmbedPlayer::pauseInterfaceUpdate");
// don't display a loading spinner if paused:
// don't display a loading spinner if paused:
this.hideSpinner();
// trigger on pause interface updates
this.disableComponentsHover();
Expand Down Expand Up @@ -3342,7 +3347,7 @@
this.bufferEndTime = new Date().getTime();
// update lastBufferDuration
this.lastBufferDuration = ( ( this.bufferEndTime - this.bufferStartTime ) / 1000 ).toFixed(3);
// trigger event:
// trigger event:
$(this).trigger('bufferEndEvent', {'bufferDuration': this.lastBufferDuration});
if (!mw.getConfig('EmbedPlayer.DisableBufferingSpinner')) {
this.hideSpinner();
Expand Down

0 comments on commit 9117270

Please sign in to comment.