As of v3.0.0, the RTC Native SDK can communicate with the RTC Web SDK by default, whether in the COMMUNICATION
or the LIVE_BROADCASTING
profile.
For RTC native SDKs earlier than v3.0.0, the interoperability with the Web SDK is enabled by default in the COMMUNICATION
profile. In the LIVE_BROADCASTING
profile, however, to enable interoperability between a mobile device and a web browser or app, you need to make the following settings on both platforms.
On the mobile/desktop device, call the enableWebSdkInteroperability
method.
// java
// Ensure that this methid is called from the native side to interoperate with Web SDK.
rtcEngine.enableWebSdkInteroperability(true);
// swift
// Ensure that this method is called from the native side to interoperate with the Web SDK.
agoraKit.enableWebSdkInteroperability(true)
// objective-c
// Ensure that this method is called from the native side to interoperate with the Web SDK.
[agoraKit enableWebSdkInteroperability: YES];
// cpp
// Ensure that this method is called from the native side to interoperate with the Web SDK.
lpAgoraEngine->enableWebSdkInteroperability
For the Web, in the createClient
method, set the mode
argument as 'live'
.
// javascript
// Choose the current mode and codec.
var client = AgoraRTC.createClient({ mode: 'live', codec: 'h264' });
codec
at the Web Client as h264
; otherwise, set it as vp8
.