Getting started with HISPlayer consists of implementing the following steps:
-
Import and configure SDKs
1.1. Import Unity Packages
1.2. Import HISPlayer SDK
1.3. Configure Unity for Android
1.4 Configure OpenXR
-
HISPlayer OpenXR Sample
2.1 Import HISPlayer OpenXR Sample
You must install a set of specific packages to ensure OpenXR and the VR interactions work correctly.
-
In the top menu bar, go to Window > Package Manager.
-
In the Package Manager window, click the dropdown menu in the top-left corner (it usually says Packages: In Project by default) and select Packages: Unity Registry.
-
Use the search bar in that says “Search in Unity Registry” to find and select each of the following packages, then click the Install button for each one:
- XR Interaction Toolkit
- XR Plugin Management
- XR Composition Layers
- OpenXR Plugin
-
Import Starter Assets:
- In the Package Manager, select the installed XR Interaction Toolkit from the list.
- On the right-side panel, click on the s tab.
- Locate Starter Assets in the list and click the Import button next to it.
- Import TMP Essentials (For UI Text):
- In the top menu bar, go to Window > TextMeshPro > Import TMP Essential Resources.
- A new pop-up window will appear. Click the Import button.
Importing the SDK is the same as importing other normal packages in Unity. Select the package of HISPlayer SDK and import it.
Assets > Import Package > Custom Package > HISPlayer XR SDK unity package
Select the package of HISPlayer SDK and import it.
Open the window Tools > HISPlayer located in the upper side of the screen > Click on Player Settings Configuration > Select Build Target to Android > Set all the required settings.
Setting "Plugins folder" will create mainTemplate.gradle and gradleTemplate.properties in your ProjectRoot\Assets\Plugins\Android. Please make sure you use the correct mainTemplate.gradle that is generated from our SDK. If you need to modify it, please make sure the dependencies and configurations from HISPlayer SDK's mainTemplate.gradle exist in your modified gradle file.
It is recommended to set Target API Level to 34 or higher. By selecting Android target 34, Unity is going to ask you to update (in the case you don't have the SDK installed). Please, press "Update Android SDK" button.
Alternatively, you may set the Target API level to 34 or higher in the Unity project settings.
Application Entry Point Setup:
- Go to the top menu bar and click Edit > Project Settings.
- In the left-hand list of the Project Settings window, scroll down and select Player.
- In the main panel, click on the Android Tab and open Other Settings.
- In the Android Application Configuration section, make sure Application Entry Point has GameActivity checked and Activity unchecked.
XR Plugin Management Setup:
- Go to the top menu bar and click Edit > Project Settings.
- In the left-hand list of the Project Settings window, scroll down and select XR Plug-in Management.
- In the main panel, click on the Android Tab.
- Check the box next to OpenXR in the Plug-in Providers list.
- If a yellow/red warning triangle appears next to OpenXR, click on the triangle icon. A validation window will pop up. Click the Fix All button to automatically resolve configuration issues.
OpenXR Settings:
- In the left-hand list of the Project Settings window, click on OpenXR (located directly under XR Plug-in Management).
- Interaction Profiles:
- Look for the "Interaction Profiles" section.
- Click the "+" (plus) icon under the list.
- Select Khronos Simple Controller Profile.
- Click the "+" (plus) icon again.
- Select Oculus Touch Controller Profile or other controller profile depending on your VR headsets.
- OpenXR Feature Groups:
- Scroll down to the bottom of the OpenXR settings panel.
- Check the box for Meta Quest Support or other option depending on your VR headset (PICO, etc).
- Check the box for Composition Layer Support. This will automatically enable HISPlayer XR Video Layer.
Please, download the sample here: OpenXRSample (no need to download it if you have received it in the email).
Before using the sample, please make sure you have followed the above steps to set-up your Unity project for and HISPlayer SDK. To use the sample, please follow these steps :
- Configure OpenXR
- Import HISPlayer SDK
- Import HISPlayer OpenXR Sample
- Import TextMeshPro. Go to Unity Window > TextMeshPro > Import TMP Essential Resources
- Open all Unity scene in Assets/HISPlayerOpenXRSample/Scenes and do the following for each scene:
- If you received a license key from HISPlayer, input the license key through the Inspector Unity window: StreamController GameObject > HISPlayerSample component > License Key
- Open File > Build Settings > Add Open Scenes
- Build and Run
To check how to set up the SDK and API usage, please refer to Assets/HISPlayerOpenXRSample/Scripts/Sample/HISPlayerSample.cs and StreamController GameObject in the Editor.
The RenderScreen GameObject is a Quad that displays the video.
To select the rendering mode, go to StreamController GameObject > HISPlayerSample script > MultiStreamProperties > Element 0 > RenderMode. The script automatically enables or disables the required components from the RenderScreen based on your selection.
The recommended RenderMode is ExternalSurface for an improved high resolution video rendering performance and DRM L1 support. For detailed setup instructions for each render mode, please refer to RenderModes.
Select one of the sample scenes described below.
This scene demonstrates high-resolution video playback using ExternalSurface render mode.
This scene demonstrates high-resolution video playback using RenderTexture render mode.
This scene demonstrates a Widevine DRM L1 protected video playback using ExternalSurface render mode. For more details about DRM, refer to DRM page.
This scene demonstrates 360° video playback using External Surface render mode. XR Layer Projection option is set to Equirect 360.
If you want to use RenderTexture or Material render mode instead, the RenderScreen GameObject should use a Sphere as its Mesh Filter and have only a Mesh Renderer.
This scene demonstrates a Left/Right stereoscopic video playback using ExternalSurface render mode. XR Layer Stereo Mode option is set to Left Right.
For more details about stereoscopic, refer to Stereoscopic page.
This scene demonstrates a 180° Left/Right stereoscopic video playback using ExternalSurface render mode. XR Layer Projection option is set to Equirect 180 and XR Layer Stereo Mode option is set to Left Right.
For more details about stereoscopic, refer to Stereoscopic page.
This scene demonstrates the playback of two videos at the same time using ExternalSurface render mode. Each video is configured as a separate element in MultiStreamProperties.
This scene demonstrates a stereoscopic MV-HEVC video playback using ExternalSurface render mode. XR Layer Stereo Mode option is set to Left Right.
For more details about MV-HEVC, refer to Stereoscopic page.
Two helper GameObjects are present in the scene: FillAudioSourceGroup and GetAudioSourceGroup. Activating or deactivating them switches between the corresponding audio retrieval APIs.
For more information, please refer to the following Audio Retrieval guide.
For information about Ambisonic audio support, please refer to Ambisonic
Please check Assets/OpenXRSample/Scripts/Sample/HISPlayerSample.cs script. The script must inherit from HISPlayerManager. It is necessary to add the 'using HISPlayerAPI;' dependency
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HISPlayerAPI;
public class HISPlayerSample : HISPlayerManager
{
...
}It is necessary to call SetUpPlayer() before calling other APIs. This function initializes everything else that will be needed during the usage of HISPlayer APIs.
Refer to Stereoscopic Video.
Refer to Download Video Content.
For more information about the supported features and APIs, please refer to the following HISPlayer API.














