x


How do I play a full screen video?

I would like to have a video play in full screen on a trigger.

Anyone know how to do it?

more ▼

asked Dec 12 '09 at 08:45 PM

Luke gravatar image

Luke
46 1 1 4

from: http://unity3d.com/unity/features/audio-and-video

3D Audio and Video Play back video on any surface in your game, or directly in full-screen. Sync or syncopate audio and video.

I assumed this was a little more straight forward.

Dec 14 '09 at 02:53 AM Luke
(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

I think you may want to draw a GUI Texture with the size of the screen and asign the movie texture to it with a scale mode = stretch to fill, use the following ( i guess) :P

GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),MovieTexture,ScaleMode.StretchToFill);

then play the movie texture using MovieTexture.Play();

you may also want to set Screen.fullScreen = true;

and hide the cursor using Screen.showCursor = false;

and when Escape is pressed and released you may want to re-show the cursor and minimize the screen to its original location:

function Update() {
    if (Input.GetKeyUp(KeyCode.Escape)) {
        Screen.showCursor = true;
        Screen.fullScreen = false;
        // in webplayer the fullscreen mode is automatically escaped when "Escape" is pressed
   }
}
more ▼

answered Mar 06 '10 at 01:09 AM

baha gravatar image

baha
265 7 8 13

(comments are locked)
10|3000 characters needed characters left

i can't test this since i don't have unity pro (so apologies if i'm answering out of turn), but this page tells how to set it up:

http://unity3d.com/support/documentation/Manual/Video%20Files.html

you should be able to create a new camera and a cube off screen from your main camera. scale the cube to fill the screen space of the new camera and attach the movie texture to it. when your trigger script fires off, disable the main camera and then activate the new camera. through that same script, tell the movie to start playing. that should get you an full screen cutscene effect.

To let your player run in full screen, set Screen.fullScreen to true.

more ▼

answered Dec 13 '09 at 06:04 PM

jester gravatar image

jester
251 1 5

(comments are locked)
10|3000 characters needed characters left

Humm just a shot in the dark, I would create a plane with a movie texture and place it right in front of the camera. here is the pseudo code.

On each tick - Convert screen pos (width/2, height/2) to world position using ScreenToWorld() - translate the plane with the texture to the world position above - set plane direction to -camera.forward

so no matter where how the user moves he will always see the video in front of him :)

hope its clear...

more ▼

answered Dec 13 '09 at 06:00 PM

pkamat gravatar image

pkamat
443 11 12 20

I don't think this is a good idea. Even if you wanted to keep a plane in front of a moving camera, it would be a better idea to just parent the plane to the cam, rather than keep updating its position via code. But really, you should consider using a 2nd cam, or one of the GUI methods of displaying a texture on-screen. (will write a fuller answer if time permits)

Dec 13 '09 at 10:39 PM duck ♦♦
(comments are locked)
10|3000 characters needed characters left

Can you write the full script please?

more ▼

answered Jul 26 '10 at 09:51 PM

amr nasr gravatar image

amr nasr
37 6 8 9

UnityAnswers helps those who help themselves. Try the suggestions, read the documentation, poke around, learn some things. If it doesn't work, post pieces of what you have and ask more questions. Rinse and repeat.

Jan 01 '11 at 06:09 PM yoyo
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x491
x280
x275
x107

asked: Dec 12 '09 at 08:45 PM

Seen: 14709 times

Last Updated: Oct 24 '12 at 12:52 PM