@@ -71,9 +71,9 @@ class ScreencastOptions : Record {
71
71
val maxBandwidthInt: Int = 0
72
72
}
73
73
74
- class MembraneWebRTCModule : Module () {
74
+ class RNFishjamClientModule : Module () {
75
75
override fun definition () = ModuleDefinition {
76
- Name (" MembraneWebRTC " )
76
+ Name (" RNFishjamClient " )
77
77
78
78
Events (
79
79
" IsCameraOn" ,
@@ -86,204 +86,204 @@ class MembraneWebRTCModule : Module() {
86
86
" BandwidthEstimation"
87
87
)
88
88
89
- val membraneWebRTC = MembraneWebRTC { name: String , data: Map <String , Any ?> ->
89
+ val rnFishjamClient = RNFishjamClient { name: String , data: Map <String , Any ?> ->
90
90
sendEvent(name, data)
91
91
}
92
92
93
93
OnCreate {
94
- membraneWebRTC .onModuleCreate(appContext)
94
+ rnFishjamClient .onModuleCreate(appContext)
95
95
}
96
96
97
97
OnDestroy {
98
- membraneWebRTC .onModuleDestroy()
98
+ rnFishjamClient .onModuleDestroy()
99
99
}
100
100
101
101
OnActivityDestroys {
102
- membraneWebRTC .cleanUp()
102
+ rnFishjamClient .cleanUp()
103
103
}
104
104
105
105
OnActivityResult { _, result ->
106
- membraneWebRTC .onActivityResult(result.requestCode, result.resultCode, result.data)
106
+ rnFishjamClient .onActivityResult(result.requestCode, result.resultCode, result.data)
107
107
}
108
108
109
109
AsyncFunction (" connect" ) { url: String , peerToken: String , promise: Promise ->
110
110
CoroutineScope (Dispatchers .Main ).launch {
111
- membraneWebRTC .create()
112
- membraneWebRTC .connect(url, peerToken, promise)
111
+ rnFishjamClient .create()
112
+ rnFishjamClient .connect(url, peerToken, promise)
113
113
}
114
114
}
115
115
116
116
AsyncFunction (" joinRoom" ) { peerMetadata: Map <String , Any >, promise: Promise ->
117
117
CoroutineScope (Dispatchers .Main ).launch {
118
- membraneWebRTC .joinRoom(peerMetadata, promise)
118
+ rnFishjamClient .joinRoom(peerMetadata, promise)
119
119
}
120
120
}
121
121
122
- AsyncFunction (" leaveRoom" ) { ->
122
+ AsyncFunction (" leaveRoom" ) { ->
123
123
CoroutineScope (Dispatchers .Main ).launch {
124
- membraneWebRTC .leaveRoom()
124
+ rnFishjamClient .leaveRoom()
125
125
}
126
126
}
127
127
128
128
AsyncFunction (" cleanUp" ) Coroutine { ->
129
129
withContext(Dispatchers .Main ) {
130
- membraneWebRTC .cleanUp()
130
+ rnFishjamClient .cleanUp()
131
131
}
132
132
}
133
133
134
134
135
135
AsyncFunction (" startCamera" ) Coroutine { config: CameraConfig ->
136
136
withContext(Dispatchers .Main ) {
137
- membraneWebRTC .startCamera(config)
137
+ rnFishjamClient .startCamera(config)
138
138
}
139
139
}
140
140
141
141
AsyncFunction (" startMicrophone" ) Coroutine { config: MicrophoneConfig ->
142
142
withContext(Dispatchers .Main ) {
143
- membraneWebRTC .startMicrophone(config)
143
+ rnFishjamClient .startMicrophone(config)
144
144
}
145
145
}
146
146
147
147
Property (" isMicrophoneOn" ) {
148
- return @Property membraneWebRTC .isMicrophoneOn
148
+ return @Property rnFishjamClient .isMicrophoneOn
149
149
}
150
150
151
151
AsyncFunction (" toggleMicrophone" ) Coroutine { ->
152
152
withContext(Dispatchers .Main ) {
153
- membraneWebRTC .toggleMicrophone()
153
+ rnFishjamClient .toggleMicrophone()
154
154
}
155
155
}
156
156
157
157
Property (" isCameraOn" ) {
158
- return @Property membraneWebRTC .isCameraOn
158
+ return @Property rnFishjamClient .isCameraOn
159
159
}
160
160
161
161
AsyncFunction (" toggleCamera" ) Coroutine { ->
162
162
withContext(Dispatchers .Main ) {
163
- membraneWebRTC .toggleCamera()
163
+ rnFishjamClient .toggleCamera()
164
164
}
165
165
}
166
166
167
167
AsyncFunction (" flipCamera" ) Coroutine { ->
168
168
withContext(Dispatchers .Main ) {
169
- membraneWebRTC .flipCamera()
169
+ rnFishjamClient .flipCamera()
170
170
}
171
171
}
172
172
173
173
AsyncFunction (" switchCamera" ) Coroutine { captureDeviceId: String ->
174
174
withContext(Dispatchers .Main ) {
175
- membraneWebRTC .switchCamera(captureDeviceId)
175
+ rnFishjamClient .switchCamera(captureDeviceId)
176
176
}
177
177
}
178
178
179
179
AsyncFunction (" getCaptureDevices" ) Coroutine { ->
180
180
withContext(Dispatchers .Main ) {
181
- membraneWebRTC .getCaptureDevices()
181
+ rnFishjamClient .getCaptureDevices()
182
182
}
183
183
}
184
184
185
185
AsyncFunction (" toggleScreencast" ) { screencastOptions: ScreencastOptions , promise: Promise ->
186
186
CoroutineScope (Dispatchers .Main ).launch {
187
- membraneWebRTC .toggleScreencast(screencastOptions, promise)
187
+ rnFishjamClient .toggleScreencast(screencastOptions, promise)
188
188
}
189
189
}
190
190
191
191
Property (" isScreencastOn" ) {
192
- return @Property membraneWebRTC .isScreencastOn
192
+ return @Property rnFishjamClient .isScreencastOn
193
193
}
194
194
195
195
AsyncFunction (" getEndpoints" ) Coroutine { ->
196
196
withContext(Dispatchers .Main ) {
197
- membraneWebRTC .getEndpoints()
197
+ rnFishjamClient .getEndpoints()
198
198
}
199
199
}
200
200
201
201
AsyncFunction (" updateEndpointMetadata" ) Coroutine { metadata: Map <String , Any > ->
202
202
withContext(Dispatchers .Main ) {
203
- membraneWebRTC .updateEndpointMetadata(metadata)
203
+ rnFishjamClient .updateEndpointMetadata(metadata)
204
204
}
205
205
}
206
206
207
207
AsyncFunction (" updateVideoTrackMetadata" ) Coroutine { metadata: Map <String , Any > ->
208
208
withContext(Dispatchers .Main ) {
209
- membraneWebRTC .updateLocalVideoTrackMetadata(metadata)
209
+ rnFishjamClient .updateLocalVideoTrackMetadata(metadata)
210
210
}
211
211
}
212
212
213
213
AsyncFunction (" updateAudioTrackMetadata" ) Coroutine { metadata: Map <String , Any > ->
214
214
withContext(Dispatchers .Main ) {
215
- membraneWebRTC .updateLocalAudioTrackMetadata(metadata)
215
+ rnFishjamClient .updateLocalAudioTrackMetadata(metadata)
216
216
}
217
217
}
218
218
219
219
AsyncFunction (" updateScreencastTrackMetadata" ) Coroutine { metadata: Map <String , Any > ->
220
220
withContext(Dispatchers .Main ) {
221
- membraneWebRTC .updateLocalScreencastTrackMetadata(metadata)
221
+ rnFishjamClient .updateLocalScreencastTrackMetadata(metadata)
222
222
}
223
223
}
224
224
225
225
AsyncFunction (" setOutputAudioDevice" ) { audioDevice: String ->
226
- membraneWebRTC .setOutputAudioDevice(audioDevice)
226
+ rnFishjamClient .setOutputAudioDevice(audioDevice)
227
227
}
228
228
229
229
AsyncFunction (" startAudioSwitcher" ) {
230
- membraneWebRTC .startAudioSwitcher()
230
+ rnFishjamClient .startAudioSwitcher()
231
231
}
232
232
233
233
AsyncFunction (" stopAudioSwitcher" ) {
234
- membraneWebRTC .stopAudioSwitcher()
234
+ rnFishjamClient .stopAudioSwitcher()
235
235
}
236
236
237
237
AsyncFunction (" toggleScreencastTrackEncoding" ) Coroutine { encoding: String ->
238
238
withContext(Dispatchers .Main ) {
239
- membraneWebRTC .toggleScreencastTrackEncoding(encoding)
239
+ rnFishjamClient .toggleScreencastTrackEncoding(encoding)
240
240
}
241
241
}
242
242
243
243
AsyncFunction (" setScreencastTrackBandwidth" ) Coroutine { bandwidth: Int ->
244
244
withContext(Dispatchers .Main ) {
245
- membraneWebRTC .setScreencastTrackBandwidth(bandwidth)
245
+ rnFishjamClient .setScreencastTrackBandwidth(bandwidth)
246
246
}
247
247
}
248
248
249
249
AsyncFunction (" setScreencastTrackEncodingBandwidth" ) Coroutine { encoding: String , bandwidth: Int ->
250
250
withContext(Dispatchers .Main ) {
251
- membraneWebRTC .setScreencastTrackEncodingBandwidth(encoding, bandwidth)
251
+ rnFishjamClient .setScreencastTrackEncodingBandwidth(encoding, bandwidth)
252
252
}
253
253
}
254
254
255
255
AsyncFunction (" setTargetTrackEncoding" ) Coroutine { trackId: String , encoding: String ->
256
256
withContext(Dispatchers .Main ) {
257
- membraneWebRTC .setTargetTrackEncoding(trackId, encoding)
257
+ rnFishjamClient .setTargetTrackEncoding(trackId, encoding)
258
258
}
259
259
}
260
260
261
261
AsyncFunction (" toggleVideoTrackEncoding" ) Coroutine { encoding: String ->
262
262
withContext(Dispatchers .Main ) {
263
- membraneWebRTC .toggleVideoTrackEncoding(encoding)
263
+ rnFishjamClient .toggleVideoTrackEncoding(encoding)
264
264
}
265
265
}
266
266
267
267
AsyncFunction (" setVideoTrackEncodingBandwidth" ) Coroutine { encoding: String , bandwidth: Int ->
268
268
withContext(Dispatchers .Main ) {
269
- membraneWebRTC .setVideoTrackEncodingBandwidth(encoding, bandwidth)
269
+ rnFishjamClient .setVideoTrackEncodingBandwidth(encoding, bandwidth)
270
270
}
271
271
}
272
272
273
273
AsyncFunction (" setVideoTrackBandwidth" ) Coroutine { bandwidth: Int ->
274
274
withContext(Dispatchers .Main ) {
275
- membraneWebRTC .setVideoTrackBandwidth(bandwidth)
275
+ rnFishjamClient .setVideoTrackBandwidth(bandwidth)
276
276
}
277
277
}
278
278
279
279
AsyncFunction (" changeWebRTCLoggingSeverity" ) Coroutine { severity: String ->
280
280
CoroutineScope (Dispatchers .Main ).launch {
281
- membraneWebRTC .changeWebRTCLoggingSeverity(severity)
281
+ rnFishjamClient .changeWebRTCLoggingSeverity(severity)
282
282
}
283
283
}
284
284
285
285
AsyncFunction (" getStatistics" ) { ->
286
- membraneWebRTC .getStatistics()
286
+ rnFishjamClient .getStatistics()
287
287
}
288
288
}
289
289
}
0 commit comments