Table of Contents

HarmonyOS NEXT Platform

Plugin Specs

  • Compatibility
    • Tuanjie Engine version 1.0 and above
    • Supported CPU architecture: ARM64 (arm64-v8a)
  • Rendering
    • OpenGLES (3.0 and above)
    • Vulkan
  • Internals
    • Playback uses the native HarmonyOS AVPlayer API

Platform Notes

Playback is currently only supported from Streaming Assets or HTTP/HTTPS To deploy to your device, the project must first be exported from Tuanjie to DevEco Studio to be built.

Supported Media

See the Supported Media section for more information.

Streaming

See the Streaming section for more information.

Audio and Subtitles

Audio can be played through the native player or routed through the Unity audio pipe using the AudioOutput component.

Audio and text tracks can be selected in the MediaPlayer Inspector or through the AudioTracks and TextTracks scripting interfaces. Subtitle text from the active text track is returned to the Unity C# layer through TextTracks.GetCurrentTextCue(). See track selection and Subtitles.

HTTP Headers and Encrypted HLS

Custom HTTP headers and AES-128 encrypted HLS playback are supported. HLS keys can be retrieved using the URI in the manifest, supplied in the manifest as an inline key, or overridden by the application. An authentication token can be supplied for key-server requests. See Content Protection.

Platform-Specific Options

See the Platform-Specific Options section for more information.

OES Texture Format

With the OpenGLES3 graphics API, OES textures allow the video to be sampled directly from the decoder's hardware buffer, avoiding the extra copy to a BGRA texture. This can reduce memory use and improve performance, particularly for high-resolution video.

To enable OES, set Texture Format to Y Cb Cr 420_OES in the HarmonyOS NEXT platform-specific section of the Media Player component inspector before creating the player. BGRA remains the default.

OES requires an AVPro Video OES shader. Use the shaders with "Android OES ONLY" in their names; these also support HarmonyOS NEXT. DisplayUGUI selects the appropriate shader automatically. To use a regular material shader, first resolve the video with the ResolveToRenderTexture component.

Note

OES requires a full plugin build and is not available in the trial version or with Vulkan. If the required OpenGL ES external-texture extensions are unavailable, the player falls back to BGRA.

Note

Native Generate MipMaps is ignored while OES is active. If mipmaps are required, enable mipmap generation on ResolveToRenderTexture instead.