Skip to content

Commit

Permalink
fix: youtube race condition when GTM loads (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
viadanna authored Oct 13, 2023
1 parent 63440c5 commit 7d52828
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xmodule/js/src/video/01_initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@
_oldOnYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady || undefined;

window.onYouTubeIframeAPIReady = function() {
window.onYouTubeIframeAPIReady.resolve();
_youtubeApiDeferred.resolve();
};

window.onYouTubeIframeAPIReady.resolve = _youtubeApiDeferred.resolve;
window.onYouTubeIframeAPIReady.done = _youtubeApiDeferred.done;

if (_oldOnYouTubeIframeAPIReady) {
Expand Down

0 comments on commit 7d52828

Please sign in to comment.