- Home /
How to open a video inside the unity scene?
Hi,
first things first, I code in Js. I'm working on a program, but I'm stuck vith this problem. I have a button a simple GUI button, when the player click on the button it should appear a video, without leaving the unity scene, the video can be online or off.
I used Application.OpenURL("http://www.youtube.com/watch?v=oIfk5-8oy_o"); (it's a test music video not rickroll xD) it works but the video is loading in a brower and not in the scene.
Someone can help me?
Answer by andytouch · Jul 18, 2013 at 12:16 PM
Hi Diego,
Firstly, Application.OpenURL is used for opening web pages in the user's default browser (For example: You may want to link the user to the game's dev blog, your twitter account, etc), not for displaying video.
There are a couple of ways to display video inside Unity:
If you have a Pro License, you could save your video file into your Assets folder and render it as a Movie Texture. That way, you could apply it to a cube or a plane (or any 3D model for that matter) and it would display just how a normal image texture would, but animated. You will have to write some script to play/pause it.
You could also display it in a GUI. A similar question was asked that has a number of useful solutions in the answers. You probably need Pro for this aswell.
Hope this helps!
Your answer
Follow this Question
Related Questions
What's wrong with this code ? 0 Answers
A node in a childnode? 1 Answer
Destroy Other 2 Answers
Creating fire particle in code 1 Answer
Destroy method returning null. 1 Answer