New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Playing large video files in Gear VR in Unity project

RGB3D-RobertRGB3D-Robert Posts: 5
NerveGear
I'm creating a Gear VR android app that plays a large 30 minute video. I have read that I should not use the StreamingAssets folder, but I don't see any information about what I should be using instead. If I put the video in Assets/videos it is not included in the android build. Should I be using the resources folder or is there another way to include the video? (My project is also on iOS, but I'm currently not having any problems on that platform.) I have read that the PersistentDataPath folder can be used, but I don't know how to get my video into that folder when from unity. I don't want to copy the video there and have two 600mb files when only one is used.

Comments

  • imperativityimperativity Posts: 1,448 Oculus Staff
    Hi,

    Have you considered using asset bundles to accommodate this large file?

    https://docs.unity3d.com/Manual/AssetBundlesIntro.html

    What’s in an AssetBundle?

    Good question, actually “AssetBundle” can refer to two different, but related things.

    First is the actual file on disk. This we call the AssetBundle archive, or just archive for short in this document. The archive can be thought of as a container, like a folder, that holds additional files inside of it. These additional files consist of two types; the serialized file and resource files. The serialized file contains your assets broken out into their individual objects and written out to this single file. The resource files are just chunks of binary data stored separately for certain assets (textures and audio) to allow us to load them from disk on another thread efficiently.

    Second is the actual AssetBundle object you interact with via code to load assets from a specific archive. This object contains a map of all the file paths of the assets you added to this archive to the objects that belong to that asset that need to be loaded when you ask for it.



  • oculus_gaboroculus_gabor Posts: 9 Oculus Staff
    Gear VR supports 1 expansion file, up to 4GB. We have some documentation in the works on it. For now, this page will get you started: https://docs.unity3d.com/Manual/android-OBBsupport.html

    You have to adhere to androids naming convention of:
    main.<version>.<package>.obb
    So for example, if your app package name is com.sample.app and this is V1 of your app, the extension file would be
    main.1.com.sample.app.obb
    You can't upload the extension files with the web interface, you'll have to use the command line tools from here https://developer.oculus.com/blog/faster-build-uploads-with-cli/

    The command to upload will look something like this:
    ovr-platform-util upload-gear-build --app_id <app id> --app_secret <secret> --apk <apk path> --obb <external data file path> --channel alpha --notes "Uploading apk and external data"
Sign In or Register to comment.