Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

What's the optimum way to load and destroy media on iOS?

Discussion in 'iOS and tvOS' started by DigitalIPete2, Jan 8, 2016.

  1. DigitalIPete2

    DigitalIPete2

    Joined:
    Aug 28, 2013
    Posts:
    43
    Hi guys,

    Imagine a project with many libraries of media for content, including text, video, images, and audio all running on an iPad Air 2.

    I need to find the most optimum way to allow the user to load a library of media content, use it and then unload it. There will be a number of libraries of media content.

    I'm currently considering using Prefabs with manually linked videos, and text. I think I'm going to use the resources folder to load images and audio clips.

    Because the app will be very media heavy and lots of swapping will happen, am I approaching this the wrong way? I don't need a constant 60 fps so Im hoping the garbage collection won't be too problematic.

    Any thoughts would be great.

    IPete2.
     
  2. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    You won't be able to play linked videos (I'm assuming you're planning on using a MovieTexture?) as MovieTexture won't work on mobile. You can load them from disk though (using Handheld.PlayFullScreenMovie)
    . You can accomplish this by putting the movie in a StreamingAssets folder and using the path Application.StreamingAssetsPath + "/myMovie.mp4". You can load Audio, textures and text this was as well.

    If you're wanting to load compressed textures, then you will either want to have those included in Resources and load them from there, or load them from an AssetBundle if you want to be able to download them from your server.