Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Video Is it possible to load a VideoClip from file

Discussion in 'Audio & Video' started by Astiolo, Apr 21, 2017.

  1. Astiolo

    Astiolo

    Joined:
    Dec 18, 2014
    Posts:
    27
    I like the new Video Player functionality in 5.6, but I really need to be able to load videos from file. I know you can get a MovieTexture with a URL/file path using the WWW class. Is there something similar for video clips or perhaps a way of converting a MovieTexture to a VideoClip?
     
    ZammyIsOnFire1 likes this.
  2. IvanQ

    IvanQ

    Joined:
    Jul 30, 2015
    Posts:
    5
    You can read the raw bytes downloaded with WWW class and write it to a file. I've done this already and it works
     
  3. Astiolo

    Astiolo

    Joined:
    Dec 18, 2014
    Posts:
    27
    I think you misunderstood the question. I want to load a video from file so I can play it using the new video player in 5.6, which uses a VideoClip as an input. However I had missed that the video player can just take a URL as an input instead and that URL can point to a local file.
     
  4. StupidWizard

    StupidWizard

    Joined:
    Mar 30, 2017
    Posts:
    4
    ZammyIsOnFire1 likes this.
  5. Tanooki322332

    Tanooki322332

    Joined:
    Apr 27, 2017
    Posts:
    2
    Inkfish_2017 likes this.
  6. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
    Hey,
    I would like to see a similar functionality with WWW class for VideoClips as it is for AudioClips today (replacing GetMovieTexture).

    Code (CSharp):
    1. WWW www = new WWW("file://" + this.localAudioPath);
    2. AudioClip clip = www.GetAudioClipCompressed(false);
    Will this be possible for VideoClips in the near future?
     
    Last edited: Nov 9, 2017
    yoursungjin likes this.
  7. Haleluya

    Haleluya

    Joined:
    Feb 24, 2015
    Posts:
    8
    I'm also looking for the answer. I'm using EasyMovieTexture and I would like to play video clip on EMT too. Because in IOS I would like to play alpha video.
     
  8. aliahmad11403

    aliahmad11403

    Joined:
    Sep 16, 2017
    Posts:
    1
  9. Realtime-art-dev

    Realtime-art-dev

    Joined:
    Sep 26, 2015
    Posts:
    2
    Because you are on Mac Standalone check this :
    - if you use the good symbol for a folder.
    - Warning once you build you don't have the same authorization to access file and the path you use to access it can change.
     
  10. neel23799

    neel23799

    Joined:
    Oct 27, 2022
    Posts:
    1