Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions ambisonic.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,3 @@ For more details, please refer to below APIs section and HISPlayer Meta Quest Am
* **TBE_8Channels_2HeadLockedChannels**: 8 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio

**public HISPlayerAmbisonicAudio AmbisonicAudio**: Ambisonics audio supporting ambiX format from first order to 3rd order, and TBE format. Enabling Ambisonic will disable Unity Audio. It's set to None or disabled by default. To modify this value, please use the Editor.

## HISPlayer Meta Quest Ambisonic Sample

Before using the sample, make sure that you have imported HISPlayer SDK. If not, please follow the [**Quickstart Guide**](./setup-guide.md).

Please download the sample here: [HISPlayerMetaQuestAmbisonicSample.unitypackage](https://downloads.hisplayer.com/Unity/Quest/HISPlayerMetaQuestAmbisonicSample.unitypackage) and import it to your Unity project.

* Open **Assets\HISPlayerMetaQuestAmbisonicSample\Scenes\HISPlayerMetaQuestAmbisonicSample.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/HISPlayerMetaQuestAmbisonicSample/Scripts/Sample/HISPlayerSample.cs and StreamController GameObject in the Editor.

The sample includes 3 local videos in StreamingAssets:
* 3rd order ambisonics (16 channels) ambiX format
* 2nd order ambisonics (9 channels) ambiX format
* 8 channels + 2 channels head-locked stereo TBE format

By default the sample plays local video with 3rd order ambisonics (16 channels) ambiX format.
24 changes: 0 additions & 24 deletions audio-retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,3 @@ The default speaker mode can be configured in Unity via: **Edit → Project Sett
<p align="center">
<img width=60% src="image-1.png">
</p>

### Sample Application Implementation
Our sample application includes the **GetAudioSource.cs** and **FillAudioSource.cs** scripts to demonstrate this functionality.
The sample is configured to use **Stereo** Speaker Mode and utilizes five separate AudioSource components (Center, Left, Right, Left Surround, Right Surround).

Because the speaker mode is Stereo:
The **Center AudioSource** needs to play through both the left and right speakers simultaneously. Therefore, its Input Channel Index is 0 (Center), and its Speaker Channel Indexes list is set to 0 (Left) and 1 (Right).
For the **Left AudioSource**, the Input Channel Index is 1 (Left), and its Speaker Channel Indexes list contains only 0 (Left).
The remaining AudioSource components follow this same routing logic based on their respective positions.

<p align="center">
<img width=40% src="image.png">
</p>

## HISPlayer Meta Quest Spatial Audio Sample

Please download the sample here: [HISPlayer_MetaQuest_SpatialAudio_Sample.unitypackage](https://downloads.hisplayer.com/Unity/Quest/HISPlayer_MetaQuest_OVROverlay_SpatialAudio_SampleV2.unitypackage) and import it to your Unity project.

Before using the sample, make sure that you have imported HISPlayer SDK. If not, please follow the [**Quickstart Guide**](./setup-guide.md).

The sample plays local video with 5 audio channels that are connected to 5 AudioSources. You may modify the sample depending on your audio channel count.
Please refer to the sample package which consists of the following Unity scenes in **HISPlayerSpatialAudioSample\Scenes**:
- **HISPlayerFillAudioSample**: Sample utilizing **FillAudioData()** API by passing the float[] data from each Unity Audio Source **OnAudioFilterRead()** which the data buffer will be filled automatically. To check the APIs usage, please refer to all scripts in **HISPlayerSpatialAudioSample\Scripts\Sample\Audio\FillAudioSample**.
- **HISPlayerGetAudioSample**: Sample utilizing **GetAudioData()** API in Unity Audio Source **OnAudioFilterRead()** for center channel, and the new audio data is shared to other channel classes. The new audio data will be copied to the float[] data of **OnAudioFilterRead()** for each channel. To check the APIs usage, please refer to all scripts in **HISPlayerSpatialAudioSample\Scripts\Sample\Audio\GetAudioSample**.
140 changes: 140 additions & 0 deletions sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Official Sample

Please, download the sample here[DELETE THIS COMMENT, upload the sample after the review): [**HISPlayer Meta Quest SDK Sample**]() (no need to download it if you have received it in the email).

## 1. Set Up HISPlayer Meta Quest SDK Sample

Before using the sample, please make sure you have followed the above steps to set-up your Unity project for Oculus and HISPlayer SDK. To use the sample, please follow these steps:
- Set up the [Meta XR All-in-One environment](/setup-guide.md?id=_11-integrate-meta-xr-all-in-one-sdk).
- Import HISPlayer SDK
- Import HISPlayer Meta Quest SDK Sample
- 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**. This must be done for **each scene** while adding them to the Scene List. Open each scene located in `Assets/HISPlayerMetaQuestSample/Scenes/`, set the license key if needed, then go to **File > Build Settings > Add Open Scenes** to include it in the **Scene List** of the Build Profile.
- Build and Run

To check how to set up the SDK and API usage, please refer to the sample scenes described below.

## 2. Sample Explanation

### 2.1. Shared Elements

All sample scenes share a common foundation that you need to understand before looking at the specific configurations:

- A **HISPlayerSample** script (or a variant) that inherits from `HISPlayerManager` and requires the `using HISPlayerAPI;` dependency.
- An **OVROverlay** component attached to the `RenderScreen` GameObject. Its key properties are:
- **Overlay Shape**: `Quad` for flat video, `Equirect` for 360°.
- **Is External Surface**: `True`
- **External Surface Width / Height**: set to the maximum resolution of your streams.
- **Is Protected Content**: `True` when playing DRM-protected content.
- The `SetUpMetaQuest()` method finds the `OVROverlay` component, assigns it to `MultiStreamProperties.externalSurface`, and calls `SetUpPlayer()` to initialize the player.
- **MultiStreamProperties** must have **RenderMode** set to **External Surface** on the **StreamController** GameObject.

The typical video rendering GameObject is a Quad named **RenderScreen**. The 360 scene uses a Sphere (see details below). Every scene follows the same initialization flow.

Example script structure:

```C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HISPlayerAPI;

public class HISPlayerSample : HISPlayerManager
{
...
}
```

With this shared baseline, each scene adds small variations that are explained in the following sections.

### 2.2. Available Scenes
#### 360 Scene
This scene renders a 360° video.

Instead of a Quad, the Mesh Filter uses a **Sphere**, and the assigned material is **360_Mat**, which relies on the **HISPlayer360Shader**.
<p align="center">
<img
alt="image"
src="https://github.com/user-attachments/assets/ca9214e3-242e-499e-b454-93bb6944337a"
style="max-width: 100%; height: auto;"
/>
</p>

The `OVROverlay` **Overlay Shape** is set to `Equirect`.
<p align="center">
<img
alt="image"
src="https://github.com/user-attachments/assets/467d5a7e-1932-4bae-8951-d54561bc9b35"
style="max-width: 100%; height: auto;"
/>
</p>

#### Ambisonic Scene
This scene plays **audio-only** content; there is no video rendering surface. The default stream used is:
`https://downloads.hisplayer.com/Unity/test-contents/Ambisonic_AmbiX_16Ch.mkv`
with **Ambisonic Audio** configured as **AMBIX_16 Channels**.

You can also test with these alternative streams:
- `https://downloads.hisplayer.com/Unity/test-contents/Ambisonic_AmbiX_9Ch.mkv` with **Ambisonic Audio** configured as **AMBIX_9 Channels**.
- `https://downloads.hisplayer.com/Unity/test-contents/Ambisonic_TBE_8_2.mkv` with **Ambisonic Audio** configured as **TBE_8 Channels_2 Head Locked Channels**.

For more information, please refer to the following [Ambisonic documentation](/ambisonic.md).

#### HEVC_DRM Scene
This scene is designed for **DRM-protected HEVC** content.

For more information, please refer to the following [DRM documentation](drm.md).

#### MultiStream Scene
Here the sample uses the **HISPlayerVRMultiController** script, a variant of `HISPlayerVRController` that is adapted to handle **two video streams** simultaneously. You can activate the **Synchronize Streams** option to keep both streams in sync.

For more details, please refer to the following [Synchronize MultiStreams API documentation](/hisplayer-api.md?id=void-synchronizemultistreamsint-primaryplayerindex-int-secondaryplayerindex-long-offsetms-0).

#### MV-HEVC Scene
This scene is configured to play **MV-HEVC** (Multiview High Efficiency Video Coding) content, enabling native 3D or multiview video playback.

For more information, please refer to the following [MV-HEVC documentation](/stereoscopic.md?id=hisplayer-meta-quest-mv-hevc-sample).

#### Spatial Audio Scene
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](/audio-retrieval.md).

#### Stereoscopic Scene
This scene is set up for **stereoscopic video** playback, rendering separate left/right eye views.

For more information, please refer to the following [Stereoscopic guide](/stereoscopic.md).

### 2.3. Controls
#### Scene Navigation Controls
Use the **right controller** to navigate between the sample scenes:
- Press **A** to move to the **next scene**.
- Press **B** to go back to the **previous scene**.

The order of the scenes is defined by the **Scene List** in the **Build Profile** (File > Build Settings).

#### Playback Controls
Each scene provides a unified control bar with the following interactive elements:

<p align="center">
<img
alt="image"
src="https://github.com/user-attachments/assets/f36fb43b-c2b7-4161-81bd-9eac33ea735d"
style="max-width: 100%; height: auto;"
/>
</p>

- **Video timeline**: a draggable seek bar that displays the current playback progress.
- **Stop** button
- **Mute** button
- **Volume control** slider
- **Previous Video** button
- **Backward** button
- **Play/Pause** button
- **Forward** button
- **Next Video** button
- **Speed Rate** button: cycles through the available playback speeds.
- **Subtitles** button: toggles subtitles when they are available.
- **Settings** button: opens a settings panel.

Inside the **Settings** panel, and depending on the video’s capabilities, you can change the **Quality**, **Language**, and **Captions**.
102 changes: 12 additions & 90 deletions setup-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Getting started with HISPlayer consists of implementing the following steps:

1.3. Configure Unity for Android

2. HISPlayer Meta Quest SDK Sample
2.1 Import HISPlayer Meta Quest SDK Sample
2. Official Sample

3. More Information, Features and APIs

## 1.1 Integrate Meta XR All-in-One SDK

Expand All @@ -20,23 +20,23 @@ Integrate HISPlayer SDK with the **[Meta XR All-in-One SDK](https://developer.oc
First, please configure the Unity project for Oculus by following this [Tutorial](https://developer.oculus.com/documentation/unity/unity-tutorial-hello-vr/) and open **Window > Package Manager > Packages: In Project** to check Meta XR All-in-One SDK is installed properly.

<p align="center">
<img width="605" alt="image" src="https://github.com/HISPlayer/UnityAndroid-SDK/assets/47497948/b4e362ba-f3d1-4d07-a46b-7a76e73d30fb">
<img width="605" alt="image" src="https://github.com/HISPlayer/UnityAndroid-SDK/assets/47497948/b4e362ba-f3d1-4d07-a46b-7a76e73d30fb">
</p>

#### Meta XR Setup Tool

Open **Edit > Player Settings > MetaXR**, select the Android platform and clik "**Select All**" and "**Apply All**" in order to set up all the Meta XR settings.

<p align="center">
<img width="90%" alt="image" src="https://github.com/HISPlayer/UnityAndroid-SDK/assets/47497948/691d9de5-3874-4b6a-bb1e-3b2981020590">
<img width="90%" alt="image" src="https://github.com/HISPlayer/UnityAndroid-SDK/assets/47497948/691d9de5-3874-4b6a-bb1e-3b2981020590">
</p>

In XR Plug-in Management, please make sure that you have the **OpenXR** option checked (or Oculus for older Meta XR SDK version). Otherwise, when you run the application, it will show a 2D window without XR environment.

- **Edit > Project Settings > XR Plug-in Management**

<p align="center">
<img width="60%" alt="image" src="https://github.com/user-attachments/assets/3d1372e8-ee40-41fd-8ddd-d8d360a47534">
<img width="60%" alt="image" src="https://github.com/user-attachments/assets/3d1372e8-ee40-41fd-8ddd-d8d360a47534">
</p>

## 1.2 Import HISPlayer SDK
Expand All @@ -49,15 +49,15 @@ Select the package of _HISPlayer SDK_ and import it.
Select the package of _HISPlayer SDK_ and import it.

<p align="center">
<img width=90% src="https://github.com/user-attachments/assets/c6c6d488-2b2c-4b79-b775-dd9dffc14471">
<img width=90% src="https://github.com/user-attachments/assets/c6c6d488-2b2c-4b79-b775-dd9dffc14471">
</p>

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

<p align="center">
<img width="450" src="assets/image-player-setting-configuration.png">
<img width="450" src="assets/image-player-setting-configuration.png">
</p>

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.
Expand All @@ -66,91 +66,13 @@ Setting **"Plugins folder"** will create **mainTemplate.gradle** and **gradleTem
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.

<p align="center">
<img width="250" alt="image" src="assets/image-android-sdk-update.png">
<img width="250" alt="image" src="assets/image-android-sdk-update.png">
</p>

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

## 2.1 Import HISPlayer Meta Quest SDK Sample

Please, download the sample here: [**HISPlayer Meta Quest SDK Sample**](https://downloads.hisplayer.com/Unity/Quest/HISPlayer_MetaQuestSDK_Sample.unitypackage) (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 Oculus and HISPlayer SDK. To use the sample, please follow these steps :
- Set up the Meta XR All-in-One environment
- Import HISPlayer SDK
- Import HISPlayer Meta Quest SDK Sample
- Open Assets/HISPlayerMetaQuestSample/Scenes/HISPlayerMetaQuestSDKSample.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/HISPlayerMetaQuestSDKSample/Scripts/Sample/**HISPlayerSample.cs** and **StreamController** GameObject in the Editor.

## Sample Explanation

### Editor

Attach OVROverlay script to **RenderScreen** Quad GameObject. The video will be rendered on the Quad GameObject.

<p align="center">
<img width="70%" alt="image" src="https://github.com/user-attachments/assets/54f131a8-1331-49ed-bf17-df40311e2526">
</p>

Set the following OVROverlay properties:
- **Overlay Shape**: Quad or Equirect (for 360 degree video)
- **Is External Surface**: True
- **External Surface Width**: Input the desired width size. You may input the same value as the highest resolution (width) of your stream.
- **External Surface Height**: Input the desired height size. You may input the same value as the highest resolution (height) of your stream.
- **Is Protected Content**: True.

In the HISPlayer multistream properties, set the **RenderMode** as **External Surface**. Please go to **StreamController** GameObject > **HISPlayerSample** script > **MultiStreamProperties** > **RenderMode** > **External Surface**.

<p align="center">
<img width="90%" alt="image" src="https://github.com/user-attachments/assets/3aff176b-16e5-46b0-b42a-0ace964c1dcc">
</p>

### Script

Please check Assets/HISPlayerMetaQuestSDKSample/Scripts/Sample/**HISPlayerSample.cs** script. The script must inherit from **HISPlayerManager**. It is necessary to add the **'using HISPlayerAPI;'** dependency

```C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HISPlayerAPI;

public class HISPlayerSample : HISPlayerManager
{
...
}
```

Next, please refer to the **SetUpMetaQuest()** function:
- Find OVROverlay component from the GameObject (**RenderScreen**) that we have created.
- When the external surface object has been created:
- Set the external surface to HISPlayer multistream properties's **externalSurface** object.
- Call **SetUpPlayer()** to initialize the player and load the stream.

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.

### Non-DRM Video Playback
If you are not playing a DRM protected content, please modify the **MultiStreamProperties** by unchecking the **Enable DRM** checkbox to disable DRM and remove all element from **Key Server URI** list.

<p align="center">
<img width="50%" alt="image" src="https://github.com/user-attachments/assets/5da42bb6-30bc-47c1-b4ee-70b81775286e">
</p>

### 360 Degree Video Playback
To render 360 degree video, you can set the OVROverlay property **Overlay Shape** to **Equirect**.

<p align="center">
<img width="80%" alt="image" src="https://github.com/user-attachments/assets/cefa37ec-0cd1-457b-b283-5d7e7e27a697">
</p>


### Stereoscopic Video Playback
Refer to [**Stereoscopic Video**](./stereoscopic.md).
## 2. Official Sample
To try the official sample, please refer to the following [**Official Sample**](/sample.md).

## More Information, Features and APIs
## 3. More Information, Features and APIs
For more information about the supported features and APIs, please refer to the following [**HISPlayer API**](/hisplayer-api.md).
1 change: 1 addition & 0 deletions sidebar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- [HISPlayer Unity Meta Quest SDK](/introduction.md)
- [Quickstart Guide](/setup-guide.md)
- [Official Sample](/sample.md)
- [HISPlayer API](/hisplayer-api.md)
- [DRM](/drm.md)
- [Material / RawImage / RenderTexture Rendering](/rendermodes.md)
Expand Down
Loading