I just downloaded Google Cardboard SDK for unity. I am fine and able to create VR project. Setup is fine and everything is working fine.
I am noob at VR Apps. Just stepped in VR Apps.
I am planing to create my own VR Enabled Video Player for android, Just like the default Google Cardboard Youtube player.
Can any one suggest me a link or can guide me in developing this app.
Scott Driscoll's answer totally works. I had some initial problems getting the Easy Movie Texture Unity plug-in to work for me, but finally figured it out, and it works flawlessly. I now have 360-video running as a texture on the inside of a sphere on my iPhone 6. And I have to say, I didn't think it would happen.
For working on a Mac, here's what I did:
Pretty sure that's everything. Hope it helps other folks stuck on this problem. Thanks Scott Driscoll!
One last note, you can only view the video on the phone, not in preview in the editor. It would be better if it didn't work this way, but really once the initial issues of resolution and placement are resolved, I don't really need to see the video every time I run the scene in the editor.
I can't help you with Unity, but in java, you can create a texture with OpenGL-ES:
Use it to create a surface texture and a surface:
And then pass that surface to android.media.MediaPlayer:
Bind that texture to a square in your scene and call this every frame:
and the video will play when you call mediaPlayer.start();
If Unity allows you to write your own java code to run behind the scenes, this should work if you bind that texture to a surface from Unity.
If you have a video stream that you can't play with mediaPlayer (like a live video chat, etc), you can use the surface with android.media.MediaCodec as well, but there's a lot more setup work involved.
Here are the major steps for how we do this:
Full details: http://immersivetechblog.foundry45.com/2015/07/31/implementing-360-video-in-unity-for-gear-vr-and-cardboard/
This has become very simple for Unity 5.6 and above.
The only downside is, it only plays monoscopic images/videos by default and there requires some tweaking to run stereoscopic images/videos.
I saw the answers above but all of them either required Easy Movie Texture Unity plug-in or coding your way through.. There's another easy solution to this as well which won't require you to buy that asset or code your way through.. Oculus provides an already built free sample framework which you can use without much trouble.. The solution below shows both how to create both a photo viewer as well as video viewer for Unity..
Building your 360 degree PhotoViewer:
Building your 360 degree MoviePlayer:
*To play it in your devices, just go to build settings and choose the desired platform and delete all the scene and just Add Open Scene and click on the Virtual Reality Supported in Other Settings under Player Settings. To play it in your android phone you need to download the GoogleVR SDK just like above and bring it in your assets folder and find the GVRViewerMain in the assets folder and bring it in the scene and uncheck the Virtual Reality Supported you did above and just build and run the whole thing in your device (You should be able to see the view in you game mode when you hit play in Unity). You should be able to see the video in your respective gear.