正如我们将从网站上的其他问题知道到iOS Mobile Safari中我们有这些美味属性webkit-playesinline和更简洁的playinline来禁用自动全屏视频.
尽管奇迹,我仍然无法弄清楚如何将其添加到YouTube html5嵌入.正如预期的那样,YouTube< video>包含在< iframe>中.
理想的结果如下:
<video tabindex="-1" class="video-stream html5-main-video" style="width: 736px; height: 414px; left: 85px; top: 0px;" src="blob:https://www.youtube.com/6889sdad6d2-ec51-49ca-b357-a5bd9c3ede71" webkit-playsinline="true" playsinline="true"> </video>
我试图通过jquery做到这一点,徒劳无功.
有任何想法或想法如何做到这一点?
解决方法
将playsinline = 1 paramerer添加到embed url.加?或者&在适当之前; ?如果唯一的参数,&与其他params连接.
例:
<iframe src="https://www.youtube.com/v/VIDEO_ID?playsinline=1"> </iframe>
This parameter controls whether videos play inline or fullscreen in an HTML5 player on iOS. Valid values are: 0: This value causes fullscreen playback. This is currently the default value,though the default is subject to change. 1: This value causes inline playback for UIWebViews created with the allowsInlineMediaPlayback property set to TRUE.