Container doesn't resize if YouTube API has already been loaded, ending up in a vertically cropped video.
Code-wise, we get an early return and the relevant initialisation doesn't occur.
|
if (window.onYouTubeIframeAPIReady !== undefined) return; |
Example use-case: Adapt embedded in a page which had already loaded the API via another script (in this case Google tag manager). In this case, it means the code returns early, as window.onYouTubeIframeAPIReady is already defined. We've fixed this by forcibly changing the logic in the above code to check for Adapt.youTubeIframeAPIReady, rather than window.onYouTubeIframeAPIReady !== undefined, however this has the potential to cause issues with whatever code loaded the API originally.
Your environment
- FW v5.51.2
- adapt-youtube v3.3.0
Steps to reproduce
Load component in a page that has already loaded the API.
Expected behaviour
Component should resize to contain the full video.
Actual behaviour
Video will be cropped.
Container doesn't resize if YouTube API has already been loaded, ending up in a vertically cropped video.
Code-wise, we get an early return and the relevant initialisation doesn't occur.
adapt-youtube/js/YouTubeView.js
Line 25 in b2e7876
Example use-case: Adapt embedded in a page which had already loaded the API via another script (in this case Google tag manager). In this case, it means the code returns early, as
window.onYouTubeIframeAPIReadyis already defined. We've fixed this by forcibly changing the logic in the above code to check forAdapt.youTubeIframeAPIReady, rather thanwindow.onYouTubeIframeAPIReady !== undefined, however this has the potential to cause issues with whatever code loaded the API originally.Your environment
Steps to reproduce
Load component in a page that has already loaded the API.
Expected behaviour
Component should resize to contain the full video.
Actual behaviour
Video will be cropped.