Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue of not playing in Safari #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GitHubGreg
Copy link

Thanks for this repo.

In the Safari browser (Mac and iOS) the SWFs weren't playing, whereas on Chrome they were.

Turns out it was because the load event for the window object had already fired by the time the useEffect hook ran, causing the event listener inside useRuffle to never trigger since the event had already passed.

The modified useRuffle function here checks if the document is already loaded and if so, executes the code, and if not delays and checks again.

It is now working well in Safari.

Thanks again.

Thanks for this repo. 

In the Safari browser (Mac and iOS) the SWFs weren't playing, whereas on Chrome they were.

Turns out it was because the load event for the window object had already fired by the time the useEffect hook ran, causing the event listener inside useRuffle to never trigger since the event had already passed.

The modified useRuffle function here checks if the document is already loaded and if so, executes the code, and if not delays and checks again.

It is now working well in Safari.

Thanks again.
@netlify
Copy link

netlify bot commented Oct 27, 2023

Deploy Preview for animated-cascaron-1bbf91 ready!

Name Link
🔨 Latest commit 7264fa4
🔍 Latest deploy log https://app.netlify.com/sites/animated-cascaron-1bbf91/deploys/653b22abaac8cf000837daf1
😎 Deploy Preview https://deploy-preview-2--animated-cascaron-1bbf91.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant