How to implement playing streams from CDN on the Web platform?
2023-05-24
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:Web
- Before logging in to the room, users need to subscribe to stream update information in the room through
zegoExpressEngine.on('roomStreamUpdate', callBack:(roomID,updateType,streamList) => void). - When a new stream is added to the room, the "callBack" will be triggered. You can get the stream update list through "streamList", and the list member attributes contain the corresponding CDN playback addresses (flv, rtmp, hls). After obtaining the CDN address, you cannot play it through the "startPlayingStream" interface. You need to use plugins such as "flv.js" or "video.js".
- Currently, playing rtmp addresses on the Web platform requires relying on the flash plugin. If the browser does not support the flash plugin, the browser cannot play streams with rtmp addresses.
- Safari restricts playing flv streams and can only play m3u8 or rtmp streams.
- Latency of various play stream addresses: rtmp, flv: 2s ~ 5s, m3u8: 5s ~ 20s.
<video id="vd_remote" playsinline controls>
</video>