|
1 | | -<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
2 | | -<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
3 | | -# React Component Reference |
| 1 | +Components |
| 2 | +---------- |
4 | 3 |
|
5 | | -- [TwilioVideo](#twiliovideo) |
6 | | -- [TwilioVideoLocalView](#twiliovideolocalview) |
7 | | -- [TwilioVideoParticipantView](#twiliovideoparticipantview) |
8 | 4 |
|
9 | | -<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 5 | +**src/TwilioVideo.android.js** |
10 | 6 |
|
11 | | -## TwilioVideo |
12 | 7 |
|
13 | | -From [`../src/TwilioVideo.js`](../src/TwilioVideo.js) |
| 8 | +### 1. CustomTwilioVideoView |
14 | 9 |
|
15 | | -#### onCameraDidStart |
16 | 10 |
|
17 | | -```js |
18 | | -onCameraDidStart: Function |
19 | | -``` |
20 | 11 |
|
21 | | -Called when the camera has started |
22 | 12 |
|
23 | | -#### onCameraDidStopRunning |
| 13 | +Property | Type | Required | Default value | Description |
| 14 | +:--- | :--- | :--- | :--- | :--- |
| 15 | +onCameraSwitched | func | no | | Callback that is called when camera source changes |
| 16 | +onVideoChanged | func | no | | Callback that is called when video is toggled. |
| 17 | +onAudioChanged | func | no | | Callback that is called when a audio is toggled. |
| 18 | +onRoomDidConnect | func | no | | Callback that is called when user is connected to a room. |
| 19 | +onRoomDidFailToConnect | func | no | | Callback that is called when connecting to room fails. |
| 20 | +onRoomDidDisconnect | func | no | | Callback that is called when user is disconnected from room. |
| 21 | +onParticipantAddedDataTrack | func | no | | Called when a new data track has been added @param {{participant, track}} |
| 22 | +onParticipantRemovedDataTrack | func | no | | Called when a data track has been removed @param {{participant, track}} |
| 23 | +onDataTrackMessageReceived | func | no | | Called when an dataTrack receives a message @param {{message}} |
| 24 | +onParticipantAddedVideoTrack | func | no | | Called when a new video track has been added @param {{participant, track, enabled}} |
| 25 | +onParticipantRemovedVideoTrack | func | no | | Called when a video track has been removed @param {{participant, track}} |
| 26 | +onParticipantAddedAudioTrack | func | no | | Called when a new audio track has been added @param {{participant, track}} |
| 27 | +onParticipantRemovedAudioTrack | func | no | | Called when a audio track has been removed @param {{participant, track}} |
| 28 | +onRoomParticipantDidConnect | func | no | | Callback called a participant enters a room. |
| 29 | +onRoomParticipantDidDisconnect | func | no | | Callback that is called when a participant exits a room. |
| 30 | +onParticipantEnabledVideoTrack | func | no | | Called when a video track has been enabled. @param {{participant, track}} |
| 31 | +onParticipantDisabledVideoTrack | func | no | | Called when a video track has been disabled. @param {{participant, track}} |
| 32 | +onParticipantEnabledAudioTrack | func | no | | Called when an audio track has been enabled. @param {{participant, track}} |
| 33 | +onParticipantDisabledAudioTrack | func | no | | Called when an audio track has been disabled. @param {{participant, track}} |
| 34 | +onStatsReceived | func | no | | Callback that is called when stats are received (after calling getStats) |
| 35 | +onNetworkQualityLevelsChanged | func | no | | Callback that is called when network quality levels are changed (only if enableNetworkQualityReporting in connect is set to true) |
| 36 | +onDominantSpeakerDidChange | func | no | | Called when dominant speaker changes @param {{ participant, room }} dominant participant and room |
| 37 | +----- |
24 | 38 |
|
25 | | -```js |
26 | | -onCameraDidStopRunning: Function |
27 | | -``` |
| 39 | +**src/TwilioVideo.ios.js** |
28 | 40 |
|
29 | | -Called when the camera has stopped running with an error |
30 | 41 |
|
31 | | -@param {{error}} The error message description |
| 42 | +### 1. TwilioVideo |
32 | 43 |
|
33 | | -#### onCameraWasInterrupted |
34 | 44 |
|
35 | | -```js |
36 | | -onCameraWasInterrupted: Function |
37 | | -``` |
38 | 45 |
|
39 | | -Called when the camera has been interrupted |
40 | 46 |
|
41 | | -#### onParticipantAddedAudioTrack |
| 47 | +Property | Type | Required | Default value | Description |
| 48 | +:--- | :--- | :--- | :--- | :--- |
| 49 | +screenShare | bool | no | | Flag that enables screen sharing RCTRootView instead of camera capture |
| 50 | +onRoomDidConnect | func | no | | Called when the room has connected @param {{roomName, participants}} |
| 51 | +onRoomDidDisconnect | func | no | | Called when the room has disconnected @param {{roomName, error}} |
| 52 | +onRoomDidFailToConnect | func | no | | Called when connection with room failed @param {{roomName, error}} |
| 53 | +onRoomParticipantDidConnect | func | no | | Called when a new participant has connected @param {{roomName, participant}} |
| 54 | +onRoomParticipantDidDisconnect | func | no | | Called when a participant has disconnected @param {{roomName, participant}} |
| 55 | +onParticipantAddedVideoTrack | func | no | | Called when a new video track has been added @param {{participant, track, enabled}} |
| 56 | +onParticipantRemovedVideoTrack | func | no | | Called when a video track has been removed @param {{participant, track}} |
| 57 | +onParticipantAddedDataTrack | func | no | | Called when a new data track has been added @param {{participant, track}} |
| 58 | +onParticipantRemovedDataTrack | func | no | | Called when a data track has been removed @param {{participant, track}} |
| 59 | +onParticipantAddedAudioTrack | func | no | | Called when a new audio track has been added @param {{participant, track}} |
| 60 | +onParticipantRemovedAudioTrack | func | no | | Called when a audio track has been removed @param {{participant, track}} |
| 61 | +onParticipantEnabledVideoTrack | func | no | | Called when a video track has been enabled. @param {{participant, track}} |
| 62 | +onParticipantDisabledVideoTrack | func | no | | Called when a video track has been disabled. @param {{participant, track}} |
| 63 | +onParticipantEnabledAudioTrack | func | no | | Called when an audio track has been enabled. @param {{participant, track}} |
| 64 | +onParticipantDisabledAudioTrack | func | no | | Called when an audio track has been disabled. @param {{participant, track}} |
| 65 | +onDataTrackMessageReceived | func | no | | Called when an dataTrack receives a message @param {{message}} |
| 66 | +onCameraDidStart | func | no | | Called when the camera has started |
| 67 | +onCameraWasInterrupted | func | no | | Called when the camera has been interrupted |
| 68 | +onCameraInterruptionEnded | func | no | | Called when the camera interruption has ended |
| 69 | +onCameraDidStopRunning | func | no | | Called when the camera has stopped runing with an error @param {{error}} The error message description |
| 70 | +onStatsReceived | func | no | | Called when stats are received (after calling getStats) |
| 71 | +onNetworkQualityLevelsChanged | func | no | | Called when the network quality levels of a participant have changed (only if enableNetworkQualityReporting is set to True when connecting) |
| 72 | +onDominantSpeakerDidChange | func | no | | Called when dominant speaker changes @param {{ participant, room }} dominant participant |
| 73 | +----- |
42 | 74 |
|
43 | | -```js |
44 | | -onParticipantAddedAudioTrack: Function |
45 | | -``` |
| 75 | +**src/TwilioVideoLocalView.android.js** |
46 | 76 |
|
47 | | -Called when a new audio track has been added |
48 | 77 |
|
49 | | -@param {{participant, track}} |
| 78 | +### 1. TwilioVideoPreview |
50 | 79 |
|
51 | | -#### onParticipantAddedVideoTrack |
52 | 80 |
|
53 | | -```js |
54 | | -onParticipantAddedVideoTrack: Function |
55 | | -``` |
56 | 81 |
|
57 | | -Called when a new video track has been added |
58 | 82 |
|
59 | | -@param {{participant, track, enabled}} |
| 83 | +Property | Type | Required | Default value | Description |
| 84 | +:--- | :--- | :--- | :--- | :--- |
| 85 | +scaleType | enum('fit','fill',) | no | | How the video stream should be scaled to fit its container. |
| 86 | +----- |
60 | 87 |
|
61 | | -#### onParticipantDisabledVideoTrack |
| 88 | +**src/TwilioVideoLocalView.ios.js** |
62 | 89 |
|
63 | | -```js |
64 | | -onParticipantDisabledVideoTrack: Function |
65 | | -``` |
66 | 90 |
|
67 | | -Called when a video track has been disabled. |
| 91 | +### 1. TwilioVideoLocalView |
68 | 92 |
|
69 | | -@param {{participant, track}} |
70 | 93 |
|
71 | | -#### onParticipantDisabledAudioTrack |
72 | 94 |
|
73 | | -```js |
74 | | -onParticipantDisabledAudioTrack: Function |
75 | | -``` |
76 | 95 |
|
77 | | -Called when an audio track has been disabled. |
| 96 | +Property | Type | Required | Default value | Description |
| 97 | +:--- | :--- | :--- | :--- | :--- |
| 98 | +enabled | bool | YES | | Indicate if video feed is enabled. |
| 99 | +scaleType | enum('fit','fill',) | no | | How the video stream should be scaled to fit its container. |
| 100 | +----- |
78 | 101 |
|
79 | | -@param {{participant, track}} |
| 102 | +**src/TwilioVideoParticipantView.android.js** |
80 | 103 |
|
81 | | -#### onParticipantEnabledVideoTrack |
82 | 104 |
|
83 | | -```js |
84 | | -onParticipantEnabledVideoTrack: Function |
85 | | -``` |
| 105 | +### 1. TwilioRemotePreview |
86 | 106 |
|
87 | | -Called when a video track has been enabled. |
88 | 107 |
|
89 | | -@param {{participant, track}} |
90 | 108 |
|
91 | | -#### onParticipantEnabledAudioTrack |
92 | 109 |
|
93 | | -```js |
94 | | -onParticipantEnabledVideoTrack: Function |
95 | | -``` |
| 110 | +Property | Type | Required | Default value | Description |
| 111 | +:--- | :--- | :--- | :--- | :--- |
| 112 | +trackIdentifier | shape(,) | no | | |
| 113 | +onFrameDimensionsChanged | func | no | | |
| 114 | +trackSid | string | no | | |
| 115 | +renderToHardwareTextureAndroid | string | no | | |
| 116 | +onLayout | string | no | | |
| 117 | +accessibilityLiveRegion | string | no | | |
| 118 | +accessibilityComponentType | string | no | | |
| 119 | +importantForAccessibility | string | no | | |
| 120 | +accessibilityLabel | string | no | | |
| 121 | +nativeID | string | no | | |
| 122 | +testID | string | no | | |
| 123 | +----- |
96 | 124 |
|
97 | | -Called when an audio track has been enabled. |
| 125 | +**src/TwilioVideoParticipantView.ios.js** |
98 | 126 |
|
99 | | -@param {{participant, track}} |
100 | 127 |
|
101 | | -#### onParticipantRemovedAudioTrack |
| 128 | +### 1. TwilioVideoParticipantView |
102 | 129 |
|
103 | | -```js |
104 | | -onParticipantRemovedAudioTrack: Function |
105 | | -``` |
106 | 130 |
|
107 | | -Called when a audio track has been removed |
108 | 131 |
|
109 | | -@param {{participant, track}} |
110 | 132 |
|
111 | | -#### onParticipantRemovedVideoTrack |
112 | | - |
113 | | -```js |
114 | | -onParticipantRemovedVideoTrack: Function |
115 | | -``` |
116 | | - |
117 | | -Called when a video track has been removed |
118 | | - |
119 | | -@param {{participant, track}} |
120 | | - |
121 | | -#### onRoomDidConnect |
122 | | - |
123 | | -```js |
124 | | -onRoomDidConnect: Function |
125 | | -``` |
126 | | - |
127 | | -Called when the room has connected |
128 | | - |
129 | | -@param {{roomName, participants}} |
130 | | - |
131 | | -#### onRoomDidDisconnect |
132 | | - |
133 | | -```js |
134 | | -onRoomDidDisconnect: Function |
135 | | -``` |
136 | | - |
137 | | -Called when the room has disconnected |
138 | | - |
139 | | -@param {{roomName, error}} |
140 | | - |
141 | | -#### onRoomDidFailToConnect |
142 | | - |
143 | | -```js |
144 | | -onRoomDidFailToConnect: Function |
145 | | -``` |
146 | | - |
147 | | -Called when connection with room failed |
148 | | - |
149 | | -@param {{roomName, error}} |
150 | | - |
151 | | -#### onRoomParticipantDidConnect |
152 | | - |
153 | | -```js |
154 | | -onRoomParticipantDidConnect: Function |
155 | | -``` |
156 | | - |
157 | | -Called when a new participant has connected |
158 | | - |
159 | | -@param {{roomName, participant}} |
160 | | - |
161 | | -#### onRoomParticipantDidDisconnect |
162 | | - |
163 | | -```js |
164 | | -onRoomParticipantDidDisconnect: Function |
165 | | -``` |
166 | | - |
167 | | -Called when a participant has disconnected |
168 | | - |
169 | | -@param {{roomName, participant}} |
170 | | - |
171 | | -#### setLocalVideoEnabled |
172 | | - |
173 | | -```js |
174 | | -setLocalVideoEnabled: Function |
175 | | -``` |
176 | | - |
177 | | -Called when a local video is disable / enabled, how to use it below |
178 | | - |
179 | | -```js |
180 | | -_onDisableCameraButtonPress = () => { |
181 | | - this.refs.twilioVideo |
182 | | - .setLocalVideoEnabled(!this.state.cameraDisabled) |
183 | | - .then(cameraDisabled => { |
184 | | - this.setState({ cameraDisabled }); |
185 | | - }); |
186 | | -}; |
187 | | - |
188 | | -``` |
189 | | - |
190 | | -#### setLocalAudioEnabled |
191 | | - |
192 | | -```js |
193 | | -setLocalAudioEnabled: Function |
194 | | -``` |
195 | | - |
196 | | -Called when a local audio is disable / enabled, how to use it below |
197 | | - |
198 | | -```js |
199 | | -_onMuteButtonPress = () => { |
200 | | - this.refs.twilioVideo |
201 | | - .setLocalAudioEnabled(!this.state.isAudioEnabled) |
202 | | - .then(isAudioEnabled => { |
203 | | - this.setState({ isAudioEnabled }); |
204 | | - }); |
205 | | -}; |
206 | | - |
207 | | - |
208 | | -``` |
209 | | - |
210 | | -<br><br> |
211 | | - |
212 | | -## TwilioVideoLocalView |
213 | | - |
214 | | -From [`../src/TwilioVideoLocalView.js`](../src/TwilioVideoLocalView.js) |
215 | | - |
216 | | -#### enabled |
217 | | - |
218 | | -```js |
219 | | -// Required |
220 | | -enabled: Boolean |
221 | | -``` |
222 | | - |
223 | | -Indicate if video feed is enabled. |
224 | | - |
225 | | -<br><br> |
226 | | - |
227 | | -## TwilioVideoParticipantView |
228 | | - |
229 | | -From [`../src/TwilioVideoParticipantView.js`](../src/TwilioVideoParticipantView.js) |
230 | | - |
231 | | -#### trackIdentifier |
232 | | - |
233 | | -```js |
234 | | -trackIdentifier: { |
235 | | - participantSid: String |
236 | | - videoTrackSid: String |
237 | | -} |
238 | | -``` |
239 | | - |
240 | | -<br><br> |
| 133 | +Property | Type | Required | Default value | Description |
| 134 | +:--- | :--- | :--- | :--- | :--- |
| 135 | +trackIdentifier | shape(,,) | no | | |
| 136 | +----- |
0 commit comments