video.js inside a modal window: full screen not wo

2020-05-06 16:31发布

问题:

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

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

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.

回答1:

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">