feat: ✨ handle video on slider
This commit is contained in:
parent
55e51ca304
commit
4fe025ba9f
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
return;
|
||||
}
|
||||
|
||||
// Add enablejsapi=1 to YouTube iframes (inserted later by the cookie script) so they can be paused
|
||||
// Enable the YouTube API on video iframes so they can be paused
|
||||
const storyRoot = document.querySelector("#story-historical-milestones") as HTMLElement;
|
||||
|
||||
storyRoot.querySelectorAll<HTMLIFrameElement>("iframe").forEach(enableYoutubeApi);
|
||||
|
|
@ -22,7 +22,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
new MutationObserver(mutations => {
|
||||
mutations.forEach(mutation => {
|
||||
if (mutation.target instanceof HTMLIFrameElement) {
|
||||
enableYoutubeApi(mutation.target); // src changed
|
||||
enableYoutubeApi(mutation.target);
|
||||
}
|
||||
mutation.addedNodes.forEach(node => {
|
||||
if (node instanceof HTMLIFrameElement) enableYoutubeApi(node);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue