Skip to content

Commit

Permalink
fix: youtube race condition when GTM loads
Browse files Browse the repository at this point in the history
(cherry picked from commit 4d8d74b)
  • Loading branch information
viadanna authored and 0x29a committed Dec 28, 2023
1 parent dfb8ac9 commit b9662f4
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 b9662f4

Please sign in to comment.