Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 2.26 KB

local-files.md

File metadata and controls

50 lines (33 loc) · 2.26 KB

Playing Local Files

HISPlayer iOS for Unity can play local content from both Unity Streaming Assets and the Persistent Data Path (application's path).

Keep in mind the SDK will look for the local video first on the Unity Streaming Assets so a file with the same name on the Persistent Data Path won't be played.


For this actions iOS device doesn't need to ask for permissions.

Unity Streaming Assets

To use this format, it’s necessary to create a new folder into the Assets folder of Unity named StreamingAssets.

image

Video File

Add a video content inside the folder and pass the name (with the extension) to the Multi Stream Properties.  

In case that subfolders are created inside StreamingAssets, the path of the file must include the subfolder’s name inside the field of Multi Stream Properties, e.g, with a subfolder named “MyVideos” the following path must be used:

MyVideos/localPlayback.mp4  

Persistent Data Path

The Persistent Data Path is the internal path of the application. Unity allows you to access that folder from the C-sharp code with Application.persistentDataPath.

The returned path on iOS will be: /var/mobile/Containers/Data/Application/<guid>/Documents.

The HISPlayer SDK will take this path as the entry point to begin to search the desired local content.

Video File

Add the video file that is stored inside the Application.persistentDataPath and pass the file name (with the extension) to the Multi Stream Properties. In case that subfolders are created inside Application.persistentDataPath , the path of the file must include the subfolder’s name inside the field of Multi Stream Properties, e.g, with a subfolder named “MyVideos” the following path must be used:

MyVideos/localPlayback.mp4