问题:
在我的 react native 应用程序中,我使用的是 jitsi react-native 包装器。我的代码看起来像这样。
import React, {Component, useEffect} from 'react';
import JitsiMeet, {JitsiMeetView} from 'react-native-jitsi-meet';
const JitsiVideo = () => {
useEffect(() => {
setTimeout(() => {
const url = 'https://meet.jit.si/MagneticNichesBlameTruly';
const userInfo = {
displayName: 'Tharaka',
email: 'tharindu@example.com',
avatar: 'https:/gravatar.com/avatar/abc123',
};
JitsiMeet.call(url);
/* Você também pode usar o JitsiMeet.audioCall (url) para chamadas apenas de áudio */
/* Você pode terminar programaticamente a chamada com JitsiMeet.endCall () */
}, 1000);
}, []);
useEffect(() => {
return () => {
JitsiMeet.endCall();
};
});
function onConferenceTerminated(nativeEvent) {
/* Conference terminated event */
console.log(nativeEvent);
}
function onConferenceJoined(nativeEvent) {
/* Conference joined event */
console.log(nativeEvent);
}
function onConferenceWillJoin(nativeEvent) {
/* Conference will join event */
console.log(nativeEvent);
}
return (
<JitsiMeetView
onConferenceTerminated={(e) => onConferenceTerminated(e)}
onConferenceJoined={(e) => onConferenceJoined(e)}
onConferenceWillJoin={(e) => onConferenceWillJoin(e)}
style={{
flex: 1,
height: '100%',
width: '100%',
}}
/>
);
};
export default JitsiVideo;
当用户单击按钮时,我正在导航到该组件。导航到此组件时,它显示为黑色背景,执行此代码时,JitsiMeet.call(url);
它正在关闭我的应用程序而不显示任何错误。我尝试了很多来找到解决方案,但我无法这样做。如果有人可以帮助我解决这个问题,那就太好了。谢谢