@livekit/react-native 1.4.1 → 1.4.3
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 +24 -5
- package/ios/LivekitReactNative.h +1 -0
- package/ios/LivekitReactNative.m +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ Once the `@livekit/react-native-webrtc` dependency is installed, one last step i
|
|
|
37
37
|
|
|
38
38
|
In your [MainApplication.java](https://github.com/livekit/client-sdk-react-native/blob/main/example/android/app/src/main/java/com/example/livekitreactnative/MainApplication.java) file:
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
#### Java
|
|
41
|
+
```java
|
|
41
42
|
import com.livekit.reactnative.LiveKitReactNative;
|
|
42
43
|
import com.livekit.reactnative.audio.AudioType;
|
|
43
44
|
|
|
@@ -55,11 +56,30 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
55
56
|
}
|
|
56
57
|
```
|
|
57
58
|
|
|
59
|
+
Or in your **MainApplication.kt** if you are using RN 0.73+
|
|
60
|
+
#### Kotlin
|
|
61
|
+
```kotlin
|
|
62
|
+
import com.livekit.reactnative.LiveKitReactNative
|
|
63
|
+
import com.livekit.reactnative.audio.AudioType
|
|
64
|
+
|
|
65
|
+
class MainActivity : ReactActivity() {
|
|
66
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
67
|
+
// Place this above any other RN related initialization
|
|
68
|
+
// When AudioType is omitted, it'll default to CommunicationAudioType
|
|
69
|
+
// use MediaAudioType if user is only consuming audio, and not publishing
|
|
70
|
+
LiveKitReactNative.setup(this, AudioType.CommunicationAudioType())
|
|
71
|
+
|
|
72
|
+
//...
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
----
|
|
77
|
+
|
|
58
78
|
### iOS
|
|
59
79
|
|
|
60
80
|
In your [AppDelegate.m](https://github.com/livekit/client-sdk-react-native/blob/main/example/ios/LivekitReactNativeExample/AppDelegate.mm) file:
|
|
61
81
|
|
|
62
|
-
```
|
|
82
|
+
```objc
|
|
63
83
|
#import "LivekitReactNative.h"
|
|
64
84
|
|
|
65
85
|
@implementation AppDelegate
|
|
@@ -207,9 +227,8 @@ Android screenshare requires a foreground service with type `mediaProjection` to
|
|
|
207
227
|
The example app uses [@voximplant/react-native-foreground-service](https://github.com/voximplant/react-native-foreground-service) for this.
|
|
208
228
|
Ensure that the service is labelled a `mediaProjection` service like so:
|
|
209
229
|
|
|
210
|
-
```
|
|
211
|
-
<service android:name="com.voximplant.foregroundservice.VIForegroundService"
|
|
212
|
-
android:foregroundServiceType="mediaProjection" />
|
|
230
|
+
```xml
|
|
231
|
+
<service android:name="com.voximplant.foregroundservice.VIForegroundService" android:foregroundServiceType="mediaProjection" />
|
|
213
232
|
```
|
|
214
233
|
|
|
215
234
|
Once setup, start the foreground service prior to using screenshare.
|
package/ios/LivekitReactNative.h
CHANGED
package/ios/LivekitReactNative.m
CHANGED