From fc4686b8e2e2b7915eefaf74da99d7b3424cbbb7 Mon Sep 17 00:00:00 2001 From: Valera Rozuvan Date: Tue, 11 Mar 2014 15:20:59 +0200 Subject: [PATCH] Add a missing comment documenting the changes done in PR 2841. --- .../xmodule/xmodule/js/src/video/03_video_player.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js index bab774649e..135584d9df 100644 --- a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js +++ b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js @@ -558,6 +558,17 @@ function (HTML5Video, Resizer) { } ); + // Because of a recent change in the YouTube API (not documented), sometimes + // HTML5 mode loads after Flash mode has been loaded. In this case we have + // multiple speeds available but the variable `this.currentPlayerMode` is + // set to "flash". This is impossible because in Flash mode we can have + // only one speed available. Therefore we must execute the following code + // block if we have multiple speeds or if `this.currentPlayerMode` is set to + // "html5". If any of the two conditions are true, we then set the variable + // `this.currentPlayerMode` to "html5". + // + // For more information, please see the PR that introduced this change: + // https://github.com/edx/edx-platform/pull/2841 if ( (this.currentPlayerMode === 'html5' || availablePlaybackRates.length > 1) && this.videoType === 'youtube'