Skip to main content
New Participant
January 30, 2017

Exoplayer in Unity

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.
    This topic has been closed for replies.

    4 replies

    New Participant
    January 31, 2017
    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?
    New Participant
    February 7, 2017
    Thanks for the help!

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


    New Participant
    March 26, 2017
    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.


    New Participant
    July 23, 2017

    @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;