- Home /
Fullscreen.Mode Videoplayer,Unity: How to fullscreen a videoplayer? using a button.
Hi, I've created a fullscreen button, but what it does it the normal 'fullscreen' the whole app, if windowed. can be done by alt+enter too. What i need help is fullscreen.mode the videplayer itself. much like any videoplayer (eg. Youtube). I cant seem find a way to link videoplayer (object) to the fullscreen button. something like that. ,I've created a fullscreen button, but thats the normal (alt+enter can also fullscreen the app). What i want to do is fullscreen mode the videoplayer, eg. Youtube.
how do i link them? tq
for more info on video players:
https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html
https://docs.unity3d.com/2018.2/Documentation/ScriptReference/Video.VideoPlayer.html
Edit i think thats what this is for in the API link
// Will attach a VideoPlayer to the main camera.
GameObject camera = GameObject.Find("$$anonymous$$ain Camera");
// VideoPlayer automatically targets the camera backplane when it is added
// to a camera object, no need to change videoPlayer.targetCamera.
var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer>();