logo
Live Streaming
On this page

Use uni-app for Browser Rendering and Playback (Web)


Application Scenarios

When using ZEGO Web SDK, call the createZegoStream interface to create a ZegoLocalStream instance object localStream, then call the playVideo interface to play the preview video.

Usage Steps

  1. Create a tag.

    <view id="localVideo" ></view>
  2. Create a stream and play the preview.

    const localVideo = document.querySelector("#localVideo");
    
    const localStream = this.zg
      .createZegoStream({
        camera: { video: true, audio: true },
      })
      .then((stream) => {
        stream.playVideo(localVideo);
      })
      .catch((err) => {
        console.error(err);
      });

Previous

Implementing Video Call with React (Web)

Next

Browser Autoplay Policy (Web)

On this page

Back to top