agora-appbuilder-core 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/customization-api/app-state.ts +6 -1
- package/template/customization-api/utils.ts +1 -1
- package/template/src/app-state/useLocalUserInfo.ts +3 -0
- package/template/src/app-state/useMessages.ts +3 -0
- package/template/src/components/chat-ui/useChatUIControl.tsx +3 -0
- package/template/src/components/meeting-info/useMeetingInfo.tsx +3 -0
- package/template/src/rtm-events-api/Events.ts +41 -30
- package/template/src/subComponents/SelectDevice.tsx +3 -2
- package/template/src/subComponents/recording/useRecording.tsx +3 -1
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +1 -1
- package/template/src/utils/common.tsx +18 -2
- package/template/src/utils/isMobileOrTablet.native.ts +4 -0
- package/template/src/utils/isMobileOrTablet.ts +4 -0
- package/template/src/utils/useCreateMeeting.ts +3 -0
- package/template/src/utils/useIsAttendee.ts +12 -18
- package/template/src/utils/useIsAudioEnabled.ts +4 -0
- package/template/src/utils/useIsHost.ts +4 -0
- package/template/src/utils/useIsPSTN.ts +2 -1
- package/template/src/utils/useIsScreenShare.ts +1 -1
- package/template/src/utils/useIsVideoEnabled.ts +4 -0
- package/template/src/utils/useJoinMeeting.ts +3 -1
- package/template/src/utils/useLayout.tsx +3 -1
- package/template/src/utils/useMuteToggleLocal.ts +3 -0
- package/template/src/utils/useRemoteEndCall.ts +3 -0
- package/template/src/utils/useRemoteMute.ts +3 -0
- package/template/src/utils/useSidePanel.tsx +3 -0
- package/template/src/utils/useUserName.ts +3 -0
package/package.json
CHANGED
|
@@ -7,8 +7,13 @@ import {RtcContext, RenderContext} from '../agora-rn-uikit';
|
|
|
7
7
|
// commented for v1 release
|
|
8
8
|
//import {default as DeviceContext} from '../src/components/DeviceContext';
|
|
9
9
|
//import {default as StorageContext} from '../src/components/StorageContext';
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The RTC app state exposes the internal RtcEngine object as well as dispatch interface to perform various actions.
|
|
12
|
+
*/
|
|
11
13
|
export const useRtc = createHook(RtcContext);
|
|
14
|
+
/**
|
|
15
|
+
* The Render app state governs the information necessary to render each user content view displayed in the videocall screen.
|
|
16
|
+
*/
|
|
12
17
|
export const useRender = createHook(RenderContext);
|
|
13
18
|
export {useLocalUserInfo} from '../src/app-state/useLocalUserInfo';
|
|
14
19
|
|
|
@@ -25,6 +25,6 @@ export {default as useIsVideoEnabled} from '../src/utils/useIsVideoEnabled';
|
|
|
25
25
|
export {useHistory, useParams} from '../src/components/Router';
|
|
26
26
|
|
|
27
27
|
//export common function
|
|
28
|
-
export {isWeb, isIOS, isAndroid,
|
|
28
|
+
export {isWeb, isIOS, isAndroid, isDesktop} from '../src/utils/common';
|
|
29
29
|
export {default as isMobileOrTablet} from '../src/utils/isMobileOrTablet';
|
|
30
30
|
export {useLocalUid} from '../agora-rn-uikit';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {useLocalUid} from '../../agora-rn-uikit';
|
|
2
2
|
import {useRender} from 'customization-api';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The LocalUserInfo app state contains the local user information like uid, audio and video mute states etc.
|
|
6
|
+
*/
|
|
4
7
|
export const useLocalUserInfo = () => {
|
|
5
8
|
const localUid = useLocalUid();
|
|
6
9
|
const {renderList} = useRender();
|
|
@@ -61,6 +61,9 @@ const ChatUIControlProvider = (props: ChatUIControlProviderProps) => {
|
|
|
61
61
|
);
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* The ChatUIControl app state governs the chat ui.
|
|
66
|
+
*/
|
|
64
67
|
const useChatUIControl = createHook(ChatUIControlContext);
|
|
65
68
|
|
|
66
69
|
export {ChatUIControlProvider, useChatUIControl};
|
|
@@ -62,6 +62,9 @@ const MeetingInfoProvider = (props: MeetingInfoProviderProps) => {
|
|
|
62
62
|
</MeetingInfoContext.Provider>
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* The MeetingInfo app state contains information about the active meeting.
|
|
67
|
+
*/
|
|
65
68
|
const useMeetingInfo = createHook(MeetingInfoContext);
|
|
66
69
|
|
|
67
70
|
export {MeetingInfoProvider, useMeetingInfo};
|
|
@@ -34,8 +34,8 @@ class Events {
|
|
|
34
34
|
/**
|
|
35
35
|
* Persists the data in the local attributes of the user
|
|
36
36
|
*
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {
|
|
37
|
+
* @param {String} evt to be stored in rtm Attribute key
|
|
38
|
+
* @param {String} payload to be stored in rtm Attribute value
|
|
39
39
|
* @api private
|
|
40
40
|
*/
|
|
41
41
|
private _persist = async (evt: string, payload: string) => {
|
|
@@ -53,7 +53,10 @@ class Events {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
+
* event type validator.
|
|
56
57
|
*
|
|
58
|
+
* @api private
|
|
59
|
+
* @returns {boolean}
|
|
57
60
|
*/
|
|
58
61
|
private _validateEvt = (evt: string): boolean => {
|
|
59
62
|
if (typeof evt !== 'string') {
|
|
@@ -67,6 +70,12 @@ class Events {
|
|
|
67
70
|
return true;
|
|
68
71
|
};
|
|
69
72
|
|
|
73
|
+
/**
|
|
74
|
+
* event listener validator
|
|
75
|
+
*
|
|
76
|
+
* @api private
|
|
77
|
+
* @returns {boolean}
|
|
78
|
+
*/
|
|
70
79
|
private _validateListener = (listener: EventCallback): boolean => {
|
|
71
80
|
if (typeof listener !== 'function') {
|
|
72
81
|
throw Error(
|
|
@@ -77,13 +86,13 @@ class Events {
|
|
|
77
86
|
};
|
|
78
87
|
|
|
79
88
|
/**
|
|
80
|
-
* Sets the local attribute of user if
|
|
81
|
-
* If param '
|
|
82
|
-
* If param '
|
|
83
|
-
* If param '
|
|
89
|
+
* Sets the local attribute of user if persist level is 2 or 3.
|
|
90
|
+
* If param 'toUid' is not provided, message is sent in the channel.
|
|
91
|
+
* If param 'toUid' is provided message is sent to that individual.
|
|
92
|
+
* If param 'toUid' is an array of uids is provided then message is sent to all the individual uids in loop.
|
|
84
93
|
*
|
|
85
|
-
* @param {
|
|
86
|
-
* @param {
|
|
94
|
+
* @param {Object} rtmPayload payload to be sent across
|
|
95
|
+
* @param {ReceiverUid} toUid uid or uids[] of user
|
|
87
96
|
* @api private
|
|
88
97
|
*/
|
|
89
98
|
private _send = async (rtmPayload: any, toUid?: ReceiverUid) => {
|
|
@@ -142,16 +151,16 @@ class Events {
|
|
|
142
151
|
};
|
|
143
152
|
|
|
144
153
|
/**
|
|
145
|
-
*
|
|
146
|
-
* Adds a listener function to the specified event.
|
|
154
|
+
* Listen on a new event by eventName and listener.
|
|
147
155
|
* When the specified event happens, the Events API triggers the callback that you pass.
|
|
148
|
-
* The listener will not be added if it is a duplicate.
|
|
156
|
+
* The listener will not be added/listened if it is a duplicate.
|
|
149
157
|
*
|
|
150
|
-
* @param {String} eventName Name of the event
|
|
158
|
+
* @param {String} eventName Name of the event. It must be a unique string.
|
|
151
159
|
* @param {Function} listener Method to be called when the event is emitted.
|
|
160
|
+
* @returns {Function} Returns function, call it and this listener will be removed from event
|
|
152
161
|
* @api public
|
|
153
162
|
*/
|
|
154
|
-
on = (eventName: string, listener: EventCallback) => {
|
|
163
|
+
on = (eventName: string, listener: EventCallback): Function => {
|
|
155
164
|
try {
|
|
156
165
|
if (!this._validateEvt(eventName) || !this._validateListener(listener))
|
|
157
166
|
return;
|
|
@@ -160,54 +169,57 @@ class Events {
|
|
|
160
169
|
EventUtils.removeListener(eventName, listener, this.source);
|
|
161
170
|
};
|
|
162
171
|
} catch (error) {
|
|
163
|
-
console.log('
|
|
172
|
+
console.log('CUSTOM_EVENT_API on error: ', error);
|
|
164
173
|
}
|
|
165
174
|
};
|
|
166
175
|
|
|
167
176
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* That means every event will be emptied.
|
|
177
|
+
* Listen off an event by eventName and listener
|
|
178
|
+
* or listen off events by eventName, when if only eventName argument is passed.
|
|
179
|
+
* or listen off all events, when if no arguments are passed.
|
|
172
180
|
*
|
|
173
181
|
* @param {String} eventName Name of the event to remove the listener from.
|
|
174
|
-
* @param {Function} listener
|
|
182
|
+
* @param {Function} listener Listener to remove from the event.
|
|
175
183
|
* @api public
|
|
176
184
|
*/
|
|
177
185
|
off = (eventName?: string, listener?: EventCallback) => {
|
|
178
186
|
try {
|
|
179
187
|
if (listener) {
|
|
180
188
|
if (this._validateListener(listener) && this._validateEvt(eventName)) {
|
|
189
|
+
// listen off an event by eventName and listener
|
|
181
190
|
EventUtils.removeListener(eventName, listener, this.source);
|
|
182
191
|
}
|
|
183
192
|
} else if (eventName) {
|
|
193
|
+
// listen off events by name, when if only name is passed.
|
|
184
194
|
if (this._validateEvt(eventName)) {
|
|
185
195
|
EventUtils.removeAllListeners(eventName, this.source);
|
|
186
196
|
}
|
|
187
197
|
} else {
|
|
198
|
+
// listen off all events, that means every event will be emptied.
|
|
188
199
|
EventUtils.removeAll(this.source);
|
|
189
200
|
}
|
|
190
201
|
} catch (error) {
|
|
191
|
-
console.log('
|
|
202
|
+
console.log('CUSTOM_EVENT_API off error: ', error);
|
|
192
203
|
}
|
|
193
204
|
};
|
|
194
205
|
|
|
195
206
|
/**
|
|
196
|
-
* This method sends p2p or channel message depending upon the '
|
|
197
|
-
* - If '
|
|
198
|
-
* - If '
|
|
207
|
+
* This method sends p2p or channel message depending upon the 'receiver' value.
|
|
208
|
+
* - If 'receiver' is provided this method sends p2p message.
|
|
209
|
+
* - If 'receiver' is empty this method sends channel message.
|
|
199
210
|
*
|
|
200
211
|
*
|
|
201
|
-
* @param {String} eventName Name of the event to
|
|
202
|
-
* @param {String} payload
|
|
203
|
-
* @param {
|
|
212
|
+
* @param {String} eventName Name of the event to send.
|
|
213
|
+
* @param {String} payload (optional) Additional data to be sent along with the event.
|
|
214
|
+
* @param {Enum} persistLevel (optional) set different levels of persistance. Default value is Level 1
|
|
215
|
+
* @param {ReceiverUid} receiver (optional) uid or uid array. Default mode sends message in channel.
|
|
204
216
|
* @api public
|
|
205
217
|
* */
|
|
206
218
|
send = async (
|
|
207
219
|
eventName: string = '',
|
|
208
220
|
payload: string = '',
|
|
209
|
-
persistLevel: EventPersistLevel,
|
|
210
|
-
receiver
|
|
221
|
+
persistLevel: EventPersistLevel = EventPersistLevel.LEVEL1,
|
|
222
|
+
receiver: ReceiverUid = -1,
|
|
211
223
|
) => {
|
|
212
224
|
if (!this._validateEvt(eventName)) return;
|
|
213
225
|
|
|
@@ -226,11 +238,10 @@ class Events {
|
|
|
226
238
|
persistLevel === EventPersistLevel.LEVEL2 ||
|
|
227
239
|
persistLevel === EventPersistLevel.LEVEL3
|
|
228
240
|
) {
|
|
229
|
-
console.log('CUSTOM_EVENT_API: Event lifecycle: persist', persistLevel);
|
|
230
241
|
try {
|
|
231
242
|
await this._persist(eventName, persistValue);
|
|
232
243
|
} catch (error) {
|
|
233
|
-
console.log('
|
|
244
|
+
console.log('CUSTOM_EVENT_API persist error: ', error);
|
|
234
245
|
}
|
|
235
246
|
}
|
|
236
247
|
try {
|
|
@@ -111,8 +111,9 @@ const SelectDevice = () => {
|
|
|
111
111
|
const [isPickerDisabled] = useSelectDevice();
|
|
112
112
|
//commented for v1 release
|
|
113
113
|
// const settingScreenInfoMessage = useString('settingScreenInfoMessage')();
|
|
114
|
-
const settingScreenInfoMessage =
|
|
115
|
-
'
|
|
114
|
+
const settingScreenInfoMessage = $config.AUDIO_ROOM
|
|
115
|
+
? 'Audio sharing is disabled for attendees. Raise hand to request permission to share.'
|
|
116
|
+
: 'Video and Audio sharing is disabled for attendees. Raise hand to request permission to share.';
|
|
116
117
|
return (
|
|
117
118
|
<View>
|
|
118
119
|
<View style={{marginTop: 15}}></View>
|
|
@@ -224,7 +224,9 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
224
224
|
</RecordingContext.Provider>
|
|
225
225
|
);
|
|
226
226
|
};
|
|
227
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The Recording app state governs the App Builder cloud recording functionality.
|
|
229
|
+
*/
|
|
228
230
|
const useRecording = createHook(RecordingContext);
|
|
229
231
|
|
|
230
232
|
export {RecordingProvider, useRecording};
|
|
@@ -163,7 +163,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
163
163
|
if (isRecordingActive) {
|
|
164
164
|
executeRecordingQuery(isActive);
|
|
165
165
|
}
|
|
166
|
-
console.log('
|
|
166
|
+
console.log('screenshare query executed');
|
|
167
167
|
try {
|
|
168
168
|
// @ts-ignore
|
|
169
169
|
await rtc.RtcEngine.startScreenshare(
|
|
@@ -29,17 +29,33 @@ const shouldAuthenticate: boolean =
|
|
|
29
29
|
//for our internal usage don't check Platform - electron and web will same kind ui checks. thats why we have isWeb for external usage
|
|
30
30
|
const isWebInternal = () => ReactNativePlatform.OS === 'web';
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Checks whether the application is running as a web app and returns true/false.
|
|
34
|
+
* @returns function
|
|
35
|
+
*/
|
|
32
36
|
const isWeb = () => Platform === 'web' && ReactNativePlatform.OS === 'web';
|
|
33
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Checks whether the application is running as an android app and returns true/false.
|
|
40
|
+
* @returns function
|
|
41
|
+
*/
|
|
34
42
|
const isAndroid = () =>
|
|
35
43
|
//@ts-ignore
|
|
36
44
|
Platform === 'native' && ReactNativePlatform.OS === 'android';
|
|
37
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Checks whether the application is running as an iOS app and returns true/false.
|
|
48
|
+
* @returns function
|
|
49
|
+
*/
|
|
38
50
|
//@ts-ignore
|
|
39
51
|
const isIOS = () => Platform === 'native' && ReactNativePlatform.OS === 'ios';
|
|
40
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Checks whether the application is running as an electron desktop app and returns true/false.
|
|
55
|
+
* @returns function
|
|
56
|
+
*/
|
|
41
57
|
//@ts-ignore
|
|
42
|
-
const
|
|
58
|
+
const isDesktop = () => Platform === 'electron';
|
|
43
59
|
|
|
44
60
|
const isArray = (data: any[]) =>
|
|
45
61
|
data && Array.isArray(data) && data.length ? true : false ? true : false;
|
|
@@ -49,7 +65,7 @@ export {
|
|
|
49
65
|
isIOS,
|
|
50
66
|
isWebInternal,
|
|
51
67
|
isWeb,
|
|
52
|
-
|
|
68
|
+
isDesktop,
|
|
53
69
|
shouldAuthenticate,
|
|
54
70
|
isArray,
|
|
55
71
|
isValidReactComponent,
|
|
@@ -27,6 +27,9 @@ const CREATE_CHANNEL = gql`
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
|
+
/**
|
|
31
|
+
* Returns an asynchronous function to create a meeting with the given options.
|
|
32
|
+
*/
|
|
30
33
|
export default function useCreateMeeting() {
|
|
31
34
|
const [createChannel, {error}] = useMutation(CREATE_CHANNEL);
|
|
32
35
|
const {setMeetingInfo} = useSetMeetingInfo();
|
|
@@ -9,28 +9,22 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
13
12
|
import {useLiveStreamDataContext} from '../components/contexts/LiveStreamDataContext';
|
|
14
13
|
import {UidType} from '../../agora-rn-uikit';
|
|
14
|
+
import {useVideoMeetingData} from '../components/contexts/VideoMeetingDataContext';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Returns a function that checks whether the given uid is an attendee and returns true/false
|
|
18
|
+
* @returns function
|
|
19
|
+
*/
|
|
16
20
|
function useIsAttendee() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return isAttendee;
|
|
25
|
-
} else {
|
|
26
|
-
const {
|
|
27
|
-
data: {isHost},
|
|
28
|
-
} = useMeetingInfo();
|
|
29
|
-
const isAttendee = (uid: UidType) => {
|
|
30
|
-
return !isHost ? true : false;
|
|
31
|
-
};
|
|
32
|
-
return isAttendee;
|
|
33
|
-
}
|
|
21
|
+
const {audienceUids: lsAudienceUids} = useLiveStreamDataContext();
|
|
22
|
+
const {attendeeUids: vmAudienceUids} = useVideoMeetingData();
|
|
23
|
+
const isAttendee = (uid: UidType) => {
|
|
24
|
+
const attUidsData = $config.EVENT_MODE ? lsAudienceUids : vmAudienceUids;
|
|
25
|
+
return attUidsData.filter((attId) => attId === uid).length ? true : false;
|
|
26
|
+
};
|
|
27
|
+
return isAttendee;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
export default useIsAttendee;
|
|
@@ -13,6 +13,10 @@ import {useRender} from 'customization-api';
|
|
|
13
13
|
import {UidType} from '../../agora-rn-uikit';
|
|
14
14
|
import {ToggleState} from '../../agora-rn-uikit/src/Contexts/PropsContext';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Returns a function that checks the audio state for a given uid and returns true/false
|
|
18
|
+
* @returns function
|
|
19
|
+
*/
|
|
16
20
|
function useIsAudioEnabled() {
|
|
17
21
|
const {renderList} = useRender();
|
|
18
22
|
/**
|
|
@@ -13,6 +13,10 @@ import {UidType} from '../../agora-rn-uikit';
|
|
|
13
13
|
import {useLiveStreamDataContext} from '../components/contexts/LiveStreamDataContext';
|
|
14
14
|
import {useVideoMeetingData} from '../components/contexts/VideoMeetingDataContext';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Returns a function that checks whether the given uid is a host and returns true/false
|
|
18
|
+
* @returns function
|
|
19
|
+
*/
|
|
16
20
|
function useIsHost() {
|
|
17
21
|
const {hostUids: liveStreamHostUids} = useLiveStreamDataContext();
|
|
18
22
|
const {hostUids: videoMeetingHostUids} = useVideoMeetingData();
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import {useRender} from 'customization-api';
|
|
13
13
|
import {UidType} from '../../agora-rn-uikit';
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Returns a function that checks whether the given uid is a PSTN user and returns true/false
|
|
16
17
|
* @returns function
|
|
17
18
|
*/
|
|
18
19
|
function useIsPSTN() {
|
|
@@ -13,7 +13,7 @@ import {UidType} from '../../agora-rn-uikit';
|
|
|
13
13
|
import {useScreenContext} from '../components/contexts/ScreenShareContext';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* This hook will return the function
|
|
16
|
+
* This hook will return the function which take UID and return true if screensharing active on the UID
|
|
17
17
|
* @returns function
|
|
18
18
|
*/
|
|
19
19
|
function useIsScreenShare() {
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
import {useRender} from 'customization-api';
|
|
13
13
|
import {UidType, ToggleState} from '../../agora-rn-uikit';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Returns a function that checks the video state for a given uid and returns true/false
|
|
17
|
+
* @returns function
|
|
18
|
+
*/
|
|
15
19
|
function useIsVideoEnabled() {
|
|
16
20
|
const {renderList} = useRender();
|
|
17
21
|
|
|
@@ -50,7 +50,9 @@ const JOIN_CHANNEL_PHRASE = gql`
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Returns an asynchronous function to join a meeting with the given phrase.
|
|
55
|
+
*/
|
|
54
56
|
export default function useJoinMeeting() {
|
|
55
57
|
const {store} = useContext(StorageContext);
|
|
56
58
|
const {setMeetingInfo} = useSetMeetingInfo();
|
|
@@ -34,7 +34,9 @@ const LayoutProvider = (props: LayoutProviderProps) => {
|
|
|
34
34
|
</LayoutContext.Provider>
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The Layout app state governs the video call screen content display layout.
|
|
39
|
+
*/
|
|
38
40
|
const useLayout = createHook(LayoutContext);
|
|
39
41
|
|
|
40
42
|
export {LayoutProvider, useLayout};
|
|
@@ -16,6 +16,9 @@ export enum MUTE_LOCAL_TYPE {
|
|
|
16
16
|
audio,
|
|
17
17
|
video,
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns an asynchronous function to toggle muted state of the given track type for the local user.
|
|
21
|
+
*/
|
|
19
22
|
function useMuteToggleLocal() {
|
|
20
23
|
const {RtcEngine, dispatch} = useRtc();
|
|
21
24
|
const local = useLocalUserInfo();
|
|
@@ -4,6 +4,9 @@ import useIsPSTN from './useIsPSTN';
|
|
|
4
4
|
import {UidType} from '../../agora-rn-uikit';
|
|
5
5
|
import events, {EventPersistLevel} from '../rtm-events-api';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Returns a function to end the call for a remote user with the given uid.
|
|
9
|
+
*/
|
|
7
10
|
const useRemoteEndCall = () => {
|
|
8
11
|
const {
|
|
9
12
|
data: {isHost},
|
|
@@ -20,6 +20,9 @@ export enum MUTE_REMOTE_TYPE {
|
|
|
20
20
|
audio,
|
|
21
21
|
video,
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns an asynchronous function to toggle muted state of the given track type for a remote user with the given uid or if no uid provided, mutes everyone else in the meeting.
|
|
25
|
+
*/
|
|
23
26
|
function useRemoteMute() {
|
|
24
27
|
const {
|
|
25
28
|
data: {isHost},
|