@100mslive/react-native-hms 1.7.0 → 1.7.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/README.md +30 -39
- package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.7.1/gc.properties +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +16 -9
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +103 -104
- package/android/gradlew.bat +3 -18
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +27 -3
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +2 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +7 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +39 -10
- package/ios/HMSDecoder.swift +4 -3
- package/ios/HMSHelper.swift +6 -2
- package/ios/HMSManager.m +4 -0
- package/ios/HMSManager.swift +8 -0
- package/ios/HMSRNSDK.swift +54 -24
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js +2 -0
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraControl.js +3 -5
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +33 -34
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSEventEmitter.js +10 -0
- package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSManagerModule.js +18 -0
- package/lib/commonjs/classes/HMSManagerModule.js.map +1 -0
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventListener.js +13 -0
- package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -0
- package/lib/commonjs/classes/HMSPeersCache.js +3 -5
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +10 -5
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +79 -84
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +6 -7
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +4 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +8 -8
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +77 -0
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -0
- package/lib/commonjs/index.js +25 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js +2 -0
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSCameraControl.js +1 -4
- package/lib/module/classes/HMSCameraControl.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +31 -33
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSEventEmitter.js +3 -0
- package/lib/module/classes/HMSEventEmitter.js.map +1 -0
- package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSManagerModule.js +11 -0
- package/lib/module/classes/HMSManagerModule.js.map +1 -0
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSNativeEventListener.js +5 -0
- package/lib/module/classes/HMSNativeEventListener.js.map +1 -0
- package/lib/module/classes/HMSPeersCache.js +1 -4
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +8 -4
- package/lib/module/classes/HMSRoomCache.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +27 -32
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +2 -4
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HmsView.js +4 -1
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +8 -8
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/module/hooks/useHMSPeerUpdates.js +67 -0
- package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +2 -0
- package/lib/typescript/classes/HMSEventEmitter.d.ts +2 -0
- package/lib/typescript/classes/HMSLocalAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSLocalPeer.d.ts +3 -2
- package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSManagerModule.d.ts +3 -0
- package/lib/typescript/classes/HMSNativeEventListener.d.ts +4 -0
- package/lib/typescript/classes/HMSRemoteAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSRemotePeer.d.ts +3 -2
- package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSRoom.d.ts +1 -1
- package/lib/typescript/classes/HMSSDK.d.ts +2 -1
- package/lib/typescript/classes/HMSTrack.d.ts +3 -2
- package/lib/typescript/classes/HMSVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HmsView.d.ts +1 -1
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +1 -1
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +1 -1
- package/lib/typescript/hooks/useHMSPeerUpdates.d.ts +7 -0
- package/lib/typescript/index.d.ts +2 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSAudioTrack.ts +2 -1
- package/src/classes/HMSBrowserRecordingState.ts +3 -0
- package/src/classes/HMSCameraControl.ts +1 -2
- package/src/classes/HMSEncoder.ts +4 -5
- package/src/classes/HMSEventEmitter.ts +3 -0
- package/src/classes/HMSLocalAudioTrack.ts +2 -1
- package/src/classes/HMSLocalPeer.ts +3 -2
- package/src/classes/HMSLocalVideoTrack.ts +2 -1
- package/src/classes/HMSManagerModule.ts +18 -0
- package/src/classes/HMSNativeEventEmitter.ts +2 -1
- package/src/classes/HMSNativeEventListener.ts +8 -0
- package/src/classes/HMSPeersCache.ts +2 -3
- package/src/classes/HMSRemoteAudioTrack.ts +2 -1
- package/src/classes/HMSRemotePeer.ts +3 -2
- package/src/classes/HMSRemoteVideoTrack.ts +2 -1
- package/src/classes/HMSRoom.ts +1 -1
- package/src/classes/HMSRoomCache.ts +11 -3
- package/src/classes/HMSSDK.tsx +41 -43
- package/src/classes/HMSSessionStore.ts +6 -8
- package/src/classes/HMSTrack.ts +3 -2
- package/src/classes/HMSVideoTrack.ts +2 -1
- package/src/classes/HmsView.tsx +8 -2
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +36 -10
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +2 -3
- package/src/components/HMSHLSPlayer/hooks.ts +3 -2
- package/src/hooks/useHMSPeerUpdates.ts +85 -0
- package/src/index.ts +6 -0
- package/android/local.properties +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/yogesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/yogesh.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@ Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, an
|
|
|
20
20
|
|
|
21
21
|
With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
📖 Read the Complete Documentation here: https://www.100ms.live/docs/react-native/v2/foundation/basics
|
|
25
24
|
|
|
26
25
|
## 🏃 Example App
|
|
@@ -29,8 +28,7 @@ With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (
|
|
|
29
28
|
|
|
30
29
|
🤖 Download the Example Android app here: https://appdistribution.firebase.dev/i/7b7ab3b30e627c35
|
|
31
30
|
|
|
32
|
-
To get a better understanding of how the example app is structured, what to do on `onJoin`, `onTrack` and `onPeer` listeners, creating `PeerTrackNodes`, how to use Redux, and what type of layouts and sorting you can implement in your app, checkout [Example App's README](https://github.com/100mslive/react-native-hms/blob/develop/example/README.md)
|
|
33
|
-
|
|
31
|
+
To get a better understanding of how the example app is structured, what to do on `onJoin`, `onTrack` and `onPeer` listeners, creating `PeerTrackNodes`, how to use Redux, and what type of layouts and sorting you can implement in your app, checkout [Example App's README](https://github.com/100mslive/react-native-hms/blob/develop/packages/react-native-hms/example/README.md)
|
|
34
32
|
|
|
35
33
|
To run the Example app on your system, follow these steps -
|
|
36
34
|
|
|
@@ -42,7 +40,6 @@ To run the Example app on your system, follow these steps -
|
|
|
42
40
|
|
|
43
41
|
Troubleshooting Guide for resolving issues in running the Example app is [available here](https://www.100ms.live/docs/react-native/v2/guides/faq#run-the-example-app).
|
|
44
42
|
|
|
45
|
-
|
|
46
43
|
## ☝️ Minimum Configuration
|
|
47
44
|
|
|
48
45
|
- Support for React Native 0.64.4 or above
|
|
@@ -51,22 +48,21 @@ Troubleshooting Guide for resolving issues in running the Example app is [availa
|
|
|
51
48
|
- Xcode 13 or above
|
|
52
49
|
- Support for iOS 12 or above
|
|
53
50
|
|
|
54
|
-
|
|
55
51
|
## 🤝 Recommended Configuration
|
|
56
52
|
|
|
57
53
|
- React Native 0.68.0 or above
|
|
58
54
|
- Java 11 or above
|
|
59
|
-
- Android API level
|
|
55
|
+
- Android API level 33 or above
|
|
60
56
|
- Xcode 14 or above
|
|
61
57
|
- iOS 16 or above
|
|
62
58
|
|
|
63
59
|
## 📱 Supported Devices
|
|
64
60
|
|
|
65
61
|
- The Android SDK supports Android API level 21 and higher. It is built for armeabi-v7a, arm64-v8a, x86, and x86_64 architectures.
|
|
66
|
-
Devices running Android OS 11 or above is recommended.
|
|
62
|
+
Devices running Android OS 11 or above is recommended.
|
|
67
63
|
|
|
68
64
|
- iPhone & iPads with iOS version 12 or above are supported.
|
|
69
|
-
Devices running iOS 16 or above is recommended.
|
|
65
|
+
Devices running iOS 16 or above is recommended.
|
|
70
66
|
|
|
71
67
|
## Installation
|
|
72
68
|
|
|
@@ -118,10 +114,8 @@ We suggest using [react-native-permission](https://www.npmjs.com/package/react-n
|
|
|
118
114
|
|
|
119
115
|
More information about Audio Video Permission on iOS & Android is [available here](https://www.100ms.live/docs/react-native/v2/features/integration#permissions).
|
|
120
116
|
|
|
121
|
-
|
|
122
117
|
## [QuickStart](https://www.100ms.live/docs/react-native/v2/guides/quickstart)
|
|
123
118
|
|
|
124
|
-
|
|
125
119
|
The package exports all the classes and a HMSSDK class that manages everything.
|
|
126
120
|
|
|
127
121
|
## [Setting up the HMS Instance](https://www.100ms.live/docs/react-native/v2/how--to-guides/install-the-sdk/hmssdk)
|
|
@@ -149,10 +143,11 @@ We can get the authentication token using room-code from meeting URL.
|
|
|
149
143
|
Let's understand the subdomain and code from the sample URL
|
|
150
144
|
|
|
151
145
|
In this sample url: `http://100ms-rocks.app.100ms.live/meeting/abc-defg-hij`
|
|
152
|
-
- Subdomain is `100ms-rocks`
|
|
153
|
-
- Room code is `abc-defg-hij`
|
|
154
146
|
|
|
155
|
-
|
|
147
|
+
- Subdomain is `100ms-rocks`
|
|
148
|
+
- Room code is `abc-defg-hij`
|
|
149
|
+
|
|
150
|
+
Now to get the room-code from meeting URL, we can write our own logic or use the `getCode` method from [here](https://github.com/100mslive/react-native-hms/blob/main/packages/react-native-hms/example/src/utils/getRoomLinkDetails.ts)
|
|
156
151
|
|
|
157
152
|
To generate token we will be using `getAuthTokenByRoomCode` method available on `HMSSDK` instance. This method has `roomCode` as a required
|
|
158
153
|
parameter and `userId` & `endpoint` as optional parameter.
|
|
@@ -169,7 +164,10 @@ const token = await hmsInstance.getAuthTokenByRoomCode('YOUR_ROOM_CODE');
|
|
|
169
164
|
/**
|
|
170
165
|
* Create `HMSConfig` with the above auth token and username
|
|
171
166
|
*/
|
|
172
|
-
const hmsConfig = new HMSConfig({
|
|
167
|
+
const hmsConfig = new HMSConfig({
|
|
168
|
+
authToken: token,
|
|
169
|
+
username: 'John Appleseed',
|
|
170
|
+
});
|
|
173
171
|
```
|
|
174
172
|
|
|
175
173
|
### Get temporary token from dashboard
|
|
@@ -180,8 +178,7 @@ To test audio/video functionality, you need to connect to a 100ms Room. Please c
|
|
|
180
178
|
2. Use the `Video Conferencing Starter Kit` to create a room with a default template assigned to it to test this app quickly.
|
|
181
179
|
3. Go to the [Rooms page](https://dashboard.100ms.live/rooms) in your dashboard, click on the `Room Id` of the room you created above, and click on the `Join Room` button on the top right.
|
|
182
180
|
4. You will see 100ms demo URLs for the roles created when you deployed the starter kit; you can click on the 'key' icon to copy the token and update the `AUTH_TOKEN` variable in "App.js" file.
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
> Token from 100ms dashboard is for testing purposes only, For production applications you must generate tokens on your own server. Refer to the [Management Token section](/concepts/v2/concepts/security-and-tokens#management-token) in Authentication and Tokens guide for more information.
|
|
185
182
|
|
|
186
183
|
## [Add Event Listeners](https://www.100ms.live/docs/react-native/v2/features/event-listeners)
|
|
187
184
|
|
|
@@ -197,13 +194,12 @@ const hmsInstance = await HMSSDK.build();
|
|
|
197
194
|
// instance acquired from build() method
|
|
198
195
|
hmsInstance.addEventListener(
|
|
199
196
|
HMSUpdateListenerActions.ON_JOIN,
|
|
200
|
-
joinSuccess
|
|
197
|
+
joinSuccess // function that will be called Joining a Room is successful
|
|
201
198
|
);
|
|
202
199
|
```
|
|
203
200
|
|
|
204
201
|
The detailed QuickStart Guide is [available here](https://www.100ms.live/docs/react-native/v2/guides/quickstart).
|
|
205
202
|
|
|
206
|
-
|
|
207
203
|
## [Join the Room](https://www.100ms.live/docs/react-native/v2/features/join)
|
|
208
204
|
|
|
209
205
|
To interact with _peers_ in audio or video call, the user needs to **Join** a **Room**.
|
|
@@ -220,7 +216,6 @@ Additionally, you can also pass these fields while Joining a Room -
|
|
|
220
216
|
|
|
221
217
|
2. Peer Metadata - This can be used to pass any additional metadata associated with the user using `metadata` of `HMSConfig` object. For Eg: user-id mapping at the application side. More information is [available here](https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata).
|
|
222
218
|
|
|
223
|
-
|
|
224
219
|
NOTE: `ON_JOIN` Event Listener must be **attached** before calling `join` function to receive the event callback.
|
|
225
220
|
|
|
226
221
|
```ts
|
|
@@ -232,16 +227,21 @@ const token = await hmsInstance.getAuthTokenByRoomCode('abc-defg-hij'); // Sampl
|
|
|
232
227
|
|
|
233
228
|
// You'll need to add Event Listeners for HMSUpdateListenerActions, which are invoked to notify about updates happening in the room like a peer joins/leaves, a track got muted/unmuted, any errors that occur, etc.
|
|
234
229
|
hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, onJoinSuccess);
|
|
235
|
-
hmsInstance.addEventListener(
|
|
236
|
-
|
|
230
|
+
hmsInstance.addEventListener(
|
|
231
|
+
HMSUpdateListenerActions.ON_PEER_UPDATE,
|
|
232
|
+
onPeerUpdate
|
|
233
|
+
);
|
|
234
|
+
hmsInstance.addEventListener(
|
|
235
|
+
HMSUpdateListenerActions.ON_TRACK_UPDATE,
|
|
236
|
+
onTrackUpdate
|
|
237
|
+
);
|
|
237
238
|
hmsInstance.addEventListener(HMSUpdateListenerActions.ON_ERROR, onError);
|
|
238
239
|
|
|
239
|
-
|
|
240
240
|
// Next, create an object of HMSConfig class using the available joining configurations.
|
|
241
241
|
let config = new HMSConfig({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
authToken: token, // client-side token generated by `getAuthTokenByRoomCode` method
|
|
243
|
+
username: 'John Appleseed',
|
|
244
|
+
});
|
|
245
245
|
|
|
246
246
|
// Now, we are primed to join the room. All you have to do is calling join by passing the config object
|
|
247
247
|
hmsInstance.join(config);
|
|
@@ -249,7 +249,6 @@ hmsInstance.join(config);
|
|
|
249
249
|
|
|
250
250
|
More information about Joining a Room is [available here](https://www.100ms.live/docs/react-native/v2/features/join).
|
|
251
251
|
|
|
252
|
-
|
|
253
252
|
## Basic Mechanism of using 100ms APIs
|
|
254
253
|
|
|
255
254
|
For invoking any actions simply use the `HMSSDK` instance created in above steps. Few common examples of using it are as follows -
|
|
@@ -287,11 +286,7 @@ We can also optionally pass props like `key`, `scaleType`, `mirror` to customize
|
|
|
287
286
|
// get HmsView from the HMSSDK instance created earlier
|
|
288
287
|
const HmsView = hmsInstance.HmsView;
|
|
289
288
|
|
|
290
|
-
<HmsView
|
|
291
|
-
trackId={videoTrackId}
|
|
292
|
-
key={videoTrackId}
|
|
293
|
-
style={styles.hmsView}
|
|
294
|
-
/>
|
|
289
|
+
<HmsView trackId={videoTrackId} key={videoTrackId} style={styles.hmsView} />;
|
|
295
290
|
|
|
296
291
|
const styles = StyleSheet.create({
|
|
297
292
|
hmsView: {
|
|
@@ -305,7 +300,7 @@ const styles = StyleSheet.create({
|
|
|
305
300
|
|
|
306
301
|
- It's recommended to always pass the `key` property while creating `HmsView`. If a null or undefined `trackId` is passed in `HmsView` you will have to unmount and remount with the new `trackId`. Using the `key` prop and passing `trackId` to it automatically achieves this.
|
|
307
302
|
|
|
308
|
-
- `HmsView` component requires
|
|
303
|
+
- `HmsView` component requires `width` and `height` in `style` prop to set bounds of the tile that will show the video stream.
|
|
309
304
|
|
|
310
305
|
- Once the requirement of that `HmsView` is finished it should **ALWAYS** be disposed.
|
|
311
306
|
|
|
@@ -313,7 +308,6 @@ const styles = StyleSheet.create({
|
|
|
313
308
|
|
|
314
309
|
More information about Rendering Videos is [available here](https://www.100ms.live/docs/react-native/v2/features/render-video).
|
|
315
310
|
|
|
316
|
-
|
|
317
311
|
## [Using Track Updates to display Videos](https://www.100ms.live/docs/react-native/v2/features/render-video)
|
|
318
312
|
|
|
319
313
|
Always use ON_PEER_UPDATE and ON_TRACK_UPDATE listeners, these listeners get updated localPeer and remotePeers whenever there is any event related to these values.
|
|
@@ -355,13 +349,10 @@ hmsInstance.addEventListener(
|
|
|
355
349
|
|
|
356
350
|
More information about Rendering Videos is [available here](https://www.100ms.live/docs/react-native/v2/features/render-video).
|
|
357
351
|
|
|
352
|
+
### 🚂 [Example Implementations](https://github.com/100mslive/react-native-hms/tree/main/packages/react-native-hms/example)
|
|
358
353
|
|
|
354
|
+
In the [100ms Example App](https://github.com/100mslive/react-native-hms/tree/main/packages/react-native-hms/example) we have shown how to set up the various listeners, what data to store in Redux and what all features you can implement.
|
|
359
355
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
In the [100ms Example App](https://github.com/100mslive/react-native-hms/tree/main/example) we have shown how to set up the various listeners, what data to store in Redux and what all features you can implement.
|
|
363
|
-
|
|
364
|
-
We have also implemented multiple views which are commonly used. Checkout the [videos & relevant code in the Example app](https://github.com/100mslive/react-native-hms/tree/main/example#additional-features).
|
|
365
|
-
|
|
356
|
+
We have also implemented multiple views which are commonly used. Checkout the [videos & relevant code in the Example app](https://github.com/100mslive/react-native-hms/tree/main/packages/react-native-hms/example#additional-features).
|
|
366
357
|
|
|
367
358
|
📖 Read the Complete Documentation here: https://www.100ms.live/docs/react-native/v2/foundation/basics
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -3,9 +3,18 @@ import groovy.json.JsonSlurper
|
|
|
3
3
|
def sdkVersions = new JsonSlurper().parse file("../sdk-versions.json")
|
|
4
4
|
|
|
5
5
|
buildscript {
|
|
6
|
-
|
|
7
|
-
ext.
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
ext.safeExtGet = { prop, fallback ->
|
|
8
|
+
rootProject.ext.has(prop) ? rootProject.ext.get (prop) : fallback
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
ext.getKotlinVersion = {
|
|
12
|
+
if (ext.has("kotlinVersion")) {
|
|
13
|
+
ext.kotlinVersion()
|
|
14
|
+
} else {
|
|
15
|
+
ext.safeExtGet("kotlinVersion", "1.6.0")
|
|
16
|
+
}
|
|
17
|
+
}
|
|
9
18
|
if (project == rootProject) {
|
|
10
19
|
repositories {
|
|
11
20
|
google()
|
|
@@ -21,7 +30,7 @@ buildscript {
|
|
|
21
30
|
mavenCentral()
|
|
22
31
|
}
|
|
23
32
|
dependencies {
|
|
24
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$
|
|
33
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}"
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -71,15 +80,13 @@ dependencies {
|
|
|
71
80
|
//noinspection GradleDynamicVersion
|
|
72
81
|
implementation "com.facebook.react:react-native:+"
|
|
73
82
|
implementation "com.google.code.gson:gson:2.9.0"
|
|
74
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$
|
|
75
|
-
implementation "androidx.core:core-ktx
|
|
76
|
-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core
|
|
83
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:${getKotlinVersion()}"
|
|
84
|
+
implementation "androidx.core:core-ktx:1.6.0"
|
|
85
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
|
|
77
86
|
implementation "androidx.constraintlayout:constraintlayout:2.1.3"
|
|
78
87
|
implementation "androidx.appcompat:appcompat:1.3.1"
|
|
79
88
|
|
|
80
|
-
// 100ms
|
|
81
89
|
implementation "live.100ms:android-sdk:${sdkVersions["android"]}"
|
|
82
90
|
implementation "live.100ms:video-view:${sdkVersions["android"]}"
|
|
83
91
|
implementation "live.100ms:hls-player:${sdkVersions["android"]}"
|
|
84
|
-
implementation "live.100ms:hls-player-stats:${sdkVersions["android"]}"
|
|
85
92
|
}
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
package/android/gradlew
CHANGED
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
# Resolve links: $0 may be a link
|
|
27
27
|
PRG="$0"
|
|
28
28
|
# Need this for relative symlinks.
|
|
29
|
-
while [ -h "$PRG" ]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
while [ -h "$PRG" ]; do
|
|
30
|
+
ls=$(ls -ld "$PRG")
|
|
31
|
+
link=$(expr "$ls" : '.*-> \(.*\)$')
|
|
32
|
+
if expr "$link" : '/.*' >/dev/null; then
|
|
33
|
+
PRG="$link"
|
|
34
|
+
else
|
|
35
|
+
PRG=$(dirname "$PRG")"/$link"
|
|
36
|
+
fi
|
|
37
37
|
done
|
|
38
|
-
SAVED="
|
|
39
|
-
cd "
|
|
40
|
-
APP_HOME="
|
|
38
|
+
SAVED="$(pwd)"
|
|
39
|
+
cd "$(dirname \"$PRG\")/" >/dev/null
|
|
40
|
+
APP_HOME="$(pwd -P)"
|
|
41
41
|
cd "$SAVED" >/dev/null
|
|
42
42
|
|
|
43
43
|
APP_NAME="Gradle"
|
|
44
|
-
APP_BASE_NAME
|
|
44
|
+
APP_BASE_NAME=$(basename "$0")
|
|
45
45
|
|
|
46
46
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
47
47
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
@@ -49,15 +49,15 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
|
49
49
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
50
50
|
MAX_FD="maximum"
|
|
51
51
|
|
|
52
|
-
warn
|
|
53
|
-
|
|
52
|
+
warn() {
|
|
53
|
+
echo "$*"
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
die
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
die() {
|
|
57
|
+
echo
|
|
58
|
+
echo "$*"
|
|
59
|
+
echo
|
|
60
|
+
exit 1
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
# OS specific support (must be 'true' or 'false').
|
|
@@ -65,119 +65,118 @@ cygwin=false
|
|
|
65
65
|
msys=false
|
|
66
66
|
darwin=false
|
|
67
67
|
nonstop=false
|
|
68
|
-
case "
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
case "$(uname)" in
|
|
69
|
+
CYGWIN*)
|
|
70
|
+
cygwin=true
|
|
71
|
+
;;
|
|
72
|
+
Darwin*)
|
|
73
|
+
darwin=true
|
|
74
|
+
;;
|
|
75
|
+
MINGW*)
|
|
76
|
+
msys=true
|
|
77
|
+
;;
|
|
78
|
+
NONSTOP*)
|
|
79
|
+
nonstop=true
|
|
80
|
+
;;
|
|
81
81
|
esac
|
|
82
82
|
|
|
83
83
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
84
84
|
|
|
85
|
-
|
|
86
85
|
# Determine the Java command to use to start the JVM.
|
|
87
|
-
if [ -n "$JAVA_HOME" ]
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
if [ -n "$JAVA_HOME" ]; then
|
|
87
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
|
88
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
89
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
90
|
+
else
|
|
91
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
92
|
+
fi
|
|
93
|
+
if [ ! -x "$JAVACMD" ]; then
|
|
94
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
96
95
|
|
|
97
96
|
Please set the JAVA_HOME variable in your environment to match the
|
|
98
97
|
location of your Java installation."
|
|
99
|
-
|
|
98
|
+
fi
|
|
100
99
|
else
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
JAVACMD="java"
|
|
101
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
103
102
|
|
|
104
103
|
Please set the JAVA_HOME variable in your environment to match the
|
|
105
104
|
location of your Java installation."
|
|
106
105
|
fi
|
|
107
106
|
|
|
108
107
|
# Increase the maximum file descriptors if we can.
|
|
109
|
-
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
fi
|
|
115
|
-
ulimit -n $MAX_FD
|
|
116
|
-
if [ $? -ne 0 ] ; then
|
|
117
|
-
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
118
|
-
fi
|
|
119
|
-
else
|
|
120
|
-
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
108
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
|
|
109
|
+
MAX_FD_LIMIT=$(ulimit -H -n)
|
|
110
|
+
if [ $? -eq 0 ]; then
|
|
111
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
|
|
112
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
121
113
|
fi
|
|
114
|
+
ulimit -n $MAX_FD
|
|
115
|
+
if [ $? -ne 0 ]; then
|
|
116
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
117
|
+
fi
|
|
118
|
+
else
|
|
119
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
120
|
+
fi
|
|
122
121
|
fi
|
|
123
122
|
|
|
124
123
|
# For Darwin, add options to specify how the application appears in the dock
|
|
125
124
|
if $darwin; then
|
|
126
|
-
|
|
125
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
127
126
|
fi
|
|
128
127
|
|
|
129
128
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
130
|
-
if [ "$cygwin" = "true" -o "$msys" = "true" ]
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
129
|
+
if [ "$cygwin" = "true" -o "$msys" = "true" ]; then
|
|
130
|
+
APP_HOME=$(cygpath --path --mixed "$APP_HOME")
|
|
131
|
+
CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
|
|
132
|
+
|
|
133
|
+
JAVACMD=$(cygpath --unix "$JAVACMD")
|
|
134
|
+
|
|
135
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
136
|
+
ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
|
|
137
|
+
SEP=""
|
|
138
|
+
for dir in $ROOTDIRSRAW; do
|
|
139
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
140
|
+
SEP="|"
|
|
141
|
+
done
|
|
142
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
143
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
144
|
+
if [ "$GRADLE_CYGPATTERN" != "" ]; then
|
|
145
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
146
|
+
fi
|
|
147
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
148
|
+
i=0
|
|
149
|
+
for arg in "$@"; do
|
|
150
|
+
CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
|
|
151
|
+
CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
|
|
152
|
+
|
|
153
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
|
|
154
|
+
eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
|
|
155
|
+
else
|
|
156
|
+
eval $(echo args$i)="\"$arg\""
|
|
147
157
|
fi
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
0) set -- ;;
|
|
163
|
-
1) set -- "$args0" ;;
|
|
164
|
-
2) set -- "$args0" "$args1" ;;
|
|
165
|
-
3) set -- "$args0" "$args1" "$args2" ;;
|
|
166
|
-
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
167
|
-
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
168
|
-
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
169
|
-
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
170
|
-
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
171
|
-
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
172
|
-
esac
|
|
158
|
+
i=$(expr $i + 1)
|
|
159
|
+
done
|
|
160
|
+
case $i in
|
|
161
|
+
0) set -- ;;
|
|
162
|
+
1) set -- "$args0" ;;
|
|
163
|
+
2) set -- "$args0" "$args1" ;;
|
|
164
|
+
3) set -- "$args0" "$args1" "$args2" ;;
|
|
165
|
+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
166
|
+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
167
|
+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
168
|
+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
169
|
+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
170
|
+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
171
|
+
esac
|
|
173
172
|
fi
|
|
174
173
|
|
|
175
174
|
# Escape application args
|
|
176
|
-
save
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
save() {
|
|
176
|
+
for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
|
|
177
|
+
echo " "
|
|
179
178
|
}
|
|
180
|
-
APP_ARGS
|
|
179
|
+
APP_ARGS=$(save "$@")
|
|
181
180
|
|
|
182
181
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
183
182
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
package/android/gradlew.bat
CHANGED
|
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|
|
40
40
|
|
|
41
41
|
set JAVA_EXE=java.exe
|
|
42
42
|
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
-
if "%ERRORLEVEL%" == "0" goto
|
|
43
|
+
if "%ERRORLEVEL%" == "0" goto execute
|
|
44
44
|
|
|
45
45
|
echo.
|
|
46
46
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
@@ -54,7 +54,7 @@ goto fail
|
|
|
54
54
|
set JAVA_HOME=%JAVA_HOME:"=%
|
|
55
55
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
56
56
|
|
|
57
|
-
if exist "%JAVA_EXE%" goto
|
|
57
|
+
if exist "%JAVA_EXE%" goto execute
|
|
58
58
|
|
|
59
59
|
echo.
|
|
60
60
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
@@ -64,21 +64,6 @@ echo location of your Java installation.
|
|
|
64
64
|
|
|
65
65
|
goto fail
|
|
66
66
|
|
|
67
|
-
:init
|
|
68
|
-
@rem Get command-line arguments, handling Windows variants
|
|
69
|
-
|
|
70
|
-
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
71
|
-
|
|
72
|
-
:win9xME_args
|
|
73
|
-
@rem Slurp the command line arguments.
|
|
74
|
-
set CMD_LINE_ARGS=
|
|
75
|
-
set _SKIP=2
|
|
76
|
-
|
|
77
|
-
:win9xME_args_slurp
|
|
78
|
-
if "x%~1" == "x" goto execute
|
|
79
|
-
|
|
80
|
-
set CMD_LINE_ARGS=%*
|
|
81
|
-
|
|
82
67
|
:execute
|
|
83
68
|
@rem Setup the command line
|
|
84
69
|
|
|
@@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
|
86
71
|
|
|
87
72
|
|
|
88
73
|
@rem Execute Gradle
|
|
89
|
-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain
|
|
74
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
90
75
|
|
|
91
76
|
:end
|
|
92
77
|
@rem End local scope for the variables with windows NT shell
|