Skip to content

Latest commit

 

History

History
199 lines (132 loc) · 8.21 KB

File metadata and controls

199 lines (132 loc) · 8.21 KB

QuickStart Guide

Getting started with HISPlayer consists of implementing the following steps:

  1. Import and configure SDKs

    1.1. Import Unity Packages

    1.2. Import HISPlayer SDK

    1.3. Configure Unity for Android

    1.4 Configure OpenXR and Android XR

  2. HISPlayer AndroidXR Sample

    2.1 Import HISPlayer AndroidXR Sample

1.1 Import Unity Packages

You must install a set of specific packages to ensure AndroidXR and the VR interactions work correctly.

  1. In the top menu bar, go to Window > Package Manager.

  2. 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.

  1. 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:

    • Unity OpenXR Android XR
    • XR Interaction Toolkit
    • XR Composition Layers
  2. Import Starter Assets:

    • In the Package Manager, select the installed XR Interaction Toolkit from the list.
    • On the right-side panel, click on the Samples tab.
    • Locate Starter Assets in the list and click the Import button next to it.

  1. 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.

1.2 Import HISPlayer SDK

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.

1.3 Configure Unity for Android

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.

Android Target API Level

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.

image

Alternatively, you may set the Target API level to 34 or higher in the Unity project settings.

1.4 Configure OpenXR and Android XR

XR Plugin Management Setup:

  1. Go to the top menu bar and click Edit > Project Settings.
  2. In the left-hand list of the Project Settings window, scroll down and select XR Plug-in Management.
  3. In the main panel, click on the Android Tab.
  4. Check the box next to OpenXR in the Plug-in Providers list.
  5. Check the box next to Android XR feature group in the OpenXR.

  1. 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:

  1. In the left-hand list of the Project Settings window, click on OpenXR (located directly under XR Plug-in Management).

  1. Interaction Profiles:
    • Look for the "Interaction Profiles" section.
    • Click the "+" (plus) icon under the list.
    • Select Khronos Simple Controller Profile. This is needed to support hand tracking.
    • Click the "+" (plus) icon again.
    • Select Oculus Touch Controller Profile or other controller profile depending on your VR headsets. This is needed to support 6DoF (Six Degrees of Freedom) controllers.

  1. OpenXR Feature Groups:
    • Scroll down to the bottom of the OpenXR settings panel.
    • Check the box for Android XR Support.
    • Check the box for Composition Layer Support.

2.1 Import HISPlayer AndroidXR Sample

Please, download the sample here: AndroidXRSample (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 AndroidXR Sample
  • Open Assets/AndroidXRSample/Scenes/HEVC_8K.unity
  • Import TextMeshPro. Go to Unity Window > TextMeshPro > Import TMP Essential Resources
  • 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/AndroidXRSample/Scripts/Sample/HISPlayerSample.cs and StreamController GameObject in the Editor.

Sample Explanation and SDK Usage

Editor Setup

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.

For detailed setup instructions for each render mode, please refer to RenderModes.

Scene-Specific Notes

SampleList Scene

Select one of sample scenes explained below.

HEVC_8K Scene

This scene demonstrates high-resolution video playback using Material render mode.

HEVC_8K Composition Layer Scene

This scene demonstrates high-resolution video playback using ExternalSurface render mode.

360° Scene

This scene demonstrates 360° video playback using RenderTexture render mode. The RenderScreen GameObject uses a Sphere as its Mesh Filter and only has a Mesh Renderer. This is the recommended configuration for 360° video.

Ambisonic Audio Scene

For information about Ambisonic audio support, please refer to Ambisonic

Script

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.

Stereoscopic Video Playback

Refer to Stereoscopic Video.

More Information, Features and APIs

For more information about the supported features and APIs, please refer to the following HISPlayer API.