Search Unity

Loading external video file Android (GvrVideoPlayerTexture)

Discussion in 'Daydream' started by SpingDeveloper, Jan 12, 2018.

  1. SpingDeveloper

    SpingDeveloper

    Joined:
    Nov 21, 2017
    Posts:
    13
    Hi Guys,

    I'm trying to load a external video file on Android in the GvrVideoPlayerTexture (videoURL). The video is located in :
    //mnt/sdcard/movies/movie.mp4

    Is it possible to do this with the GvrVideoPlayerTexture class? Or do I need to load the video myself with the WWW class?
     
  2. SpingDeveloper

    SpingDeveloper

    Joined:
    Nov 21, 2017
    Posts:
    13
    It was actually very easy to do this :) Just do this before the GvrVideoPlayerTexture initializes:

    Code (CSharp):
    1. string videoURL = "file://" + GetAndroidInternalFilesDir() + "/PVMMovies/" + videoName;
    2. Debug.Log("Trying to load video: " + videoURL);
    3. gvrVideoPlayerTexture.videoURL = videoURL;
     
    ArnoBen likes this.
unityunity