Skip to main content
SDK 2.0.0. The Web SDK has no native-style unified “GL texture preprocess callback”. Use this pipeline instead: Capture → processImage → draw to canvas → captureStream / take a MediaStreamTrack → hand it to the third-party SDK (replaceTrack or a custom video track). Auth must use one of the Web options (licenseToken / authProxyUrl / fetchAuthResponse). Never embed appKey in frontend JS. See Auth & License and Implement Beauty.
Prefer processImage. processTexture is for existing GPU texture handles and does not apply mirror. For live preview / publish, use the canvas pipeline above.
On page unload: beautyTrack.stop(), cancel requestAnimationFrame, and engine.destroy().

Hook into third-party SDKs

Vendor Web APIs change across versions. Below is only how to feed beautyTrack in; join, tokens, and device picking stay in their docs.

TRTC (Tencent Web)

Two common patterns (check your trtc-js-sdk / TUI version):
  1. Create the local stream from the beauty track (custom video source / pass a MediaStreamTrack)
  2. Create a camera stream first, then replaceTrack(beautyTrack)
Do not assume a native-style onProcessVideoFrame(textureId) exists on Web.

Agora Web

Use a custom video track or replaceTrack on an existing track:

LiveKit Web

Pass the processed track into LiveKit’s local video track factory, or replace on a published track:

Notes

Troubleshooting