0

How to call fullscreen mode in frame on my site? Thank you...

enter image description here

<iframe width='640' height='360' src='https://roundme.com/embed/11663/28535' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
user7637745
  • 965
  • 2
  • 14
  • 27
  • https://stackoverflow.com/questions/33768509/how-to-make-an-iframe-to-go-fullscreen-on-a-button-click – Adam H Jul 05 '18 at 15:42

2 Answers2

0

You need to request user permission to full screen i believe. This MDN post goes into more detail. If you check caniuse.com you'll see that theres a lot of partial support, be sure to check the caveats.

According to MDN you need to call requestFullScreen on the element.

Some HTML:

<video controls id="myvideo">
  <source src="somevideo.webm"></source>
  <source src="somevideo.mp4"></source>
</video>

Some JS for it:

var elem = document.getElementById("myvideo");
if (elem.requestFullscreen) {
  elem.requestFullscreen();
}

Be sure to go through the docs though, as it mentions some interesting CSS caveats between Gecko and Webkit browsers.

Stephen Tetreault
  • 769
  • 1
  • 8
  • 26
-1

The :fullscreen CSS pseudo-class selector is used to select and style an element that is being displayed in full-screen mode.

https://tympanus.net/codrops/css_reference/fullscreen/

Ramy Mohamed
  • 236
  • 1
  • 5
  • 18