Skip to content

Commit

Permalink
Fixed bug where videos were not showing up on Safari (#3562)
Browse files Browse the repository at this point in the history
* Fixed bug where videos were not showing up on Safari

* Add comment for why style is getting reset in event loop

---------

Co-authored-by: Lars Hoffbeck <[email protected]>
  • Loading branch information
tyleralsbury and lhoffbeck authored Feb 5, 2025
1 parent 7f7d936 commit b4045d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,13 @@ class DeferredMedia extends HTMLElement {
// force autoplay for safari
deferredElement.play();
}

// Workaround for safari iframe bug
const formerStyle = deferredElement.getAttribute('style');
deferredElement.setAttribute('style', 'display: block;');
window.setTimeout(() => {
deferredElement.setAttribute('style', formerStyle);
}, 0);
}
}
}
Expand Down

0 comments on commit b4045d8

Please sign in to comment.