简体   繁体   中英

Playing video automatically on Safari won't work

When I open my website in Safari (desktop) my video usually starts automatically. I know in the past it already won't play automatic on iPad or iPhone but not on desktop.

It's like Safari set new rules. Is there a way to play the videos automatically? Because there is a website that I've found that still automatically play videos on their website on Safari.

Thanks in advance!

This can be circumvented using the following properties:

<video muted playsinline autoplay></video>

But autoplaying with the sound turned on is indeed not possible anymore. More information can be found on webkit.org .

I have Mojave and found a solution that worked for a site I use often.

One can go to the top bar menu:

Safari Preferences -> The 'Websites' (tab heading) -> Auto-Play (left side)

As the default websites Auto-Play option is Stop Media with Sound , this strategy introduced the permission issue.

Safari 偏好设置

Allow media from that site. One can turn it on at the bottom of that box for all sites.

There is a simpler way in the same menu next to Safari Prefrences, called 'Settings for This Website' -- it allows you to make that same setting, and a few others rather than having to poke around the rest of the Settings box.

Clearly that means a user has to allow it.

The site where I found a working example: https://support.shadowhealth.com/hc/en-us/articles/360009548313-Audio-issues-in-Safari

I did post the way to do it above so the site is not needed if they ever take it down, but they did do nice screen shots. I put it here for handy reference.

To deal with browsers who 'wander' to your location, you would need to provide a button to launch videos or audio clips.

这可能是因为苹果阻止了这个附加组件https://techcrunch.com/2017/06/05/auto-play-block/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM