Skip to content

Commit

Permalink
fix: youtube race condition when GTM loads
Browse files Browse the repository at this point in the history
  • Loading branch information
viadanna authored and Cup0fCoffee committed Sep 29, 2023
1 parent 377bb07 commit fc9b6af
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 fc9b6af

Please sign in to comment.