模态窗口内的video.js:全屏不起作用 [英] video.js inside a modal window: full screen not working

查看:60
本文介绍了模态窗口内的video.js:全屏不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 video.js 在模态窗口中显示内容,您可以在此处看到:

I've been using video.js to show stuff inside a modal windows, as you can see here:

http://www.csdalbenga.it/galleria1.html

点击Clicca qui per visionare il video della recita!"按钮.

by clicking on the "Clicca qui per visionare il video della recita!" button.

所以,问题来了:视频可以正常工作,但全屏按钮只会让视频填满模态窗口,所以基本上什么都不会发生,或者大小会略有变化,具体取决于浏览器.

So, here's the problem: video works fine, but the full screen button will just make the video fill the modal window, so basically nothing happens or there's a slight size change depending on the browser.

现在我想知道,有没有办法强制视频全屏显示?否则我想我将不得不删除按钮.

Now I was wondering, is there a way to force the video to full screen? Otherwise I guess I'll have to remove the button.

推荐答案

您的模式将播放器置于 iframe 中,除非您明确允许,否则浏览器将不允许在 iframe 中全屏显示.以下内容至少适用于 Chrome 和 Firefox;Internet Explorer 根本没有实现允许从 iframe 全屏显示.

Your modal puts the player in an iframe, and the browser will not allow fullscreen from within an iframe unless you specifically allow it. The following will work in Chrome and Firefox at least; Internet Explorer has not implemented allowing fullscreen from an iframe at all.

<iframe … allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">

这篇关于模态窗口内的video.js:全屏不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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