cancel
Showing results for 
Search instead for 
Did you mean: 

Exoplayer in Unity

theblitz1959
Explorer
We are trying to embed a video using Exoplayer in an Oculus VR app using Unity. I have looked for examples but just can't seem to find any. Any help would really be appreciated.
4 REPLIES 4

theblitz1959
Explorer
Thanks for the answer.
I used the first link you gave and got it working.

The second link I had actually seen before. It doesn't seem to explain exactly what to do.
Just a sort of small overview.

Is there anywhere where there is a more detailed explanation?

theblitz1959
Explorer
Thanks for the help!

We got it working for a local file.
Time to work on streaming ......


WiltonAndy
Honored Guest
Hi there, we're also looking to use ExoPlayer to play back video in Unity. Can I ask where Oculus have got to on the task to address this functionality on your end? Is this likely to be available for release soon? It could be a big help for us if so.


theblitz1959
Explorer

@imperativity

Hi,

I recently updated to Unity 2017 and now the following line is failing:

nativeTexture = Texture2D.CreateExternalTexture(textureWidth, textureHeight,TextureFormat.RGBA32, true, false, IntPtr.Zero);


The message I get is:  ArgumentException: nativeTex can not be null


This is my full code:

OVR_Media_Surface_Init();
mediaRenderer = GetComponent<Renderer>();
if (mediaRenderer.material == null || mediaRenderer.material.mainTexture == null)
{
 Utils.Log("No material for movie surface");
}
 nativeTexture = Texture2D.CreateExternalTexture(textureWidth, textureHeight,TextureFormat.RGBA32, true, false,IntPtr.Zero);
 IssuePluginEvent(MediaSurfaceEventType.Initialize);
_androidSurface = OVR_Media_Surface_GetObject();
_playbackEnvironment.SetSurface(_androidSurface);
OVR_Media_Surface_SetTextureParms(textureWidth, textureHeight);
mediaRenderer.material.mainTexture = nativeTexture;