fix issue where video player renders twice (TNL-3064)

This commit is contained in:
Adam Palay
2015-08-28 12:26:00 -04:00
parent 44b40b3fde
commit f099a7e911
3 changed files with 34 additions and 5 deletions

View File

@@ -596,7 +596,11 @@ function (VideoPlayer, i18n) {
'[Video info]: YouTube returned an error for ' +
'video with id "' + self.id + '".'
);
self.loadHtmlPlayer();
// If the video is already loaded in `_waitForYoutubeApi` by the
// time we get here, then we shouldn't load it again.
if (!self.htmlPlayerLoaded) {
self.loadHtmlPlayer();
}
});
window.Video.loadYouTubeIFrameAPI(scriptTag);