React native Agora 3.5.0 TypeError:_reactNativeAgora.RtcEngi



我将我们的apss-agora版本更新到3.5.0,因为它在ios 15上不起作用。nwo它适用于ios15,但不适用于android。

代码正是从这个开始的

https://github.com/AgoraIO-Community/react-native-agora/blob/master/example/src/examples/basic/JoinChannelVideo/JoinChannelVideo.tsx

UNSAFE_componentWillMount() {
this._initEngine();
}
componentWillUnmount() {
this._engine?.destroy();
}
_initEngine = async () => {
this._engine = await RtcEngine.createWithContext(
new RtcEngineContext(config.appId)
);
this._addListeners();
await this._engine.enableVideo();
await this._engine.startPreview();
await this._engine.setChannelProfile(ChannelProfile.LiveBroadcasting);
await this._engine.setClientRole(ClientRole.Broadcaster);
};

上面写着

TypeError: _reactNativeAgora.RtcEngineContext is not a constructor

您使用的UNSAFE_componentWillMount可能会导致问题。

相关内容

  • 没有找到相关文章

最新更新