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

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

问题描述

所以我要做的就是在我的网站上播放全屏视频。但我想自动播放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!

推荐答案

这里的答案非常好:

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.

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

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