Alpha transparency effect

Updated

Segment the host's background and apply transparent special effects to enhance real-time video interactions.

In various real-time video interaction use-cases, segmenting the host's background and applying transparent special effects can make the interaction more engaging, enhance immersion, and improve the overall interactive experience.

Consider the following sample use-cases:

  • Broadcaster background replacement: The audience sees the broadcaster's background in the video replaced with a virtual scene, such as a gaming environment, a conference, or a tourist attractions.

  • Animated virtual gifts: Display dynamic animations with a transparent background to avoid obscuring live content when multiple video streams are merged.

  • Chroma keying during live game streaming: The audience sees the broadcaster's image cropped and positioned within the local game screen, making it appear as though the broadcaster is part of the game.

Prerequisites

Ensure that you have implemented the SDK quickstart in your project.

Implement alpha transparency

Sample code is currently available for the Android, Unity, and React Native platforms only. If your target platform is different, please refer to the code samples on the Android page and implement similar logic for your platform using the API reference.

Development notes

  • Implement the transparency properties of the app window yourself and handle the transparency relationship when multiple windows are stacked on top of each other (achieved by adjusting the zOrder of the window).

  • For iOS, set opaque to false in the view's layer property when setting up the view.

  • For macOS, You don't need to additionally set the transparency properties of the window. Follow the settings described for iOS.