瀏覽代碼

feat(rn-sdk): add getRoomsInfo ref callback

factor2
Abbas Al-Mansoori 1 年之前
父節點
當前提交
1bc50ea71c
共有 1 個文件被更改,包括 15 次插入1 次删除
  1. 15
    1
      react-native-sdk/index.tsx

+ 15
- 1
react-native-sdk/index.tsx 查看文件

16
 import { appNavigate } from './react/features/app/actions.native';
16
 import { appNavigate } from './react/features/app/actions.native';
17
 import { App } from './react/features/app/components/App.native';
17
 import { App } from './react/features/app/components/App.native';
18
 import { setAudioMuted, setVideoMuted } from './react/features/base/media/actions';
18
 import { setAudioMuted, setVideoMuted } from './react/features/base/media/actions';
19
+import { getRoomsInfo } from './react/features/breakout-rooms/functions';
20
+import type { IRoomsInfo } from '../react/features/breakout-rooms/types';
19
 
21
 
20
 
22
 
21
 interface IEventListeners {
23
 interface IEventListeners {
49
     userInfo?: IUserInfo;
51
     userInfo?: IUserInfo;
50
 }
52
 }
51
 
53
 
54
+export interface JitsiRefProps {
55
+    close: Function;
56
+    setAudioMuted?: (muted: boolean) => void;
57
+    setVideoMuted?: (muted: boolean) => void;
58
+    getRoomsInfo?: () => IRoomsInfo;
59
+}
60
+
52
 /**
61
 /**
53
  * Main React Native SDK component that displays a Jitsi Meet conference and gets all required params as props
62
  * Main React Native SDK component that displays a Jitsi Meet conference and gets all required params as props
54
  */
63
  */
55
-export const JitsiMeeting = forwardRef((props: IAppProps, ref) => {
64
+export const JitsiMeeting = forwardRef<JitsiRefProps, IAppProps>((props, ref) => {
56
     const [ appProps, setAppProps ] = useState({});
65
     const [ appProps, setAppProps ] = useState({});
57
     const app = useRef(null);
66
     const app = useRef(null);
58
     const {
67
     const {
82
             const dispatch = app.current.state.store.dispatch;
91
             const dispatch = app.current.state.store.dispatch;
83
 
92
 
84
             dispatch(setVideoMuted(muted));
93
             dispatch(setVideoMuted(muted));
94
+        },
95
+        getRoomsInfo: () => {
96
+            const state = app.current.state.store.getState();
97
+
98
+            return getRoomsInfo(state);
85
         }
99
         }
86
     }));
100
     }));
87
 
101
 

Loading…
取消
儲存