How do I play A YouTube Video Fullscreen

Hi, I have no problem opening a url like this:

var win = window.open('https://www.youtube.com/embed/VLSA9oVneLA?autoplay=1', '_blank');

but I don’t know how to make it automatically go fullscreen from Playcanvas. There doesn’t seem to be anything I can add to the URL in the YouTube API.

Anyone know?
Thanks

I don’t think there is a way as it’s a new window. iOS also doesn’t have a full screen option for pages either.

You could make the current page fullscreen and add an iframe with the YouTube video that covers the current page.

Sounds like a plan. Any clues on how to do that? :slight_smile:

You have the fullscreen option in PlayCanvas: https://developer.playcanvas.com/en/api/pc.GraphicsDevice.html#fullscreen

The iframe is adding a DOM element to the page. Some examples of this (https://developer.playcanvas.com/en/tutorials/htmlcss-ui/) is this but you will have to make it work with an iframe instead. w3schools should help with the CSS and HTML side of it :slight_smile: