Search Unity

Load videos from local folder

Discussion in 'Scripting' started by bck2207, Aug 21, 2018.

  1. bck2207

    bck2207

    Joined:
    May 16, 2018
    Posts:
    1
    Hello all,

    is there a way to load all videos from local folder to Unity?
    I know that using WWW we can load images since it has textures. But what about video player?

    Currently playing specific file using the below script

    Code (CSharp):
    1. videoPlayer.url = "C:/Users/Desktop/images/Video.mp4";
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    You can store array/list of urls, of videos as data, after grabbing directory files.
    To get list files, you can fetch them, using

    Code (CSharp):
    1. string [] files = System.IO.Directory.GetFiles ( pathAsString ) ;