Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

How to import video from Web page CMS to assets

Discussion in 'Immediate Mode GUI (IMGUI)' started by thomas2411, Jul 16, 2012.

  1. thomas2411

    thomas2411

    Joined:
    Jul 16, 2012
    Posts:
    5
    How to import video from Web page CMS to assets?

    I need to download video from web serves with some web service or from URL into assets, store it there and when necessary, play it.

    Is this possible to achieve?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    not in edit mode, only in play mode.

    Then you could download an ogg theora (the only format unity supports natively on desktop anyway).

    question is: why would you want it to be in the assets, why not load it at runtime? (then again it has to be ogg theora and you can just load it through WWW)
     
  3. thomas2411

    thomas2411

    Joined:
    Jul 16, 2012
    Posts:
    5
    I want to have an application installed on iPad which works normally. And from time to time there will be some new videos available. So I need to get an XML or JSON file from web server, get an URL to video which would be in this XML (JSON) file, download this video and play it. Also so I can use use it later, for offline mode, without Internet connection. So the questions is to how get any data from URL and store it in the app for later use.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    on the ipad it needs to be an m4v movie (or whatever you can use directly in the iOS movie player) to be played back and you need Unity iOS pro or the prime31 plugin for fullscreen movie playback

    you can not import any movie at runtime but you can download and store it locally. Thats done through WWW.bytes and System.IO

    This then would be in the wrong board as it no longer has any relationship to UnityGUI as you can not play them back through any such measure reasonably. (there is a plugin that allows movie textures but I'm unsure how well it works right now)
     
    Last edited: Jul 16, 2012
  5. thomas2411

    thomas2411

    Joined:
    Jul 16, 2012
    Posts:
    5
    mp4 and iOS Pro - no problem.

    So using WWW.bytes I can download it to iPad device and play it later? But how to save this data? Or where WWW.bytes saves data as it is not said in Reference.