Search Unity

Beginner Question - Is Unity able to download Video Files from a server and playback after loaded ?

Discussion in 'Editor & General Support' started by TopgameMediaCrew, Dec 12, 2018.

  1. TopgameMediaCrew

    TopgameMediaCrew

    Joined:
    Dec 12, 2018
    Posts:
    6
    Hello,

    i am new to unity, but not to c#. It's a theroetical thing. Is unity able to download from a webserver, especially video files and add them at runtime, after file is loaded ?

    I ask this, because streaming is not possible in unity, but it should work, if i manually download the videofiles if needed and playback after its loaded.

    Is that possible ?
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,445
    yes, you can do that.

    for downloading files,
    https://docs.unity3d.com/Manual/UnityWebRequest.html

    then need to check which folder you are saving them,
    as some folders are not writable in mobiles..
    like https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html

    and video needs to be in a suitable format (if using builtin video player, check alternative video players in asset store)
    https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html

    you can play streaming videos too (give it url address to the video),
    those asset store video players support more formats, youtube too.
     
  3. TopgameMediaCrew

    TopgameMediaCrew

    Joined:
    Dec 12, 2018
    Posts:
    6
    thank you very much