I have a simple modal dialog:
- User clicks on button.
- Modal overlay shows.
- YouTube
<iframe>
element is added.
All is good in most browsers - video starts playing, except Safari 11.1.
Safari has new auto-play policy that requires explicit click and video element to start playing it: /
Is there some way to make it autoplay for dynamically added YouTube (or Vimeo) iframe?
Example YouTube iframe:
<iframe frameborder="0" allowfullscreen="" allow="autoplay; encrypted-media; fullscreen" src=";amp;controls=0&showinfo=0&autoplay=1&enablejsapi=1"></iframe>
I have a simple modal dialog:
- User clicks on button.
- Modal overlay shows.
- YouTube
<iframe>
element is added.
All is good in most browsers - video starts playing, except Safari 11.1.
Safari has new auto-play policy that requires explicit click and video element to start playing it: https://webkit/blog/7734/auto-play-policy-changes-for-macos/
Is there some way to make it autoplay for dynamically added YouTube (or Vimeo) iframe?
Example YouTube iframe:
<iframe frameborder="0" allowfullscreen="" allow="autoplay; encrypted-media; fullscreen" src="https://www.youtube-nocookie./embed/20iMzRklHNU?rel=0&controls=0&showinfo=0&autoplay=1&enablejsapi=1"></iframe>
Share
Improve this question
asked Jul 9, 2018 at 23:25
Marvin3Marvin3
6,0518 gold badges38 silver badges48 bronze badges
1 Answer
Reset to default 4Safari 11 now disables/blocks autoplay features. You have to manually go to the safari settings and Allow All Auto-Play.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745093441a4610831.html
评论列表(0条)