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
-
Create a tag.
<view id="localVideo" ></view> -
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); });
