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

Video background do not play on safari #4535

Open
obemer opened this issue Apr 17, 2023 · 7 comments
Open

Video background do not play on safari #4535

obemer opened this issue Apr 17, 2023 · 7 comments

Comments

@obemer
Copy link

obemer commented Apr 17, 2023

Hello Alvaro,

Sorry to bother you with this,

Do you have any idea why the video autoplay works one time out of ten loadings in Safari ?
Even on your page: https://alvarotrigo.com/fullPage/examples/videoBackground.html

I get this on the console:
Capture d’écran 2023-04-17 à 17 06 08

@alvarotrigo
Copy link
Owner

Can you try using the latest version?
Try using this demo:
https://codepen.io/alvarotrigo/pen/pXEaaK

https://alvarotrigo.com/fullPage/examples/videoBackground.html

This page is not using the latest fullPage.js version

@obemer
Copy link
Author

obemer commented Apr 17, 2023

Thank you for your answer.

The video in section 3 is not autoplaying and I got this in the console.
Capture d’écran 2023-04-17 à 20 23 29

My Safari is up to date, and I have no specific settings for any websites.
I'm guessing you don't have this problem ?
Weird...

@obemer
Copy link
Author

obemer commented Apr 17, 2023

I'm asking because I'm having this issue on my website too.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Apr 17, 2023

I've tested it using browserstack.com and Safari 16.3 and it seems to be working just fine.

The error message on your screenshot says "possible because the user denied permission", so I'd check your browser configuration to make sure you allow auto playing videos.

You can also try from different computers to see if you get any problem in those and discard the possibility of being a configuration on your current browser.

Another thing you can try is adding the attribute playsinline to your video element, so instead of this:

 <video width="400" controls muted data-autoplay>

You use:

 <video width="400" controls muted data-autoplay playsinline>

@obemer
Copy link
Author

obemer commented Apr 18, 2023

Yes, I already have the playsinline in the video element.
But I still have the problem.

The weird thing is that the autoplay works if I leave the section and then go back to it.
I'll investigate further.

Thank you for your answer.

@alvarotrigo
Copy link
Owner

The weird thing is that the autoplay works if I leave the section and then go back to it.

Try to isolate the issue and remove fullPage.js from the equation.

Chances are this is a JS/HTML problem rather than a fullPage.js one.

You can play with this codepen and modify it to make some tests:
https://codepen.io/alvarotrigo/pen/bGmwGrr

@obemer
Copy link
Author

obemer commented Apr 19, 2023

Well,

It's not working either on an other Mac I tried.
It's driving me crazy.

But you were right. It seems like it has nothing to do with fullpage.js

I'll try on stack overflow then.

Thanks for your help !

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

No branches or pull requests

2 participants