Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Creating Asset Bundle with Video

Discussion in 'Scripting' started by toto007, Oct 31, 2014.

  1. toto007

    toto007

    Joined:
    Jul 18, 2014
    Posts:
    33
    Hi,

    I would like to understand how I can create a assetbundle Android / ios importing into video format or .mp4. ogv.

    I have this error:
    MovieTexture 'is not supported a when building for Android.

    I would like to avoid building a separate system to download the video using the WWW and then advantage the mechanism dell'assetbundle.
     
  2. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Unfortunately, MovieTextures are not supported on Android and iOs.

    You can use this feature, but you will need android and/or iOs pro if I'm not mistaken.
    Code (csharp):
    1. Handheld.PlayFullScreenMovie
     
  3. toto007

    toto007

    Joined:
    Jul 18, 2014
    Posts:
    33
    I try to explain better

    I'm building a assetBundle for Android (and IOS) for entering into a .mp4 video.

    To build the assetBundle use this feature
    Code (csharp):
    1.  BuildPipeline.BuildAssetBundle (Selection.activeObject, Selection.objects, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.Android);
    But this function when I insert the MP4 OBJECT the entire package .unity3d gives me the error :
    Code (csharp):
    1.  MovieTexture 'is not supported a when building for Android.
    so my question is:
    "How can I build a package .unity3D mobile by entering into an mp4 file?
     
  4. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Any reason why you want to do an Asset Bundle for a movie?

    The only way to play a video on android/iOs, to my knowledge, is using
    Code (csharp):
    1. Handheld.PlayFullScreenMovie
    Read here: http://docs.unity3d.com/ScriptReference/Handheld.PlayFullScreenMovie.html

    You have to create a folder and put your movie in there: Asset/StreamingAssets
    and then you play the video this way:
    Code (csharp):
    1. function Start () {
    2.     Handheld.PlayFullScreenMovie ("StarWars.mp4", Color.black,     FullScreenMovieControlMode.CancelOnInput);
    3. }
    4.  
    Note that this is a Android-Pro feature. Doing asset bundles also requires a Android Pro license.
     
  5. toto007

    toto007

    Joined:
    Jul 18, 2014
    Posts:
    33
    I know the reasons and licenses for use as a AssetBundle. I need to load new resources at run-time. The AssetBundle will be loaded from a server online and will contain other resources (images, audio and video).

    I have already searched the internet and the solution they propose is to use the WWW but I would avoid using a different logic to handle only the video.

    I hope I have explained the scenario.
    So my question is:
    How can I add a Video in a ASSETBUNDLE MOBILE?

    Thank you

     
    Last edited: Nov 3, 2014
  6. Walbert-Schmitz

    Walbert-Schmitz

    Joined:
    Nov 17, 2014
    Posts:
    11
    same here. We want to add a mp4 file to assetbundle for using it with vuforia. But we cannot add it to assetbundle from streamingasset folder. Some ideas? Thanks, Felix
     
  7. StefanoCecere

    StefanoCecere

    Joined:
    Jun 10, 2011
    Posts:
    210
    ahh.. i just posted a similar question because i couldn't find this thread...

    since i have several (optional) videos.. not just one.. i don't want to WWW singles files.. but at least a zip with them all
    if anybody has experience to _sell_, please contact me PM if you don't have time to answer here in public

    thank you
     
  8. Xatpy

    Xatpy

    Joined:
    Mar 19, 2013
    Posts:
    7
    Up!
    Please, is there any way to do it? thanks!
     
  9. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,186
    Unity added a new video player system and videos can now be set to video clips. These should be able to be asset bundled now. Have you tried the new system before bumping an age old post?