简体   繁体   English

Vimeo 播放器在后台全屏显示

[英]Vimeo player fullscreen in background

I have used this code to put my vimeo video in background that autoplays.我已使用此代码将我的 vimeo 视频放在自动播放的背景中。

I found away to do this via css, however it only works in the console, but I can't seem to make work when I use my css file.我发现可以通过 css 执行此操作,但是它只能在控制台中工作,但是当我使用我的 css 文件时我似乎无法工作。 I can't access inside the iframe through css.我无法通过 css 访问iframe内部。

Is there a easy way I can do this method via the iframe url to make it full length and responsive ?有没有一种简单的方法可以通过iframe url 执行此方法以使其全长和响应

Code代码

<iframe src="https://player.vimeo.com/video/76979871?background=1" width="100%" height="450" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Here is a fiddle of a responsive background video .这是一个响应式背景视频的小提琴 I adapted the CSS from this answer to make the video responsive.我从这个答案中调整了 CSS 以使视频响应。

To make it a background, I added this:为了使它成为背景,我添加了这个:

.videowrapper {
  /* ... */
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

Just to clarify, to use the official Vimeo solution of adding the parameter background=1 to the video url, you do need to be paying for Vimeo Plus.澄清一下,要使用官方 Vimeo 解决方案,将参数 background=1 添加到视频 url,您确实需要为 Vimeo Plus 付费。

Ref: https://vimeo.zendesk.com/hc/en-us/articles/224969968-Embedding-videos-overview参考: https ://vimeo.zendesk.com/hc/en-us/articles/224969968-Embedding-videos-overview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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