0

Is it possible to enable fullscreen mode for a video embedded in an iframe that is also part of another iframe?

As an example:

...
<body>
...
  <iframe id="video1" src="..." allowfullscreen></iframe> <!-- Full screen mode works -->
  <iframe id="comments" src="..." allow="fullscreen" allowfullscreen>
    #document
    ...
    <iframe id="video2" src="..." allowfullscreen></iframe> <!-- Full screen mode does not work -->
  </iframe>
...
</body>
...

1 Answer 1

1

Like in the provided code sample, we can see Parent iFrame and Child iFrame both are having the attribute "allowfullscreen".

  <iframe id="comments" src="..." allowfullscreen>
    <iframe id="video2" src="..." allowfullscreen></iframe> <!-- Full screen mode does not work -->
  </iframe>

As per the Permission Policy Header we should use allow="fullscreen" instead of using allowfullscreen. Please refer the updated code below.

<iframe id="comments" src="..." allow="fullscreen">
    <iframe id="video2" src="..." allowfullscreen></iframe> <!-- Full screen mode does not work -->
  </iframe>

This solution worked for me, else there might be some Cross-Origin Restrictions from the iFrame you're embedding.

Sign up to request clarification or add additional context in comments.

1 Comment

Unfortunately, it doesn't work for me. And I can't figure out why. I even tried with two attributes: allow="fullscreen" and allowfullscreen (on the principle of "more - not less"), but switching to full mode for video still doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.