Html – YouTube iframe embed – full screen

htmliframe

I have a form that is iframed into a web page. Upon completion of the form, a YouTube video is displayed from using iframe embed.

When I enter full screen mode of the YouTube video, nothing really happens.

Is the fullscreen of the nested iframe constrained by the dimensions of the parent iframe?

Best Answer

In the current YouTube iframe (2021), you have to add fullscreen to the allow attribute:

<iframe allow="fullscreen;">

If I understand correctly you have an iframe that contains a second iframe (the youtube one).
Try adding the allowfullscreen attribute to the "parent" iframe.

For full browser support it should look like this:

<iframe src="your_page_url" 
        allowfullscreen="allowfullscreen"
        mozallowfullscreen="mozallowfullscreen" 
        msallowfullscreen="msallowfullscreen" 
        oallowfullscreen="oallowfullscreen" 
        webkitallowfullscreen="webkitallowfullscreen"> </iframe>