Rahil Hayat
Rahil Hayat

Reputation: 71

How to enable fullscreen in IFrame

i am using iframe but fullscreen button is not working.

i have check inspect element i am getting below

<iframe frameborder="0" scrolling="auto" src="https://videos.xyz" allowfullscreen></iframe>

<iframe id="kaltura_player" src= “https://videos.xyz”  width="100%" height="100%" allowfullscreen webkitallowfullscreen mozallowfullscreen allow="autoplay *; fullscreen *; encrypted-media *" sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation" frameborder="0" title="Kaltura Player"></iframe>

any solution to enable fullscreen

Upvotes: 5

Views: 13958

Answers (1)

pxDav
pxDav

Reputation: 1834

To enable fullscreen on an <iframe>, use allow="fullscreen"

<iframe allow="fullscreen"></iframe>

The allowfullscreen attribute is now considered as a legacy attribute and it's now redefined as allow="fullscreen".

IFrame Documentation

Upvotes: 3

Related Questions