嵌入自动全屏播放的 youtube 视频 [英] Embed youtube videos that play in fullscreen automatically

查看:27
本文介绍了嵌入自动全屏播放的 youtube 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想要做的是在我的网站上播放全屏视频.但我想自动播放 youtube 视频并自动全屏播放(浏览器窗口的大小).我的网站导航是从页面到页面滑动的左右箭头.然后是向上和向下箭头,每页向上和向下滚动.

So what I'm trying to do is have fullscreen video across my website. But I would like to auto play a youtube video and automatically in fullscreen (The size of the browser window). My site navigation is left and right arrows that slide from page to page. Then up and down arrows that scroll up and down each page.

但我唯一想做的就是以全屏模式自动播放 youtube 视频,同样是浏览器窗口的大小.还是我必须自己托管视频?这可能更容易,但会占用我必须支付的带宽.无论如何,提前感谢您的帮助,干杯!

But the only thing I'm trying to get done is autoplay a youtube video in fullscreen, again, the size of the browser window. Or am I going to have to host the video myself? Which may be easier, but will take up bandwidth that I'll have to pay for. Anyway thank you in advance for your help, cheers!

推荐答案

这里得到了很好的回答:如何使 YouTube 嵌入视频成为全页宽度的视频?

This was pretty well answered over here: How to make a YouTube embedded video a full page width one?

如果你在嵌入代码的 url 末尾添加 '?rel=0&autoplay=1'(像这样)

If you add '?rel=0&autoplay=1' to the end of the url in the embed code (like this)

<iframe id="video" src="//www.youtube.com/embed/5iiPC-VGFLU?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>

它应该在加载时播放的视频.这是 jsfiddle 上的演示.

of the video it should play on load. Here's a demo over at jsfiddle.

这篇关于嵌入自动全屏播放的 youtube 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆