WeChat Mini Program Audio/Video vs WebRTC: Differences, Architecture, and Interoperability
Tencent Video Cloud’s Mini‑Program audio/video, built on the LiteAV SDK with RTMP/HTTP‑FLV tags, contrasts WebRTC’s browser‑native RTP/RTCP approach, but a bridge using an RTMP server and WebRTC‑Proxy translates streams, enabling interoperable live‑push/pull, room‑based multi‑person calls and rapid integration via a packaged webrtc‑room component.
Rex Chang, Tencent Video Cloud Terminal Technology Director, graduated in 2008 and has worked on client development for products such as PC QQ, Mobile QQ, and QQ IoT. He now leads audio‑video terminal solutions at Tencent Video Cloud, covering interactive live streaming, VOD, short video, real‑time video calls, image processing, AI, etc.
What is Mini‑Program Audio/Video? In 2017 Tencent Video Cloud integrated its video‑cloud SDK into WeChat Mini‑Programs, exposing the functionality through two tags: <live-pusher> and <live-player> . These tags enable developers to implement live streaming, low‑latency monitoring, one‑to‑one video calls, and multi‑person video conferences.
What is WebRTC? Web Real‑Time Communication (WebRTC) is a Google‑acquired technology that allows browsers to conduct real‑time audio and video communication via JavaScript without plugins. It is built into Chrome and now supported by Safari.
Key Differences
Implementation Principle : Mini‑Program audio/video embeds Tencent’s LiteAV SDK inside WeChat and exposes it via the two tags, while WebRTC is a browser‑native standard integrated into the Chrome engine.
Underlying Protocols : Mini‑Program uses RTMP for publishing and HTTP‑FLV for playback. WebRTC relies on RTP/RTCP.
Fragmentation on Mobile : Mini‑Program benefits from WeChat’s unified implementation, so fragmentation is minimal. WebRTC suffers from Android device fragmentation and iOS WebView’s lack of support.
Extensibility : Mini‑Program updates follow WeChat’s release cycle, allowing new features (e.g., beauty filters) to be shipped within a month. WebRTC follows a standards‑first approach, which can take longer to propagate.
Desktop Browsers : Chrome’s native WebRTC support gives it a strong advantage on PCs, whereas Mini‑Program video on desktop requires a plugin or a custom protocol such as wxlite://start .
Integration Strategy
The two technologies are not zero‑sum; Tencent Video Cloud built a bridge to make Mini‑Program audio/video and WebRTC interoperable. The workflow is:
Mini‑Program pushes audio/video streams to Tencent Cloud’s RTMP server via the LiteAV SDK.
The RTMP server performs initial transcoding and forwards the stream to the real‑time audio/video backend cluster.
The backend hands the stream to a WebRTC‑Proxy module, which translates the data into WebRTC format.
Chrome browsers on PC connect to the WebRTC‑Proxy and receive the video.
The process can be reversed for bidirectional calls, and multiple endpoints can be connected to create multi‑person conferencing.
Room Concept
To simplify state synchronization in multi‑person calls, a “room” abstraction is introduced. Participants join a room (EnterRoom) or leave it (LeaveRoom), and the server notifies all members of the current user list. The <live-pusher> tag now uses a room:// URL instead of an rtmp:// URL, and the onPushEvent with PUSH_EVT_ROOM_USERLIST = 1020 delivers the list of users and their playurl for the <live-player> to render.
Fast Integration
Developers can quickly achieve interoperability by using the packaged <webrtc-room> component, which encapsulates the above logic while allowing limited customization.
For more details, refer to the original article and the Tencent Cloud demo in the WeChat Mini‑Program section.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.