@livekit/react-native 2.1.1 → 2.2.0
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 +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/livekit/reactnative/LiveKitReactNative.kt +14 -1
- package/android/src/main/java/com/livekit/reactnative/LivekitReactNativeModule.kt +10 -0
- package/android/src/main/java/org/webrtc/audio/WebRtcAudioTrackHelper.kt +20 -0
- package/lib/commonjs/audio/AudioSession.js +0 -2
- package/lib/commonjs/audio/AudioSession.js.map +1 -1
- package/lib/commonjs/hooks.js +6 -0
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/polyfills/EncoderDecoderTogether.min.js +131 -0
- package/lib/commonjs/polyfills/EncoderDecoderTogether.min.js.map +1 -0
- package/lib/module/audio/AudioSession.js +0 -2
- package/lib/module/audio/AudioSession.js.map +1 -1
- package/lib/module/hooks.js +1 -1
- package/lib/module/hooks.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/polyfills/EncoderDecoderTogether.min.js +131 -0
- package/lib/module/polyfills/EncoderDecoderTogether.min.js.map +1 -0
- package/lib/typescript/audio/AudioSession.d.ts +0 -2
- package/lib/typescript/hooks.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/package.json +2 -3
- package/src/audio/AudioSession.ts +0 -2
- package/src/hooks.ts +1 -0
- package/src/index.tsx +1 -1
- package/src/polyfills/EncoderDecoderTogether.min.js +6 -0
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ LiveKit is available on Expo through development builds. You can find our Expo p
|
|
|
107
107
|
|
|
108
108
|
## Example app
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
You can try our standalone example app [here](https://github.com/livekit-examples/react-native-meet/).
|
|
111
111
|
|
|
112
112
|
## Usage
|
|
113
113
|
|
package/android/build.gradle
CHANGED
|
@@ -130,7 +130,7 @@ dependencies {
|
|
|
130
130
|
api 'com.facebook.react:react-native:+'
|
|
131
131
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
132
132
|
api 'com.github.davidliu:audioswitch:89582c47c9a04c62f90aa5e57251af4800a62c9a'
|
|
133
|
-
api 'io.github.webrtc-sdk:android:114.5735.
|
|
133
|
+
api 'io.github.webrtc-sdk:android:114.5735.11'
|
|
134
134
|
implementation project(':livekit_react-native-webrtc')
|
|
135
135
|
implementation "androidx.annotation:annotation:1.4.0"
|
|
136
136
|
}
|
|
@@ -11,6 +11,17 @@ import org.webrtc.audio.JavaAudioDeviceModule
|
|
|
11
11
|
|
|
12
12
|
object LiveKitReactNative {
|
|
13
13
|
|
|
14
|
+
private lateinit var adm: JavaAudioDeviceModule
|
|
15
|
+
|
|
16
|
+
val audioDeviceModule: JavaAudioDeviceModule
|
|
17
|
+
get() {
|
|
18
|
+
if(!::adm.isInitialized) {
|
|
19
|
+
throw IllegalStateException("Audio device module is not initialized! Did you remember to call LiveKitReactNative.setup in your Application.onCreate?")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return adm
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
/**
|
|
15
26
|
* Initializes components required for LiveKit to work on Android.
|
|
16
27
|
*
|
|
@@ -26,10 +37,12 @@ object LiveKitReactNative {
|
|
|
26
37
|
|
|
27
38
|
val useHardwareAudioProcessing = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
adm = JavaAudioDeviceModule.builder(context)
|
|
30
41
|
.setUseHardwareAcousticEchoCanceler(useHardwareAudioProcessing)
|
|
31
42
|
.setUseHardwareNoiseSuppressor(useHardwareAudioProcessing)
|
|
32
43
|
.setAudioAttributes(audioType.audioAttributes)
|
|
33
44
|
.createAudioDeviceModule()
|
|
45
|
+
|
|
46
|
+
options.audioDeviceModule = adm
|
|
34
47
|
}
|
|
35
48
|
}
|
|
@@ -2,10 +2,12 @@ package com.livekit.reactnative
|
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.content.Context
|
|
5
|
+
import android.media.AudioAttributes
|
|
5
6
|
import com.facebook.react.bridge.*
|
|
6
7
|
import com.livekit.reactnative.audio.AudioDeviceKind
|
|
7
8
|
import com.livekit.reactnative.audio.AudioManagerUtils
|
|
8
9
|
import com.livekit.reactnative.audio.AudioSwitchManager
|
|
10
|
+
import org.webrtc.audio.WebRtcAudioTrackHelper
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
class LivekitReactNativeModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
@@ -32,6 +34,10 @@ class LivekitReactNativeModule(reactContext: ReactApplicationContext) : ReactCon
|
|
|
32
34
|
if (androidConfig.hasKey("audioTypeOptions")) {
|
|
33
35
|
val audioTypeOptions = androidConfig.getMap("audioTypeOptions") ?: return
|
|
34
36
|
|
|
37
|
+
val adm = LiveKitReactNative.audioDeviceModule
|
|
38
|
+
val oldAudioAttributes = WebRtcAudioTrackHelper.getAudioOutputAttributes(adm)
|
|
39
|
+
val attributesBuilder = AudioAttributes.Builder(oldAudioAttributes)
|
|
40
|
+
|
|
35
41
|
if (audioTypeOptions.hasKey("manageAudioFocus")) {
|
|
36
42
|
val manageFocus = audioTypeOptions.getBoolean("manageAudioFocus")
|
|
37
43
|
audioManager.setManageAudioFocus(manageFocus)
|
|
@@ -68,6 +74,7 @@ class LivekitReactNativeModule(reactContext: ReactApplicationContext) : ReactCon
|
|
|
68
74
|
val usageType = AudioManagerUtils.audioAttributesUsageTypeFromString(usageTypeString)
|
|
69
75
|
if (usageType != null) {
|
|
70
76
|
audioManager.setAudioAttributesUsageType(usageType)
|
|
77
|
+
attributesBuilder.setUsage(usageType)
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
}
|
|
@@ -77,6 +84,7 @@ class LivekitReactNativeModule(reactContext: ReactApplicationContext) : ReactCon
|
|
|
77
84
|
val contentType = AudioManagerUtils.audioAttributesContentTypeFromString(contentTypeString)
|
|
78
85
|
if (contentType != null) {
|
|
79
86
|
audioManager.setAudioAttributesContentType(contentType)
|
|
87
|
+
attributesBuilder.setContentType(contentType)
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
}
|
|
@@ -85,6 +93,8 @@ class LivekitReactNativeModule(reactContext: ReactApplicationContext) : ReactCon
|
|
|
85
93
|
val force = audioTypeOptions.getBoolean("forceHandleAudioRouting")
|
|
86
94
|
audioManager.setForceHandleAudioRouting(force)
|
|
87
95
|
}
|
|
96
|
+
|
|
97
|
+
WebRtcAudioTrackHelper.setAudioOutputAttributes(adm, attributesBuilder.build())
|
|
88
98
|
}
|
|
89
99
|
}
|
|
90
100
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package org.webrtc.audio
|
|
2
|
+
|
|
3
|
+
import android.media.AudioAttributes
|
|
4
|
+
|
|
5
|
+
object WebRtcAudioTrackHelper {
|
|
6
|
+
|
|
7
|
+
fun getAudioOutputAttributes(adm: JavaAudioDeviceModule): AudioAttributes {
|
|
8
|
+
return adm.audioOutput.audioAttributes ?: AudioAttributes.Builder()
|
|
9
|
+
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
|
|
10
|
+
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
|
11
|
+
.build()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
fun setAudioOutputAttributes(
|
|
15
|
+
adm: JavaAudioDeviceModule,
|
|
16
|
+
audioAttributes: AudioAttributes,
|
|
17
|
+
) {
|
|
18
|
+
adm.audioOutput.audioAttributes = audioAttributes
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -40,8 +40,6 @@ const LivekitReactNative = _reactNative.NativeModules.LivekitReactNative ? _reac
|
|
|
40
40
|
*
|
|
41
41
|
* See {@link AndroidAudioTypePresets} for pre-configured values.
|
|
42
42
|
*
|
|
43
|
-
* NOTE: If `audioTypeOptions` is set, this must also be reflected in your android MainApplication setup.
|
|
44
|
-
*
|
|
45
43
|
* ----
|
|
46
44
|
* iOS
|
|
47
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AudioSession.ts"],"names":["LINKING_ERROR","Platform","select","ios","default","LivekitReactNative","NativeModules","Proxy","get","Error","AndroidAudioTypePresets","communication","manageAudioFocus","audioMode","audioFocusMode","audioStreamType","audioAttributesUsageType","audioAttributesContentType","media","getDefaultAppleAudioConfigurationForMode","mode","preferSpeakerOutput","audioCategory","audioCategoryOptions","AudioSession","config","configureAudio","startAudioSession","stopAudioSession","OS","getAudioOutputs","deviceId","selectAudioOutput","showAudioRoutePicker","setAppleAudioConfiguration"],"mappings":";;;;;;;;AAAA;;;;AACA,MAAMA,aAAa,GAChB,gFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,kBAAkB,GAAGC,2BAAcD,kBAAd,GACvBC,2BAAcD,kBADS,GAEvB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6GO,MAAMU,uBASZ,GAAG;AACFC,EAAAA,aAAa,EAAE;AACbC,IAAAA,gBAAgB,EAAE,IADL;AAEbC,IAAAA,SAAS,EAAE,iBAFE;AAGbC,IAAAA,cAAc,EAAE,MAHH;AAIbC,IAAAA,eAAe,EAAE,WAJJ;AAKbC,IAAAA,wBAAwB,EAAE,oBALb;A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AIvB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAO,CAAC,SAAD,EAAY,eAAZ,CAAP;AACD,GAFD,MAEO,IAAI5B,sBAAS4B,EAAT,KAAgB,SAApB,EAA+B;AACpC,WAAQ,MAAMxB,kBAAkB,CAACyB,eAAnB,EAAd;AACD,GAFM,MAEA;AACL,WAAO,EAAP;AACD;AACF,C;;gBA1DkBN,Y,uBAmEQ,MAAOO,QAAP,IAA4B;AACrD,QAAM1B,kBAAkB,CAAC2B,iBAAnB,CAAqCD,QAArC,CAAN;AACD,C;;gBArEkBP,Y,0BA4EW,YAAY;AACxC,MAAIvB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMxB,kBAAkB,CAAC4B,oBAAnB,EAAN;AACD;AACF,C;;gBAhFkBT,Y,gCAkFiB,MAClCC,MADkC,IAE/B;AACH,MAAIxB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMxB,kBAAkB,CAAC6B,0BAAnB,CAA8CT,MAA9C,CAAN;AACD;AACF,C","sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst LINKING_ERROR =\n `The package '@livekit/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst LivekitReactNative = NativeModules.LivekitReactNative\n ? NativeModules.LivekitReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n/**\n * Configuration for the underlying AudioSession.\n *\n * ----\n * Android specific options:\n *\n * * preferredOutputList - The preferred order in which to automatically select an audio output.\n * This is ignored when an output is manually selected with {@link AudioSession.selectAudioOutput}.\n *\n * By default, the order is set to:\n * 1. `\"bluetooth\"\n * 2. `\"headset\"``\n * 3. `\"speaker\"`\n * 4. `\"earpiece\"`\n *\n * * audioTypeOptions - An {@link AndroidAudioTypeOptions} object which provides the\n * audio options to use on Android.\n *\n * See {@link AndroidAudioTypePresets} for pre-configured values.\n *\n * NOTE: If `audioTypeOptions` is set, this must also be reflected in your android MainApplication setup.\n *\n * ----\n * iOS\n *\n * * defaultOutput - The default preferred output to use when a wired headset or bluetooth output is unavailable.\n *\n * By default, this is set to `\"speaker\"`\n */\nexport type AudioConfiguration = {\n android?: {\n preferredOutputList?: ('speaker' | 'earpiece' | 'headset' | 'bluetooth')[];\n audioTypeOptions: AndroidAudioTypeOptions;\n };\n ios?: {\n defaultOutput?: 'speaker' | 'earpiece';\n };\n};\n\nexport type AndroidAudioTypeOptions = {\n /**\n * Whether LiveKit should handle managing the audio focus or not.\n *\n * Defaults to true.\n */\n manageAudioFocus?: boolean;\n\n /**\n * Corresponds to {@link https://developer.android.com/reference/android/media/AudioManager#setMode(int)}\n *\n * Defaults to 'inCommunication'.\n */\n audioMode?:\n | 'normal'\n | 'callScreening'\n | 'inCall'\n | 'inCommunication'\n | 'ringtone';\n\n /**\n * Corresponds to the duration hint when requesting audio focus.\n *\n * Defaults to 'gain'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#AUDIOFOCUS_GAIN}\n */\n audioFocusMode?:\n | 'gain'\n | 'gainTransient'\n | 'gainTransientExclusive'\n | 'gainTransientMayDuck';\n\n /**\n * Corresponds to Android's AudioAttributes usage type.\n *\n * Defaults to 'voiceCommunication'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesUsageType?:\n | 'alarm'\n | 'assistanceAccessibility'\n | 'assistanceNavigationGuidance'\n | 'assistanceSonification'\n | 'assistant'\n | 'game'\n | 'media'\n | 'notification'\n | 'notificationEvent'\n | 'notificationRingtone'\n | 'unknown'\n | 'voiceCommunication'\n | 'voiceCommunicationSignalling';\n\n /**\n * Corresponds to Android's AndroidAttributes content type.\n *\n * Defaults to 'speech'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesContentType?:\n | 'movie'\n | 'music'\n | 'sonification'\n | 'speech'\n | 'unknown';\n\n /**\n * Corresponds to the stream type when requesting audio focus. Used on pre-O devices.\n *\n * Defaults to 'voiceCall'\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#STREAM_VOICE_CALL}\n */\n audioStreamType?:\n | 'accessibility'\n | 'alarm'\n | 'dtmf'\n | 'music'\n | 'notification'\n | 'ring'\n | 'system'\n | 'voiceCall';\n\n /**\n * On certain Android devices, audio routing does not function properly and\n * bluetooth microphones will not work unless audio mode is set to\n * `inCommunication` or `inCall`. Audio routing is turned off those cases.\n *\n * If this set to true, will attempt to do audio routing regardless of audio mode.\n *\n * Defaults to false.\n */\n forceHandleAudioRouting?: boolean;\n};\n\nexport const AndroidAudioTypePresets: {\n /**\n * A pre-configured AndroidAudioConfiguration for voice communication.\n */\n communication: AndroidAudioTypeOptions;\n /**\n * A pre-configured AndroidAudioConfiguration for media playback.\n */\n media: AndroidAudioTypeOptions;\n} = {\n communication: {\n manageAudioFocus: true,\n audioMode: 'inCommunication',\n audioFocusMode: 'gain',\n audioStreamType: 'voiceCall',\n audioAttributesUsageType: 'voiceCommunication',\n audioAttributesContentType: 'speech',\n },\n media: {\n manageAudioFocus: true,\n audioMode: 'normal',\n audioFocusMode: 'gain',\n audioStreamType: 'music',\n audioAttributesUsageType: 'media',\n audioAttributesContentType: 'unknown',\n },\n} as const;\n\nexport type AppleAudioMode =\n | 'default'\n | 'gameChat'\n | 'measurement'\n | 'moviePlayback'\n | 'spokenAudio'\n | 'videoChat'\n | 'videoRecording'\n | 'voiceChat'\n | 'voicePrompt';\n\nexport type AppleAudioCategory =\n | 'soloAmbient'\n | 'playback'\n | 'record'\n | 'playAndRecord'\n | 'multiRoute';\n\nexport type AppleAudioCategoryOption =\n | 'mixWithOthers'\n | 'duckOthers'\n | 'interruptSpokenAudioAndMixWithOthers'\n | 'allowBluetooth'\n | 'allowBluetoothA2DP'\n | 'allowAirPlay'\n | 'defaultToSpeaker';\n\nexport type AppleAudioConfiguration = {\n audioCategory?: AppleAudioCategory;\n audioCategoryOptions?: AppleAudioCategoryOption[];\n audioMode?: AppleAudioMode;\n};\n\nexport type AudioTrackState =\n | 'none'\n | 'remoteOnly'\n | 'localOnly'\n | 'localAndRemote';\n\nexport function getDefaultAppleAudioConfigurationForMode(\n mode: AudioTrackState,\n preferSpeakerOutput: boolean = true\n): AppleAudioConfiguration {\n if (mode === 'remoteOnly') {\n return {\n audioCategory: 'playback',\n audioCategoryOptions: ['mixWithOthers'],\n audioMode: 'spokenAudio',\n };\n } else if (mode === 'localAndRemote' || mode === 'localOnly') {\n return {\n audioCategory: 'playAndRecord',\n audioCategoryOptions: ['allowBluetooth', 'mixWithOthers'],\n audioMode: preferSpeakerOutput ? 'videoChat' : 'voiceChat',\n };\n }\n\n return {\n audioCategory: 'soloAmbient',\n audioCategoryOptions: [],\n audioMode: 'default',\n };\n}\n\nexport default class AudioSession {\n /**\n * Applies the provided audio configuration to the underlying AudioSession.\n *\n * Must be called prior to connecting to a Room for the configuration to apply correctly.\n *\n * See also useIOSAudioManagement for automatic configuration of iOS audio options.\n */\n static configureAudio = async (config: AudioConfiguration) => {\n await LivekitReactNative.configureAudio(config);\n };\n\n /**\n * Starts an AudioSession.\n */\n static startAudioSession = async () => {\n await LivekitReactNative.startAudioSession();\n };\n\n /**\n * Stops the existing AudioSession.\n */\n static stopAudioSession = async () => {\n await LivekitReactNative.stopAudioSession();\n };\n\n /**\n * Gets the available audio outputs for use with {@link selectAudioOutput}.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * For Android, will return if available:\n * * \"speaker\"\n * * \"earpiece\"\n * * \"headset\"\n * * \"bluetooth\"\n *\n * ----\n *\n * For iOS, due to OS limitations, the only available types are:\n * * \"default\" - Use default iOS audio routing\n * * \"force_speaker\" - Force audio output through speaker\n *\n * See also {@link showAudioRoutePicker} to display a route picker that\n * can choose between other audio devices (i.e. headset/bluetooth/airplay),\n * or use a library like `react-native-avroutepicker` for a native platform\n * control.\n *\n * @returns the available audio output types\n */\n static getAudioOutputs = async (): Promise<string[]> => {\n if (Platform.OS === 'ios') {\n return ['default', 'force_speaker'];\n } else if (Platform.OS === 'android') {\n return (await LivekitReactNative.getAudioOutputs()) as string[];\n } else {\n return [];\n }\n };\n\n /**\n * Select the provided audio output if available.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * @param deviceId A deviceId retrieved from {@link getAudioOutputs}\n */\n static selectAudioOutput = async (deviceId: string) => {\n await LivekitReactNative.selectAudioOutput(deviceId);\n };\n\n /**\n * iOS only, requires iOS 11+.\n *\n * Displays an AVRoutePickerView for the user to choose their audio output.\n */\n static showAudioRoutePicker = async () => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.showAudioRoutePicker();\n }\n };\n\n static setAppleAudioConfiguration = async (\n config: AppleAudioConfiguration\n ) => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.setAppleAudioConfiguration(config);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["AudioSession.ts"],"names":["LINKING_ERROR","Platform","select","ios","default","LivekitReactNative","NativeModules","Proxy","get","Error","AndroidAudioTypePresets","communication","manageAudioFocus","audioMode","audioFocusMode","audioStreamType","audioAttributesUsageType","audioAttributesContentType","media","getDefaultAppleAudioConfigurationForMode","mode","preferSpeakerOutput","audioCategory","audioCategoryOptions","AudioSession","config","configureAudio","startAudioSession","stopAudioSession","OS","getAudioOutputs","deviceId","selectAudioOutput","showAudioRoutePicker","setAppleAudioConfiguration"],"mappings":";;;;;;;;AAAA;;;;AACA,MAAMA,aAAa,GAChB,gFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,kBAAkB,GAAGC,2BAAcD,kBAAd,GACvBC,2BAAcD,kBADS,GAEvB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAA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A,aAAa,EAAE,aADV;AAELC,IAAAA,oBAAoB,EAAE,EAFjB;AAGLV,IAAAA,SAAS,EAAE;AAHN,GAAP;AAKD;;AAEc,MAAMW,YAAN,CAAmB;;;;gBAAbA,Y,oBAQK,MAAOC,MAAP,IAAsC;AAC5D,QAAMpB,kBAAkB,CAACqB,cAAnB,CAAkCD,MAAlC,CAAN;AACD,C;;gBAVkBD,Y,uBAeQ,YAAY;AACrC,QAAMnB,kBAAkB,CAACsB,iBAAnB,EAAN;AACD,C;;gBAjBkBH,Y,sBAsBO,YAAY;AACpC,QAAMnB,kBAAkB,CAACuB,gBAAnB,EAAN;AACD,C;;gBAxBkBJ,Y,qBAkDM,YAA+B;AACtD,MAAIvB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAO,CAAC,SAAD,EAAY,eAAZ,CAAP;AACD,GAFD,MAEO,IAAI5B,sBAAS4B,EAAT,KAAgB,SAApB,EAA+B;AACpC,WAAQ,MAAMxB,kBAAkB,CAACyB,eAAnB,EAAd;AACD,GAFM,MAEA;AACL,WAAO,EAAP;AACD;AACF,C;;gBA1DkBN,Y,uBAmEQ,MAAOO,QAAP,IAA4B;AACrD,QAAM1B,kBAAkB,CAAC2B,iBAAnB,CAAqCD,QAArC,CAAN;AACD,C;;gBArEkBP,Y,0BA4EW,YAAY;AACxC,MAAIvB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMxB,kBAAkB,CAAC4B,oBAAnB,EAAN;AACD;AACF,C;;gBAhFkBT,Y,gCAkFiB,MAClCC,MADkC,IAE/B;AACH,MAAIxB,sBAAS4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMxB,kBAAkB,CAAC6B,0BAAnB,CAA8CT,MAA9C,CAAN;AACD;AACF,C","sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst LINKING_ERROR =\n `The package '@livekit/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst LivekitReactNative = NativeModules.LivekitReactNative\n ? NativeModules.LivekitReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n/**\n * Configuration for the underlying AudioSession.\n *\n * ----\n * Android specific options:\n *\n * * preferredOutputList - The preferred order in which to automatically select an audio output.\n * This is ignored when an output is manually selected with {@link AudioSession.selectAudioOutput}.\n *\n * By default, the order is set to:\n * 1. `\"bluetooth\"\n * 2. `\"headset\"``\n * 3. `\"speaker\"`\n * 4. `\"earpiece\"`\n *\n * * audioTypeOptions - An {@link AndroidAudioTypeOptions} object which provides the\n * audio options to use on Android.\n *\n * See {@link AndroidAudioTypePresets} for pre-configured values.\n *\n * ----\n * iOS\n *\n * * defaultOutput - The default preferred output to use when a wired headset or bluetooth output is unavailable.\n *\n * By default, this is set to `\"speaker\"`\n */\nexport type AudioConfiguration = {\n android?: {\n preferredOutputList?: ('speaker' | 'earpiece' | 'headset' | 'bluetooth')[];\n audioTypeOptions: AndroidAudioTypeOptions;\n };\n ios?: {\n defaultOutput?: 'speaker' | 'earpiece';\n };\n};\n\nexport type AndroidAudioTypeOptions = {\n /**\n * Whether LiveKit should handle managing the audio focus or not.\n *\n * Defaults to true.\n */\n manageAudioFocus?: boolean;\n\n /**\n * Corresponds to {@link https://developer.android.com/reference/android/media/AudioManager#setMode(int)}\n *\n * Defaults to 'inCommunication'.\n */\n audioMode?:\n | 'normal'\n | 'callScreening'\n | 'inCall'\n | 'inCommunication'\n | 'ringtone';\n\n /**\n * Corresponds to the duration hint when requesting audio focus.\n *\n * Defaults to 'gain'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#AUDIOFOCUS_GAIN}\n */\n audioFocusMode?:\n | 'gain'\n | 'gainTransient'\n | 'gainTransientExclusive'\n | 'gainTransientMayDuck';\n\n /**\n * Corresponds to Android's AudioAttributes usage type.\n *\n * Defaults to 'voiceCommunication'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesUsageType?:\n | 'alarm'\n | 'assistanceAccessibility'\n | 'assistanceNavigationGuidance'\n | 'assistanceSonification'\n | 'assistant'\n | 'game'\n | 'media'\n | 'notification'\n | 'notificationEvent'\n | 'notificationRingtone'\n | 'unknown'\n | 'voiceCommunication'\n | 'voiceCommunicationSignalling';\n\n /**\n * Corresponds to Android's AndroidAttributes content type.\n *\n * Defaults to 'speech'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesContentType?:\n | 'movie'\n | 'music'\n | 'sonification'\n | 'speech'\n | 'unknown';\n\n /**\n * Corresponds to the stream type when requesting audio focus. Used on pre-O devices.\n *\n * Defaults to 'voiceCall'\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#STREAM_VOICE_CALL}\n */\n audioStreamType?:\n | 'accessibility'\n | 'alarm'\n | 'dtmf'\n | 'music'\n | 'notification'\n | 'ring'\n | 'system'\n | 'voiceCall';\n\n /**\n * On certain Android devices, audio routing does not function properly and\n * bluetooth microphones will not work unless audio mode is set to\n * `inCommunication` or `inCall`. Audio routing is turned off those cases.\n *\n * If this set to true, will attempt to do audio routing regardless of audio mode.\n *\n * Defaults to false.\n */\n forceHandleAudioRouting?: boolean;\n};\n\nexport const AndroidAudioTypePresets: {\n /**\n * A pre-configured AndroidAudioConfiguration for voice communication.\n */\n communication: AndroidAudioTypeOptions;\n /**\n * A pre-configured AndroidAudioConfiguration for media playback.\n */\n media: AndroidAudioTypeOptions;\n} = {\n communication: {\n manageAudioFocus: true,\n audioMode: 'inCommunication',\n audioFocusMode: 'gain',\n audioStreamType: 'voiceCall',\n audioAttributesUsageType: 'voiceCommunication',\n audioAttributesContentType: 'speech',\n },\n media: {\n manageAudioFocus: true,\n audioMode: 'normal',\n audioFocusMode: 'gain',\n audioStreamType: 'music',\n audioAttributesUsageType: 'media',\n audioAttributesContentType: 'unknown',\n },\n} as const;\n\nexport type AppleAudioMode =\n | 'default'\n | 'gameChat'\n | 'measurement'\n | 'moviePlayback'\n | 'spokenAudio'\n | 'videoChat'\n | 'videoRecording'\n | 'voiceChat'\n | 'voicePrompt';\n\nexport type AppleAudioCategory =\n | 'soloAmbient'\n | 'playback'\n | 'record'\n | 'playAndRecord'\n | 'multiRoute';\n\nexport type AppleAudioCategoryOption =\n | 'mixWithOthers'\n | 'duckOthers'\n | 'interruptSpokenAudioAndMixWithOthers'\n | 'allowBluetooth'\n | 'allowBluetoothA2DP'\n | 'allowAirPlay'\n | 'defaultToSpeaker';\n\nexport type AppleAudioConfiguration = {\n audioCategory?: AppleAudioCategory;\n audioCategoryOptions?: AppleAudioCategoryOption[];\n audioMode?: AppleAudioMode;\n};\n\nexport type AudioTrackState =\n | 'none'\n | 'remoteOnly'\n | 'localOnly'\n | 'localAndRemote';\n\nexport function getDefaultAppleAudioConfigurationForMode(\n mode: AudioTrackState,\n preferSpeakerOutput: boolean = true\n): AppleAudioConfiguration {\n if (mode === 'remoteOnly') {\n return {\n audioCategory: 'playback',\n audioCategoryOptions: ['mixWithOthers'],\n audioMode: 'spokenAudio',\n };\n } else if (mode === 'localAndRemote' || mode === 'localOnly') {\n return {\n audioCategory: 'playAndRecord',\n audioCategoryOptions: ['allowBluetooth', 'mixWithOthers'],\n audioMode: preferSpeakerOutput ? 'videoChat' : 'voiceChat',\n };\n }\n\n return {\n audioCategory: 'soloAmbient',\n audioCategoryOptions: [],\n audioMode: 'default',\n };\n}\n\nexport default class AudioSession {\n /**\n * Applies the provided audio configuration to the underlying AudioSession.\n *\n * Must be called prior to connecting to a Room for the configuration to apply correctly.\n *\n * See also useIOSAudioManagement for automatic configuration of iOS audio options.\n */\n static configureAudio = async (config: AudioConfiguration) => {\n await LivekitReactNative.configureAudio(config);\n };\n\n /**\n * Starts an AudioSession.\n */\n static startAudioSession = async () => {\n await LivekitReactNative.startAudioSession();\n };\n\n /**\n * Stops the existing AudioSession.\n */\n static stopAudioSession = async () => {\n await LivekitReactNative.stopAudioSession();\n };\n\n /**\n * Gets the available audio outputs for use with {@link selectAudioOutput}.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * For Android, will return if available:\n * * \"speaker\"\n * * \"earpiece\"\n * * \"headset\"\n * * \"bluetooth\"\n *\n * ----\n *\n * For iOS, due to OS limitations, the only available types are:\n * * \"default\" - Use default iOS audio routing\n * * \"force_speaker\" - Force audio output through speaker\n *\n * See also {@link showAudioRoutePicker} to display a route picker that\n * can choose between other audio devices (i.e. headset/bluetooth/airplay),\n * or use a library like `react-native-avroutepicker` for a native platform\n * control.\n *\n * @returns the available audio output types\n */\n static getAudioOutputs = async (): Promise<string[]> => {\n if (Platform.OS === 'ios') {\n return ['default', 'force_speaker'];\n } else if (Platform.OS === 'android') {\n return (await LivekitReactNative.getAudioOutputs()) as string[];\n } else {\n return [];\n }\n };\n\n /**\n * Select the provided audio output if available.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * @param deviceId A deviceId retrieved from {@link getAudioOutputs}\n */\n static selectAudioOutput = async (deviceId: string) => {\n await LivekitReactNative.selectAudioOutput(deviceId);\n };\n\n /**\n * iOS only, requires iOS 11+.\n *\n * Displays an AVRoutePickerView for the user to choose their audio output.\n */\n static showAudioRoutePicker = async () => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.showAudioRoutePicker();\n }\n };\n\n static setAppleAudioConfiguration = async (\n config: AppleAudioConfiguration\n ) => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.setAppleAudioConfiguration(config);\n }\n };\n}\n"]}
|
package/lib/commonjs/hooks.js
CHANGED
|
@@ -189,6 +189,12 @@ Object.defineProperty(exports, "useRoomContext", {
|
|
|
189
189
|
return _componentsReact.useRoomContext;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
+
Object.defineProperty(exports, "useRoomInfo", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _componentsReact.useRoomInfo;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
192
198
|
Object.defineProperty(exports, "useSortedParticipants", {
|
|
193
199
|
enumerable: true,
|
|
194
200
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["hooks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAwCA","sourcesContent":["export {\n useConnectionState,\n useDataChannel,\n useIsSpeaking,\n useLocalParticipant,\n UseLocalParticipantOptions,\n useLocalParticipantPermissions,\n useParticipantInfo,\n UseParticipantInfoOptions,\n useParticipants,\n UseParticipantsOptions,\n useRemoteParticipants,\n UseRemoteParticipantOptions,\n useRemoteParticipant,\n UseRemoteParticipantsOptions,\n useSpeakingParticipants,\n useSortedParticipants,\n useChat,\n useIsEncrypted,\n useRoomInfo,\n useIsMuted,\n useParticipantTracks,\n useLiveKitRoom,\n RoomContext,\n useRoomContext,\n ParticipantContext,\n useParticipantContext,\n TrackRefContext,\n useTrackRefContext,\n useTracks,\n UseTracksOptions,\n TrackReference,\n TrackReferenceOrPlaceholder,\n isTrackReference,\n useEnsureTrackRef,\n useTrackMutedIndicator,\n useVisualStableUpdate,\n UseVisualStableUpdateOptions,\n} from '@livekit/components-react';\n\nexport { ReceivedDataMessage } from '@livekit/components-core';\n"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var _reactNativeWebrtc = require("@livekit/react-native-webrtc");
|
|
|
75
75
|
|
|
76
76
|
var _reactNativeUrlPolyfill = require("react-native-url-polyfill");
|
|
77
77
|
|
|
78
|
-
require("
|
|
78
|
+
require("./polyfills/EncoderDecoderTogether.min.js");
|
|
79
79
|
|
|
80
80
|
var _AudioSession = _interopRequireWildcard(require("./audio/AudioSession"));
|
|
81
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["registerGlobals","livekitRegisterGlobals","fixWebrtcAdapter","shimPromiseAllSettled","shimArrayAt","shimAsyncIterator","shimIterator","lkGlobal","platform","Platform","OS","devicePixelRatio","PixelRatio","get","global","LiveKitReactNativeGlobal","window","navigator","undefined","userAgent","product","allSettled","require","shim","Array","prototype","at"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAWA;;AA8DA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AAjEA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,GAA2B;AAChC;AACAC,EAAAA,sBAAsB;AACtB;AACAC,EAAAA,gBAAgB;AAChBC,EAAAA,qBAAqB;AACrBC,EAAAA,WAAW;AACXC,EAAAA,iBAAiB;AACjBC,EAAAA,YAAY;AACb;;AACD,SAASL,sBAAT,GAAkC;AAChC,MAAIM,QAAgC,GAAG;AACrCC,IAAAA,QAAQ,EAAEC,sBAASC,EADkB;AAErCC,IAAAA,gBAAgB,EAAEC,wBAAWC,GAAX;AAFmB,GAAvC,CADgC,CAMhC;;AACAC,EAAAA,MAAM,CAACC,wBAAP,GAAkCR,QAAlC;AACD;;AAED,SAASL,gBAAT,GAA4B;AAAA;;AAC1B;AACA,MAAI,YAAAc,MAAM,UAAN,0CAAQC,SAAR,MAAsBC,SAA1B,EAAqC;AACnC;AACA,UAAM;AAAED,MAAAA;AAAF,QAAgBD,MAAtB;;AACA,QAAIC,SAAS,CAACE,SAAV,KAAwBD,SAA5B,EAAuC;AAAA;;AACrCD,MAAAA,SAAS,CAACE,SAAV,yBAAsBF,SAAS,CAACG,OAAhC,mEAA2C,SAA3C;AACD;AACF;AACF;;AAED,SAASjB,qBAAT,GAAiC;AAC/B,MAAIkB,UAAU,GAAGC,OAAO,CAAC,oBAAD,CAAxB;;AACAD,EAAAA,UAAU,CAACE,IAAX;AACD;;AAED,SAASnB,WAAT,GAAuB;AACrB;AACA,MAAI,CAACoB,KAAK,CAACC,SAAN,CAAgBC,EAArB,EAAyB;AACvB,QAAIA,EAAE,GAAGJ,OAAO,CAAC,oBAAD,CAAhB;;AACAI,IAAAA,EAAE,CAACH,IAAH;AACD;AACF;;AAED,SAASlB,iBAAT,GAA6B;AAC3B,MAAIkB,IAAI,GAAGD,OAAO,CAAC,8CAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL;;AAED,SAASjB,YAAT,GAAwB;AACtB,MAAIiB,IAAI,GAAGD,OAAO,CAAC,yCAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL","sourcesContent":["import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';\nimport { setupURLPolyfill } from 'react-native-url-polyfill';\nimport '
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["registerGlobals","livekitRegisterGlobals","fixWebrtcAdapter","shimPromiseAllSettled","shimArrayAt","shimAsyncIterator","shimIterator","lkGlobal","platform","Platform","OS","devicePixelRatio","PixelRatio","get","global","LiveKitReactNativeGlobal","window","navigator","undefined","userAgent","product","allSettled","require","shim","Array","prototype","at"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAWA;;AA8DA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AAjEA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,GAA2B;AAChC;AACAC,EAAAA,sBAAsB;AACtB;AACAC,EAAAA,gBAAgB;AAChBC,EAAAA,qBAAqB;AACrBC,EAAAA,WAAW;AACXC,EAAAA,iBAAiB;AACjBC,EAAAA,YAAY;AACb;;AACD,SAASL,sBAAT,GAAkC;AAChC,MAAIM,QAAgC,GAAG;AACrCC,IAAAA,QAAQ,EAAEC,sBAASC,EADkB;AAErCC,IAAAA,gBAAgB,EAAEC,wBAAWC,GAAX;AAFmB,GAAvC,CADgC,CAMhC;;AACAC,EAAAA,MAAM,CAACC,wBAAP,GAAkCR,QAAlC;AACD;;AAED,SAASL,gBAAT,GAA4B;AAAA;;AAC1B;AACA,MAAI,YAAAc,MAAM,UAAN,0CAAQC,SAAR,MAAsBC,SAA1B,EAAqC;AACnC;AACA,UAAM;AAAED,MAAAA;AAAF,QAAgBD,MAAtB;;AACA,QAAIC,SAAS,CAACE,SAAV,KAAwBD,SAA5B,EAAuC;AAAA;;AACrCD,MAAAA,SAAS,CAACE,SAAV,yBAAsBF,SAAS,CAACG,OAAhC,mEAA2C,SAA3C;AACD;AACF;AACF;;AAED,SAASjB,qBAAT,GAAiC;AAC/B,MAAIkB,UAAU,GAAGC,OAAO,CAAC,oBAAD,CAAxB;;AACAD,EAAAA,UAAU,CAACE,IAAX;AACD;;AAED,SAASnB,WAAT,GAAuB;AACrB;AACA,MAAI,CAACoB,KAAK,CAACC,SAAN,CAAgBC,EAArB,EAAyB;AACvB,QAAIA,EAAE,GAAGJ,OAAO,CAAC,oBAAD,CAAhB;;AACAI,IAAAA,EAAE,CAACH,IAAH;AACD;AACF;;AAED,SAASlB,iBAAT,GAA6B;AAC3B,MAAIkB,IAAI,GAAGD,OAAO,CAAC,8CAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL;;AAED,SAASjB,YAAT,GAAwB;AACtB,MAAIiB,IAAI,GAAGD,OAAO,CAAC,yCAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL","sourcesContent":["import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';\nimport { setupURLPolyfill } from 'react-native-url-polyfill';\nimport './polyfills/EncoderDecoderTogether.min.js';\nimport AudioSession, {\n AndroidAudioTypePresets,\n AndroidAudioTypeOptions,\n AppleAudioCategory,\n AppleAudioCategoryOption,\n AppleAudioConfiguration,\n AppleAudioMode,\n AudioTrackState,\n getDefaultAppleAudioConfigurationForMode,\n} from './audio/AudioSession';\nimport type { AudioConfiguration } from './audio/AudioSession';\nimport { PixelRatio, Platform } from 'react-native';\nimport type { LiveKitReactNativeInfo } from 'livekit-client';\nimport type { LogLevel, SetLogLevelOptions } from './logger';\n\n/**\n * Registers the required globals needed for LiveKit to work.\n *\n * Must be called before using LiveKit.\n */\nexport function registerGlobals() {\n webrtcRegisterGlobals();\n livekitRegisterGlobals();\n setupURLPolyfill();\n fixWebrtcAdapter();\n shimPromiseAllSettled();\n shimArrayAt();\n shimAsyncIterator();\n shimIterator();\n}\nfunction livekitRegisterGlobals() {\n let lkGlobal: LiveKitReactNativeInfo = {\n platform: Platform.OS,\n devicePixelRatio: PixelRatio.get(),\n };\n\n // @ts-ignore\n global.LiveKitReactNativeGlobal = lkGlobal;\n}\n\nfunction fixWebrtcAdapter() {\n // @ts-ignore\n if (window?.navigator !== undefined) {\n // @ts-ignore\n const { navigator } = window;\n if (navigator.userAgent === undefined) {\n navigator.userAgent = navigator.product ?? 'Unknown';\n }\n }\n}\n\nfunction shimPromiseAllSettled() {\n var allSettled = require('promise.allsettled');\n allSettled.shim();\n}\n\nfunction shimArrayAt() {\n // Some versions of RN don't have Array.prototype.at, which is used by sdp-transform\n if (!Array.prototype.at) {\n var at = require('array.prototype.at');\n at.shim();\n }\n}\n\nfunction shimAsyncIterator() {\n var shim = require('well-known-symbols/Symbol.asyncIterator/shim');\n shim();\n}\n\nfunction shimIterator() {\n var shim = require('well-known-symbols/Symbol.iterator/shim');\n shim();\n}\nexport * from './hooks';\nexport * from './components/LiveKitRoom';\nexport * from './components/VideoTrack';\nexport * from './components/VideoView'; // deprecated\nexport * from './useParticipant'; // deprecated\nexport * from './useRoom'; // deprecated\nexport * from './logger';\nexport * from './audio/AudioManager';\n\nexport {\n AudioSession,\n AudioConfiguration,\n AndroidAudioTypeOptions,\n AndroidAudioTypePresets,\n AppleAudioCategory,\n AppleAudioCategoryOption,\n AppleAudioConfiguration,\n AppleAudioMode,\n AudioTrackState,\n getDefaultAppleAudioConfigurationForMode,\n LogLevel,\n SetLogLevelOptions,\n};\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
(function (q) {
|
|
4
|
+
function x() {}
|
|
5
|
+
|
|
6
|
+
function y() {}
|
|
7
|
+
|
|
8
|
+
var z = String.fromCharCode,
|
|
9
|
+
v = {}.toString,
|
|
10
|
+
A = v.call(q.SharedArrayBuffer),
|
|
11
|
+
B = v(),
|
|
12
|
+
r = q.Uint8Array,
|
|
13
|
+
t = r || Array,
|
|
14
|
+
w = r ? ArrayBuffer : t,
|
|
15
|
+
C = w.isView || function (g) {
|
|
16
|
+
return g && "length" in g;
|
|
17
|
+
},
|
|
18
|
+
D = v.call(w.prototype);
|
|
19
|
+
|
|
20
|
+
w = y.prototype;
|
|
21
|
+
var E = q.TextEncoder,
|
|
22
|
+
F = q.TextDecoder,
|
|
23
|
+
a = new (r ? Uint16Array : t)(32);
|
|
24
|
+
|
|
25
|
+
x.prototype.decode = function (g) {
|
|
26
|
+
if (!C(g)) {
|
|
27
|
+
var l = v.call(g);
|
|
28
|
+
if (l !== D && l !== A && l !== B) throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
29
|
+
g = r ? new t(g) : g || [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (var f = l = "", b = 0, c = g.length | 0, u = c - 32 | 0, e, d, h = 0, p = 0, m, k = 0, n = -1; b < c;) {
|
|
33
|
+
for (e = b <= u ? 32 : c - b | 0; k < e; b = b + 1 | 0, k = k + 1 | 0) {
|
|
34
|
+
d = g[b] & 255;
|
|
35
|
+
|
|
36
|
+
switch (d >> 4) {
|
|
37
|
+
case 15:
|
|
38
|
+
m = g[b = b + 1 | 0] & 255;
|
|
39
|
+
|
|
40
|
+
if (2 !== m >> 6 || 247 < d) {
|
|
41
|
+
b = b - 1 | 0;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h = (d & 7) << 6 | m & 63;
|
|
46
|
+
p = 5;
|
|
47
|
+
d = 256;
|
|
48
|
+
|
|
49
|
+
case 14:
|
|
50
|
+
m = g[b = b + 1 | 0] & 255, h <<= 6, h |= (d & 15) << 6 | m & 63, p = 2 === m >> 6 ? p + 4 | 0 : 24, d = d + 256 & 768;
|
|
51
|
+
|
|
52
|
+
case 13:
|
|
53
|
+
case 12:
|
|
54
|
+
m = g[b = b + 1 | 0] & 255, h <<= 6, h |= (d & 31) << 6 | m & 63, p = p + 7 | 0, b < c && 2 === m >> 6 && h >> p && 1114112 > h ? (d = h, h = h - 65536 | 0, 0 <= h && (n = (h >> 10) + 55296 | 0, d = (h & 1023) + 56320 | 0, 31 > k ? (a[k] = n, k = k + 1 | 0, n = -1) : (m = n, n = d, d = m))) : (d >>= 8, b = b - d - 1 | 0, d = 65533), h = p = 0, e = b <= u ? 32 : c - b | 0;
|
|
55
|
+
|
|
56
|
+
default:
|
|
57
|
+
a[k] = d;
|
|
58
|
+
continue;
|
|
59
|
+
|
|
60
|
+
case 11:
|
|
61
|
+
case 10:
|
|
62
|
+
case 9:
|
|
63
|
+
case 8:
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a[k] = 65533;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
f += z(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20], a[21], a[22], a[23], a[24], a[25], a[26], a[27], a[28], a[29], a[30], a[31]);
|
|
70
|
+
32 > k && (f = f.slice(0, k - 32 | 0));
|
|
71
|
+
|
|
72
|
+
if (b < c) {
|
|
73
|
+
if (a[0] = n, k = ~n >>> 31, n = -1, f.length < l.length) continue;
|
|
74
|
+
} else -1 !== n && (f += z(n));
|
|
75
|
+
|
|
76
|
+
l += f;
|
|
77
|
+
f = "";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return l;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
w.encode = function (g) {
|
|
84
|
+
g = void 0 === g ? "" : "" + g;
|
|
85
|
+
var l = g.length | 0,
|
|
86
|
+
f = new t((l << 1) + 8 | 0),
|
|
87
|
+
b,
|
|
88
|
+
c = 0,
|
|
89
|
+
u = !r;
|
|
90
|
+
|
|
91
|
+
for (b = 0; b < l; b = b + 1 | 0, c = c + 1 | 0) {
|
|
92
|
+
var e = g.charCodeAt(b) | 0;
|
|
93
|
+
if (127 >= e) f[c] = e;else {
|
|
94
|
+
if (2047 >= e) f[c] = 192 | e >> 6;else {
|
|
95
|
+
a: {
|
|
96
|
+
if (55296 <= e) if (56319 >= e) {
|
|
97
|
+
var d = g.charCodeAt(b = b + 1 | 0) | 0;
|
|
98
|
+
|
|
99
|
+
if (56320 <= d && 57343 >= d) {
|
|
100
|
+
e = (e << 10) + d - 56613888 | 0;
|
|
101
|
+
|
|
102
|
+
if (65535 < e) {
|
|
103
|
+
f[c] = 240 | e >> 18;
|
|
104
|
+
f[c = c + 1 | 0] = 128 | e >> 12 & 63;
|
|
105
|
+
f[c = c + 1 | 0] = 128 | e >> 6 & 63;
|
|
106
|
+
f[c = c + 1 | 0] = 128 | e & 63;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
break a;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
e = 65533;
|
|
114
|
+
} else 57343 >= e && (e = 65533);
|
|
115
|
+
!u && b << 1 < c && b << 1 < (c - 7 | 0) && (u = !0, d = new t(3 * l), d.set(f), f = d);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
f[c] = 224 | e >> 12;
|
|
119
|
+
f[c = c + 1 | 0] = 128 | e >> 6 & 63;
|
|
120
|
+
}
|
|
121
|
+
f[c = c + 1 | 0] = 128 | e & 63;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return r ? f.subarray(0, c) : f.slice(0, c);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
E || (q.TextEncoder = y);
|
|
129
|
+
F || (q.TextDecoder = x);
|
|
130
|
+
})("" + void 0 == typeof global ? "" + void 0 == typeof self ? void 0 : self : global); //AnonyCo
|
|
131
|
+
//# sourceMappingURL=EncoderDecoderTogether.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["EncoderDecoderTogether.min.js"],"names":["q","x","y","z","String","fromCharCode","v","toString","A","call","SharedArrayBuffer","B","r","Uint8Array","t","Array","w","ArrayBuffer","C","isView","g","D","prototype","E","TextEncoder","F","TextDecoder","a","Uint16Array","decode","l","TypeError","f","b","c","length","u","e","d","h","p","m","k","n","slice","encode","charCodeAt","set","subarray","global","self"],"mappings":"AAAA;;AAAa,CAAC,UAASA,CAAT,EAAW;AAAC,WAASC,CAAT,GAAY,CAAE;;AAAA,WAASC,CAAT,GAAY,CAAE;;AAAA,MAAIC,CAAC,GAACC,MAAM,CAACC,YAAb;AAAA,MAA0BC,CAAC,GAAC,GAAGC,QAA/B;AAAA,MAAwCC,CAAC,GAACF,CAAC,CAACG,IAAF,CAAOT,CAAC,CAACU,iBAAT,CAA1C;AAAA,MAAsEC,CAAC,GAACL,CAAC,EAAzE;AAAA,MAA4EM,CAAC,GAACZ,CAAC,CAACa,UAAhF;AAAA,MAA2FC,CAAC,GAACF,CAAC,IAAEG,KAAhG;AAAA,MAAsGC,CAAC,GAACJ,CAAC,GAACK,WAAD,GAAaH,CAAtH;AAAA,MAAwHI,CAAC,GAACF,CAAC,CAACG,MAAF,IAAU,UAASC,CAAT,EAAW;AAAC,WAAOA,CAAC,IAAE,YAAWA,CAArB;AAAuB,GAAvK;AAAA,MAAwKC,CAAC,GAACf,CAAC,CAACG,IAAF,CAAOO,CAAC,CAACM,SAAT,CAA1K;;AAA8LN,EAAAA,CAAC,GAACd,CAAC,CAACoB,SAAJ;AAAc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C,CAAF,GAAI,CAAP,CAAD,GAAW,MAAIG,CAAC,GAAC,EAAjB;AAAoB;AAAC;;AAAA,WAAOzB,CAAC,GAChgBoB,CAAC,CAACgB,QAAF,CAAW,CAAX,EAAad,CAAb,CADggB,GAChfF,CAAC,CAACY,KAAF,CAAQ,CAAR,EAAUV,CAAV,CADwe;AAC3d,GAFma;;AAElaX,EAAAA,CAAC,KAAGvB,CAAC,CAACwB,WAAF,GAActB,CAAjB,CAAD;AAAqBuB,EAAAA,CAAC,KAAGzB,CAAC,CAAC0B,WAAF,GAAczB,CAAjB,CAAD;AAAqB,CAJ3D,EAI6D,KAAG,KAAK,CAAR,IAAW,OAAOgD,MAAlB,GAAyB,KAAG,KAAK,CAAR,IAAW,OAAOC,IAAlB,YAA4BA,IAArD,GAA0DD,MAJvH,E,CAI+H","sourcesContent":["'use strict';(function(q){function x(){}function y(){}var z=String.fromCharCode,v={}.toString,A=v.call(q.SharedArrayBuffer),B=v(),r=q.Uint8Array,t=r||Array,w=r?ArrayBuffer:t,C=w.isView||function(g){return g&&\"length\"in g},D=v.call(w.prototype);w=y.prototype;var E=q.TextEncoder,F=q.TextDecoder,a=new (r?Uint16Array:t)(32);x.prototype.decode=function(g){if(!C(g)){var l=v.call(g);if(l!==D&&l!==A&&l!==B)throw TypeError(\"Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'\");\ng=r?new t(g):g||[]}for(var f=l=\"\",b=0,c=g.length|0,u=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=u?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=g[b]&255;switch(d>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=g[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=g[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):\n(m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=u?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}f+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(f=f.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,f.length<l.length)continue}else-1!==n&&(f+=z(n));l+=f;f=\"\"}return l};w.encode=function(g){g=void 0===g?\"\":\"\"+g;var l=g.length|\n0,f=new t((l<<1)+8|0),b,c=0,u=!r;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=g.charCodeAt(b)|0;if(127>=e)f[c]=e;else{if(2047>=e)f[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=g.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){f[c]=240|e>>18;f[c=c+1|0]=128|e>>12&63;f[c=c+1|0]=128|e>>6&63;f[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!u&&b<<1<c&&b<<1<(c-7|0)&&(u=!0,d=new t(3*l),d.set(f),f=d)}f[c]=224|e>>12;f[c=c+1|0]=128|e>>6&63}f[c=c+1|0]=128|e&63}}return r?\nf.subarray(0,c):f.slice(0,c)};E||(q.TextEncoder=y);F||(q.TextDecoder=x)})(\"\"+void 0==typeof global?\"\"+void 0==typeof self?this:self:global);//AnonyCo\n//# sourceMappingURL=https://cdn.jsdelivr.net/gh/davidliu/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map\n"]}
|
|
@@ -31,8 +31,6 @@ const LivekitReactNative = NativeModules.LivekitReactNative ? NativeModules.Live
|
|
|
31
31
|
*
|
|
32
32
|
* See {@link AndroidAudioTypePresets} for pre-configured values.
|
|
33
33
|
*
|
|
34
|
-
* NOTE: If `audioTypeOptions` is set, this must also be reflected in your android MainApplication setup.
|
|
35
|
-
*
|
|
36
34
|
* ----
|
|
37
35
|
* iOS
|
|
38
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AudioSession.ts"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","LivekitReactNative","Proxy","get","Error","AndroidAudioTypePresets","communication","manageAudioFocus","audioMode","audioFocusMode","audioStreamType","audioAttributesUsageType","audioAttributesContentType","media","getDefaultAppleAudioConfigurationForMode","mode","preferSpeakerOutput","audioCategory","audioCategoryOptions","AudioSession","config","configureAudio","startAudioSession","stopAudioSession","OS","getAudioOutputs","deviceId","selectAudioOutput","showAudioRoutePicker","setAppleAudioConfiguration"],"mappings":";;AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AACA,MAAMC,aAAa,GAChB,gFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,kBAAkB,GAAGN,aAAa,CAACM,kBAAd,GACvBN,aAAa,CAACM,kBADS,GAEvB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6GA,OAAO,MAAMQ,uB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ACD,C;;gBAVkBD,Y,uBAeQ,YAAY;AACrC,QAAMlB,kBAAkB,CAACqB,iBAAnB,EAAN;AACD,C;;gBAjBkBH,Y,sBAsBO,YAAY;AACpC,QAAMlB,kBAAkB,CAACsB,gBAAnB,EAAN;AACD,C;;gBAxBkBJ,Y,qBAkDM,YAA+B;AACtD,MAAIvB,QAAQ,CAAC4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAO,CAAC,SAAD,EAAY,eAAZ,CAAP;AACD,GAFD,MAEO,IAAI5B,QAAQ,CAAC4B,EAAT,KAAgB,SAApB,EAA+B;AACpC,WAAQ,MAAMvB,kBAAkB,CAACwB,eAAnB,EAAd;AACD,GAFM,MAEA;AACL,WAAO,EAAP;AACD;AACF,C;;gBA1DkBN,Y,uBAmEQ,MAAOO,QAAP,IAA4B;AACrD,QAAMzB,kBAAkB,CAAC0B,iBAAnB,CAAqCD,QAArC,CAAN;AACD,C;;gBArEkBP,Y,0BA4EW,YAAY;AACxC,MAAIvB,QAAQ,CAAC4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMvB,kBAAkB,CAAC2B,oBAAnB,EAAN;AACD;AACF,C;;gBAhFkBT,Y,gCAkFiB,MAClCC,MADkC,IAE/B;AACH,MAAIxB,QAAQ,CAAC4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMvB,kBAAkB,CAAC4B,0BAAnB,CAA8CT,MAA9C,CAAN;AACD;AACF,C","sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst LINKING_ERROR =\n `The package '@livekit/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst LivekitReactNative = NativeModules.LivekitReactNative\n ? NativeModules.LivekitReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n/**\n * Configuration for the underlying AudioSession.\n *\n * ----\n * Android specific options:\n *\n * * preferredOutputList - The preferred order in which to automatically select an audio output.\n * This is ignored when an output is manually selected with {@link AudioSession.selectAudioOutput}.\n *\n * By default, the order is set to:\n * 1. `\"bluetooth\"\n * 2. `\"headset\"``\n * 3. `\"speaker\"`\n * 4. `\"earpiece\"`\n *\n * * audioTypeOptions - An {@link AndroidAudioTypeOptions} object which provides the\n * audio options to use on Android.\n *\n * See {@link AndroidAudioTypePresets} for pre-configured values.\n *\n * NOTE: If `audioTypeOptions` is set, this must also be reflected in your android MainApplication setup.\n *\n * ----\n * iOS\n *\n * * defaultOutput - The default preferred output to use when a wired headset or bluetooth output is unavailable.\n *\n * By default, this is set to `\"speaker\"`\n */\nexport type AudioConfiguration = {\n android?: {\n preferredOutputList?: ('speaker' | 'earpiece' | 'headset' | 'bluetooth')[];\n audioTypeOptions: AndroidAudioTypeOptions;\n };\n ios?: {\n defaultOutput?: 'speaker' | 'earpiece';\n };\n};\n\nexport type AndroidAudioTypeOptions = {\n /**\n * Whether LiveKit should handle managing the audio focus or not.\n *\n * Defaults to true.\n */\n manageAudioFocus?: boolean;\n\n /**\n * Corresponds to {@link https://developer.android.com/reference/android/media/AudioManager#setMode(int)}\n *\n * Defaults to 'inCommunication'.\n */\n audioMode?:\n | 'normal'\n | 'callScreening'\n | 'inCall'\n | 'inCommunication'\n | 'ringtone';\n\n /**\n * Corresponds to the duration hint when requesting audio focus.\n *\n * Defaults to 'gain'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#AUDIOFOCUS_GAIN}\n */\n audioFocusMode?:\n | 'gain'\n | 'gainTransient'\n | 'gainTransientExclusive'\n | 'gainTransientMayDuck';\n\n /**\n * Corresponds to Android's AudioAttributes usage type.\n *\n * Defaults to 'voiceCommunication'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesUsageType?:\n | 'alarm'\n | 'assistanceAccessibility'\n | 'assistanceNavigationGuidance'\n | 'assistanceSonification'\n | 'assistant'\n | 'game'\n | 'media'\n | 'notification'\n | 'notificationEvent'\n | 'notificationRingtone'\n | 'unknown'\n | 'voiceCommunication'\n | 'voiceCommunicationSignalling';\n\n /**\n * Corresponds to Android's AndroidAttributes content type.\n *\n * Defaults to 'speech'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesContentType?:\n | 'movie'\n | 'music'\n | 'sonification'\n | 'speech'\n | 'unknown';\n\n /**\n * Corresponds to the stream type when requesting audio focus. Used on pre-O devices.\n *\n * Defaults to 'voiceCall'\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#STREAM_VOICE_CALL}\n */\n audioStreamType?:\n | 'accessibility'\n | 'alarm'\n | 'dtmf'\n | 'music'\n | 'notification'\n | 'ring'\n | 'system'\n | 'voiceCall';\n\n /**\n * On certain Android devices, audio routing does not function properly and\n * bluetooth microphones will not work unless audio mode is set to\n * `inCommunication` or `inCall`. Audio routing is turned off those cases.\n *\n * If this set to true, will attempt to do audio routing regardless of audio mode.\n *\n * Defaults to false.\n */\n forceHandleAudioRouting?: boolean;\n};\n\nexport const AndroidAudioTypePresets: {\n /**\n * A pre-configured AndroidAudioConfiguration for voice communication.\n */\n communication: AndroidAudioTypeOptions;\n /**\n * A pre-configured AndroidAudioConfiguration for media playback.\n */\n media: AndroidAudioTypeOptions;\n} = {\n communication: {\n manageAudioFocus: true,\n audioMode: 'inCommunication',\n audioFocusMode: 'gain',\n audioStreamType: 'voiceCall',\n audioAttributesUsageType: 'voiceCommunication',\n audioAttributesContentType: 'speech',\n },\n media: {\n manageAudioFocus: true,\n audioMode: 'normal',\n audioFocusMode: 'gain',\n audioStreamType: 'music',\n audioAttributesUsageType: 'media',\n audioAttributesContentType: 'unknown',\n },\n} as const;\n\nexport type AppleAudioMode =\n | 'default'\n | 'gameChat'\n | 'measurement'\n | 'moviePlayback'\n | 'spokenAudio'\n | 'videoChat'\n | 'videoRecording'\n | 'voiceChat'\n | 'voicePrompt';\n\nexport type AppleAudioCategory =\n | 'soloAmbient'\n | 'playback'\n | 'record'\n | 'playAndRecord'\n | 'multiRoute';\n\nexport type AppleAudioCategoryOption =\n | 'mixWithOthers'\n | 'duckOthers'\n | 'interruptSpokenAudioAndMixWithOthers'\n | 'allowBluetooth'\n | 'allowBluetoothA2DP'\n | 'allowAirPlay'\n | 'defaultToSpeaker';\n\nexport type AppleAudioConfiguration = {\n audioCategory?: AppleAudioCategory;\n audioCategoryOptions?: AppleAudioCategoryOption[];\n audioMode?: AppleAudioMode;\n};\n\nexport type AudioTrackState =\n | 'none'\n | 'remoteOnly'\n | 'localOnly'\n | 'localAndRemote';\n\nexport function getDefaultAppleAudioConfigurationForMode(\n mode: AudioTrackState,\n preferSpeakerOutput: boolean = true\n): AppleAudioConfiguration {\n if (mode === 'remoteOnly') {\n return {\n audioCategory: 'playback',\n audioCategoryOptions: ['mixWithOthers'],\n audioMode: 'spokenAudio',\n };\n } else if (mode === 'localAndRemote' || mode === 'localOnly') {\n return {\n audioCategory: 'playAndRecord',\n audioCategoryOptions: ['allowBluetooth', 'mixWithOthers'],\n audioMode: preferSpeakerOutput ? 'videoChat' : 'voiceChat',\n };\n }\n\n return {\n audioCategory: 'soloAmbient',\n audioCategoryOptions: [],\n audioMode: 'default',\n };\n}\n\nexport default class AudioSession {\n /**\n * Applies the provided audio configuration to the underlying AudioSession.\n *\n * Must be called prior to connecting to a Room for the configuration to apply correctly.\n *\n * See also useIOSAudioManagement for automatic configuration of iOS audio options.\n */\n static configureAudio = async (config: AudioConfiguration) => {\n await LivekitReactNative.configureAudio(config);\n };\n\n /**\n * Starts an AudioSession.\n */\n static startAudioSession = async () => {\n await LivekitReactNative.startAudioSession();\n };\n\n /**\n * Stops the existing AudioSession.\n */\n static stopAudioSession = async () => {\n await LivekitReactNative.stopAudioSession();\n };\n\n /**\n * Gets the available audio outputs for use with {@link selectAudioOutput}.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * For Android, will return if available:\n * * \"speaker\"\n * * \"earpiece\"\n * * \"headset\"\n * * \"bluetooth\"\n *\n * ----\n *\n * For iOS, due to OS limitations, the only available types are:\n * * \"default\" - Use default iOS audio routing\n * * \"force_speaker\" - Force audio output through speaker\n *\n * See also {@link showAudioRoutePicker} to display a route picker that\n * can choose between other audio devices (i.e. headset/bluetooth/airplay),\n * or use a library like `react-native-avroutepicker` for a native platform\n * control.\n *\n * @returns the available audio output types\n */\n static getAudioOutputs = async (): Promise<string[]> => {\n if (Platform.OS === 'ios') {\n return ['default', 'force_speaker'];\n } else if (Platform.OS === 'android') {\n return (await LivekitReactNative.getAudioOutputs()) as string[];\n } else {\n return [];\n }\n };\n\n /**\n * Select the provided audio output if available.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * @param deviceId A deviceId retrieved from {@link getAudioOutputs}\n */\n static selectAudioOutput = async (deviceId: string) => {\n await LivekitReactNative.selectAudioOutput(deviceId);\n };\n\n /**\n * iOS only, requires iOS 11+.\n *\n * Displays an AVRoutePickerView for the user to choose their audio output.\n */\n static showAudioRoutePicker = async () => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.showAudioRoutePicker();\n }\n };\n\n static setAppleAudioConfiguration = async (\n config: AppleAudioConfiguration\n ) => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.setAppleAudioConfiguration(config);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["AudioSession.ts"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","LivekitReactNative","Proxy","get","Error","AndroidAudioTypePresets","communication","manageAudioFocus","audioMode","audioFocusMode","audioStreamType","audioAttributesUsageType","audioAttributesContentType","media","getDefaultAppleAudioConfigurationForMode","mode","preferSpeakerOutput","audioCategory","audioCategoryOptions","AudioSession","config","configureAudio","startAudioSession","stopAudioSession","OS","getAudioOutputs","deviceId","selectAudioOutput","showAudioRoutePicker","setAppleAudioConfiguration"],"mappings":";;AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AACA,MAAMC,a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D;AACF,C;;gBAhFkBT,Y,gCAkFiB,MAClCC,MADkC,IAE/B;AACH,MAAIxB,QAAQ,CAAC4B,EAAT,KAAgB,KAApB,EAA2B;AACzB,UAAMvB,kBAAkB,CAAC4B,0BAAnB,CAA8CT,MAA9C,CAAN;AACD;AACF,C","sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst LINKING_ERROR =\n `The package '@livekit/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst LivekitReactNative = NativeModules.LivekitReactNative\n ? NativeModules.LivekitReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n/**\n * Configuration for the underlying AudioSession.\n *\n * ----\n * Android specific options:\n *\n * * preferredOutputList - The preferred order in which to automatically select an audio output.\n * This is ignored when an output is manually selected with {@link AudioSession.selectAudioOutput}.\n *\n * By default, the order is set to:\n * 1. `\"bluetooth\"\n * 2. `\"headset\"``\n * 3. `\"speaker\"`\n * 4. `\"earpiece\"`\n *\n * * audioTypeOptions - An {@link AndroidAudioTypeOptions} object which provides the\n * audio options to use on Android.\n *\n * See {@link AndroidAudioTypePresets} for pre-configured values.\n *\n * ----\n * iOS\n *\n * * defaultOutput - The default preferred output to use when a wired headset or bluetooth output is unavailable.\n *\n * By default, this is set to `\"speaker\"`\n */\nexport type AudioConfiguration = {\n android?: {\n preferredOutputList?: ('speaker' | 'earpiece' | 'headset' | 'bluetooth')[];\n audioTypeOptions: AndroidAudioTypeOptions;\n };\n ios?: {\n defaultOutput?: 'speaker' | 'earpiece';\n };\n};\n\nexport type AndroidAudioTypeOptions = {\n /**\n * Whether LiveKit should handle managing the audio focus or not.\n *\n * Defaults to true.\n */\n manageAudioFocus?: boolean;\n\n /**\n * Corresponds to {@link https://developer.android.com/reference/android/media/AudioManager#setMode(int)}\n *\n * Defaults to 'inCommunication'.\n */\n audioMode?:\n | 'normal'\n | 'callScreening'\n | 'inCall'\n | 'inCommunication'\n | 'ringtone';\n\n /**\n * Corresponds to the duration hint when requesting audio focus.\n *\n * Defaults to 'gain'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#AUDIOFOCUS_GAIN}\n */\n audioFocusMode?:\n | 'gain'\n | 'gainTransient'\n | 'gainTransientExclusive'\n | 'gainTransientMayDuck';\n\n /**\n * Corresponds to Android's AudioAttributes usage type.\n *\n * Defaults to 'voiceCommunication'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesUsageType?:\n | 'alarm'\n | 'assistanceAccessibility'\n | 'assistanceNavigationGuidance'\n | 'assistanceSonification'\n | 'assistant'\n | 'game'\n | 'media'\n | 'notification'\n | 'notificationEvent'\n | 'notificationRingtone'\n | 'unknown'\n | 'voiceCommunication'\n | 'voiceCommunicationSignalling';\n\n /**\n * Corresponds to Android's AndroidAttributes content type.\n *\n * Defaults to 'speech'.\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioAttributes}\n */\n audioAttributesContentType?:\n | 'movie'\n | 'music'\n | 'sonification'\n | 'speech'\n | 'unknown';\n\n /**\n * Corresponds to the stream type when requesting audio focus. Used on pre-O devices.\n *\n * Defaults to 'voiceCall'\n *\n * See also {@link https://developer.android.com/reference/android/media/AudioManager#STREAM_VOICE_CALL}\n */\n audioStreamType?:\n | 'accessibility'\n | 'alarm'\n | 'dtmf'\n | 'music'\n | 'notification'\n | 'ring'\n | 'system'\n | 'voiceCall';\n\n /**\n * On certain Android devices, audio routing does not function properly and\n * bluetooth microphones will not work unless audio mode is set to\n * `inCommunication` or `inCall`. Audio routing is turned off those cases.\n *\n * If this set to true, will attempt to do audio routing regardless of audio mode.\n *\n * Defaults to false.\n */\n forceHandleAudioRouting?: boolean;\n};\n\nexport const AndroidAudioTypePresets: {\n /**\n * A pre-configured AndroidAudioConfiguration for voice communication.\n */\n communication: AndroidAudioTypeOptions;\n /**\n * A pre-configured AndroidAudioConfiguration for media playback.\n */\n media: AndroidAudioTypeOptions;\n} = {\n communication: {\n manageAudioFocus: true,\n audioMode: 'inCommunication',\n audioFocusMode: 'gain',\n audioStreamType: 'voiceCall',\n audioAttributesUsageType: 'voiceCommunication',\n audioAttributesContentType: 'speech',\n },\n media: {\n manageAudioFocus: true,\n audioMode: 'normal',\n audioFocusMode: 'gain',\n audioStreamType: 'music',\n audioAttributesUsageType: 'media',\n audioAttributesContentType: 'unknown',\n },\n} as const;\n\nexport type AppleAudioMode =\n | 'default'\n | 'gameChat'\n | 'measurement'\n | 'moviePlayback'\n | 'spokenAudio'\n | 'videoChat'\n | 'videoRecording'\n | 'voiceChat'\n | 'voicePrompt';\n\nexport type AppleAudioCategory =\n | 'soloAmbient'\n | 'playback'\n | 'record'\n | 'playAndRecord'\n | 'multiRoute';\n\nexport type AppleAudioCategoryOption =\n | 'mixWithOthers'\n | 'duckOthers'\n | 'interruptSpokenAudioAndMixWithOthers'\n | 'allowBluetooth'\n | 'allowBluetoothA2DP'\n | 'allowAirPlay'\n | 'defaultToSpeaker';\n\nexport type AppleAudioConfiguration = {\n audioCategory?: AppleAudioCategory;\n audioCategoryOptions?: AppleAudioCategoryOption[];\n audioMode?: AppleAudioMode;\n};\n\nexport type AudioTrackState =\n | 'none'\n | 'remoteOnly'\n | 'localOnly'\n | 'localAndRemote';\n\nexport function getDefaultAppleAudioConfigurationForMode(\n mode: AudioTrackState,\n preferSpeakerOutput: boolean = true\n): AppleAudioConfiguration {\n if (mode === 'remoteOnly') {\n return {\n audioCategory: 'playback',\n audioCategoryOptions: ['mixWithOthers'],\n audioMode: 'spokenAudio',\n };\n } else if (mode === 'localAndRemote' || mode === 'localOnly') {\n return {\n audioCategory: 'playAndRecord',\n audioCategoryOptions: ['allowBluetooth', 'mixWithOthers'],\n audioMode: preferSpeakerOutput ? 'videoChat' : 'voiceChat',\n };\n }\n\n return {\n audioCategory: 'soloAmbient',\n audioCategoryOptions: [],\n audioMode: 'default',\n };\n}\n\nexport default class AudioSession {\n /**\n * Applies the provided audio configuration to the underlying AudioSession.\n *\n * Must be called prior to connecting to a Room for the configuration to apply correctly.\n *\n * See also useIOSAudioManagement for automatic configuration of iOS audio options.\n */\n static configureAudio = async (config: AudioConfiguration) => {\n await LivekitReactNative.configureAudio(config);\n };\n\n /**\n * Starts an AudioSession.\n */\n static startAudioSession = async () => {\n await LivekitReactNative.startAudioSession();\n };\n\n /**\n * Stops the existing AudioSession.\n */\n static stopAudioSession = async () => {\n await LivekitReactNative.stopAudioSession();\n };\n\n /**\n * Gets the available audio outputs for use with {@link selectAudioOutput}.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * For Android, will return if available:\n * * \"speaker\"\n * * \"earpiece\"\n * * \"headset\"\n * * \"bluetooth\"\n *\n * ----\n *\n * For iOS, due to OS limitations, the only available types are:\n * * \"default\" - Use default iOS audio routing\n * * \"force_speaker\" - Force audio output through speaker\n *\n * See also {@link showAudioRoutePicker} to display a route picker that\n * can choose between other audio devices (i.e. headset/bluetooth/airplay),\n * or use a library like `react-native-avroutepicker` for a native platform\n * control.\n *\n * @returns the available audio output types\n */\n static getAudioOutputs = async (): Promise<string[]> => {\n if (Platform.OS === 'ios') {\n return ['default', 'force_speaker'];\n } else if (Platform.OS === 'android') {\n return (await LivekitReactNative.getAudioOutputs()) as string[];\n } else {\n return [];\n }\n };\n\n /**\n * Select the provided audio output if available.\n *\n * {@link startAudioSession} must be called prior to using this method.\n *\n * @param deviceId A deviceId retrieved from {@link getAudioOutputs}\n */\n static selectAudioOutput = async (deviceId: string) => {\n await LivekitReactNative.selectAudioOutput(deviceId);\n };\n\n /**\n * iOS only, requires iOS 11+.\n *\n * Displays an AVRoutePickerView for the user to choose their audio output.\n */\n static showAudioRoutePicker = async () => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.showAudioRoutePicker();\n }\n };\n\n static setAppleAudioConfiguration = async (\n config: AppleAudioConfiguration\n ) => {\n if (Platform.OS === 'ios') {\n await LivekitReactNative.setAppleAudioConfiguration(config);\n }\n };\n}\n"]}
|
package/lib/module/hooks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, UseLocalParticipantOptions, useLocalParticipantPermissions, useParticipantInfo, UseParticipantInfoOptions, useParticipants, UseParticipantsOptions, useRemoteParticipants, UseRemoteParticipantOptions, useRemoteParticipant, UseRemoteParticipantsOptions, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, UseTracksOptions, TrackReference, TrackReferenceOrPlaceholder, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate, UseVisualStableUpdateOptions } from '@livekit/components-react';
|
|
1
|
+
export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, UseLocalParticipantOptions, useLocalParticipantPermissions, useParticipantInfo, UseParticipantInfoOptions, useParticipants, UseParticipantsOptions, useRemoteParticipants, UseRemoteParticipantOptions, useRemoteParticipant, UseRemoteParticipantsOptions, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useRoomInfo, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, UseTracksOptions, TrackReference, TrackReferenceOrPlaceholder, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate, UseVisualStableUpdateOptions } from '@livekit/components-react';
|
|
2
2
|
export { ReceivedDataMessage } from '@livekit/components-core';
|
|
3
3
|
//# sourceMappingURL=hooks.js.map
|
package/lib/module/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks.ts"],"names":["useConnectionState","useDataChannel","useIsSpeaking","useLocalParticipant","UseLocalParticipantOptions","useLocalParticipantPermissions","useParticipantInfo","UseParticipantInfoOptions","useParticipants","UseParticipantsOptions","useRemoteParticipants","UseRemoteParticipantOptions","useRemoteParticipant","UseRemoteParticipantsOptions","useSpeakingParticipants","useSortedParticipants","useChat","useIsEncrypted","useIsMuted","useParticipantTracks","useLiveKitRoom","RoomContext","useRoomContext","ParticipantContext","useParticipantContext","TrackRefContext","useTrackRefContext","useTracks","UseTracksOptions","TrackReference","TrackReferenceOrPlaceholder","isTrackReference","useEnsureTrackRef","useTrackMutedIndicator","useVisualStableUpdate","UseVisualStableUpdateOptions","ReceivedDataMessage"],"mappings":"AAAA,SACEA,kBADF,EAEEC,cAFF,EAGEC,aAHF,EAIEC,mBAJF,EAKEC,0BALF,EAMEC,8BANF,EAOEC,kBAPF,EAQEC,yBARF,EASEC,eATF,EAUEC,sBAVF,EAWEC,qBAXF,EAYEC,2BAZF,EAaEC,oBAbF,EAcEC,4BAdF,EAeEC,uBAfF,EAgBEC,qBAhBF,EAiBEC,OAjBF,EAkBEC,cAlBF,EAmBEC,
|
|
1
|
+
{"version":3,"sources":["hooks.ts"],"names":["useConnectionState","useDataChannel","useIsSpeaking","useLocalParticipant","UseLocalParticipantOptions","useLocalParticipantPermissions","useParticipantInfo","UseParticipantInfoOptions","useParticipants","UseParticipantsOptions","useRemoteParticipants","UseRemoteParticipantOptions","useRemoteParticipant","UseRemoteParticipantsOptions","useSpeakingParticipants","useSortedParticipants","useChat","useIsEncrypted","useRoomInfo","useIsMuted","useParticipantTracks","useLiveKitRoom","RoomContext","useRoomContext","ParticipantContext","useParticipantContext","TrackRefContext","useTrackRefContext","useTracks","UseTracksOptions","TrackReference","TrackReferenceOrPlaceholder","isTrackReference","useEnsureTrackRef","useTrackMutedIndicator","useVisualStableUpdate","UseVisualStableUpdateOptions","ReceivedDataMessage"],"mappings":"AAAA,SACEA,kBADF,EAEEC,cAFF,EAGEC,aAHF,EAIEC,mBAJF,EAKEC,0BALF,EAMEC,8BANF,EAOEC,kBAPF,EAQEC,yBARF,EASEC,eATF,EAUEC,sBAVF,EAWEC,qBAXF,EAYEC,2BAZF,EAaEC,oBAbF,EAcEC,4BAdF,EAeEC,uBAfF,EAgBEC,qBAhBF,EAiBEC,OAjBF,EAkBEC,cAlBF,EAmBEC,WAnBF,EAoBEC,UApBF,EAqBEC,oBArBF,EAsBEC,cAtBF,EAuBEC,WAvBF,EAwBEC,cAxBF,EAyBEC,kBAzBF,EA0BEC,qBA1BF,EA2BEC,eA3BF,EA4BEC,kBA5BF,EA6BEC,SA7BF,EA8BEC,gBA9BF,EA+BEC,cA/BF,EAgCEC,2BAhCF,EAiCEC,gBAjCF,EAkCEC,iBAlCF,EAmCEC,sBAnCF,EAoCEC,qBApCF,EAqCEC,4BArCF,QAsCO,2BAtCP;AAwCA,SAASC,mBAAT,QAAoC,0BAApC","sourcesContent":["export {\n useConnectionState,\n useDataChannel,\n useIsSpeaking,\n useLocalParticipant,\n UseLocalParticipantOptions,\n useLocalParticipantPermissions,\n useParticipantInfo,\n UseParticipantInfoOptions,\n useParticipants,\n UseParticipantsOptions,\n useRemoteParticipants,\n UseRemoteParticipantOptions,\n useRemoteParticipant,\n UseRemoteParticipantsOptions,\n useSpeakingParticipants,\n useSortedParticipants,\n useChat,\n useIsEncrypted,\n useRoomInfo,\n useIsMuted,\n useParticipantTracks,\n useLiveKitRoom,\n RoomContext,\n useRoomContext,\n ParticipantContext,\n useParticipantContext,\n TrackRefContext,\n useTrackRefContext,\n useTracks,\n UseTracksOptions,\n TrackReference,\n TrackReferenceOrPlaceholder,\n isTrackReference,\n useEnsureTrackRef,\n useTrackMutedIndicator,\n useVisualStableUpdate,\n UseVisualStableUpdateOptions,\n} from '@livekit/components-react';\n\nexport { ReceivedDataMessage } from '@livekit/components-core';\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';
|
|
2
2
|
import { setupURLPolyfill } from 'react-native-url-polyfill';
|
|
3
|
-
import '
|
|
3
|
+
import './polyfills/EncoderDecoderTogether.min.js';
|
|
4
4
|
import AudioSession, { AndroidAudioTypePresets, AndroidAudioTypeOptions, AppleAudioCategory, AppleAudioCategoryOption, AppleAudioConfiguration, AppleAudioMode, AudioTrackState, getDefaultAppleAudioConfigurationForMode } from './audio/AudioSession';
|
|
5
5
|
import { PixelRatio, Platform } from 'react-native';
|
|
6
6
|
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["registerGlobals","webrtcRegisterGlobals","setupURLPolyfill","AudioSession","AndroidAudioTypePresets","AndroidAudioTypeOptions","AppleAudioCategory","AppleAudioCategoryOption","AppleAudioConfiguration","AppleAudioMode","AudioTrackState","getDefaultAppleAudioConfigurationForMode","PixelRatio","Platform","livekitRegisterGlobals","fixWebrtcAdapter","shimPromiseAllSettled","shimArrayAt","shimAsyncIterator","shimIterator","lkGlobal","platform","OS","devicePixelRatio","get","global","LiveKitReactNativeGlobal","window","navigator","undefined","userAgent","product","allSettled","require","shim","Array","prototype","at"],"mappings":"AAAA,SAASA,eAAe,IAAIC,qBAA5B,QAAyD,8BAAzD;AACA,SAASC,gBAAT,QAAiC,2BAAjC;AACA,OAAO,
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["registerGlobals","webrtcRegisterGlobals","setupURLPolyfill","AudioSession","AndroidAudioTypePresets","AndroidAudioTypeOptions","AppleAudioCategory","AppleAudioCategoryOption","AppleAudioConfiguration","AppleAudioMode","AudioTrackState","getDefaultAppleAudioConfigurationForMode","PixelRatio","Platform","livekitRegisterGlobals","fixWebrtcAdapter","shimPromiseAllSettled","shimArrayAt","shimAsyncIterator","shimIterator","lkGlobal","platform","OS","devicePixelRatio","get","global","LiveKitReactNativeGlobal","window","navigator","undefined","userAgent","product","allSettled","require","shim","Array","prototype","at"],"mappings":"AAAA,SAASA,eAAe,IAAIC,qBAA5B,QAAyD,8BAAzD;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AAIA,EAAE,GAAGJ,OAAO,CAAC,oBAAD,CAAhB;;AACAI,IAAAA,EAAE,CAACH,IAAH;AACD;AACF;;AAED,SAAShB,iBAAT,GAA6B;AAC3B,MAAIgB,IAAI,GAAGD,OAAO,CAAC,8CAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL;;AAED,SAASf,YAAT,GAAwB;AACtB,MAAIe,IAAI,GAAGD,OAAO,CAAC,yCAAD,CAAlB;;AACAC,EAAAA,IAAI;AACL;;AACD,cAAc,SAAd;AACA,cAAc,0BAAd;AACA,cAAc,yBAAd;AACA,cAAc,wBAAd,C,CAAwC;;AACxC,cAAc,kBAAd,C,CAAkC;;AAClC,cAAc,WAAd,C,CAA2B;;AAC3B,cAAc,UAAd;AACA,cAAc,sBAAd;AAEA,SACE/B,YADF,EAGEE,uBAHF,EAIED,uBAJF,EAKEE,kBALF,EAMEC,wBANF,EAOEC,uBAPF,EAQEC,cARF,EASEC,eATF,EAUEC,wCAVF","sourcesContent":["import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';\nimport { setupURLPolyfill } from 'react-native-url-polyfill';\nimport './polyfills/EncoderDecoderTogether.min.js';\nimport AudioSession, {\n AndroidAudioTypePresets,\n AndroidAudioTypeOptions,\n AppleAudioCategory,\n AppleAudioCategoryOption,\n AppleAudioConfiguration,\n AppleAudioMode,\n AudioTrackState,\n getDefaultAppleAudioConfigurationForMode,\n} from './audio/AudioSession';\nimport type { AudioConfiguration } from './audio/AudioSession';\nimport { PixelRatio, Platform } from 'react-native';\nimport type { LiveKitReactNativeInfo } from 'livekit-client';\nimport type { LogLevel, SetLogLevelOptions } from './logger';\n\n/**\n * Registers the required globals needed for LiveKit to work.\n *\n * Must be called before using LiveKit.\n */\nexport function registerGlobals() {\n webrtcRegisterGlobals();\n livekitRegisterGlobals();\n setupURLPolyfill();\n fixWebrtcAdapter();\n shimPromiseAllSettled();\n shimArrayAt();\n shimAsyncIterator();\n shimIterator();\n}\nfunction livekitRegisterGlobals() {\n let lkGlobal: LiveKitReactNativeInfo = {\n platform: Platform.OS,\n devicePixelRatio: PixelRatio.get(),\n };\n\n // @ts-ignore\n global.LiveKitReactNativeGlobal = lkGlobal;\n}\n\nfunction fixWebrtcAdapter() {\n // @ts-ignore\n if (window?.navigator !== undefined) {\n // @ts-ignore\n const { navigator } = window;\n if (navigator.userAgent === undefined) {\n navigator.userAgent = navigator.product ?? 'Unknown';\n }\n }\n}\n\nfunction shimPromiseAllSettled() {\n var allSettled = require('promise.allsettled');\n allSettled.shim();\n}\n\nfunction shimArrayAt() {\n // Some versions of RN don't have Array.prototype.at, which is used by sdp-transform\n if (!Array.prototype.at) {\n var at = require('array.prototype.at');\n at.shim();\n }\n}\n\nfunction shimAsyncIterator() {\n var shim = require('well-known-symbols/Symbol.asyncIterator/shim');\n shim();\n}\n\nfunction shimIterator() {\n var shim = require('well-known-symbols/Symbol.iterator/shim');\n shim();\n}\nexport * from './hooks';\nexport * from './components/LiveKitRoom';\nexport * from './components/VideoTrack';\nexport * from './components/VideoView'; // deprecated\nexport * from './useParticipant'; // deprecated\nexport * from './useRoom'; // deprecated\nexport * from './logger';\nexport * from './audio/AudioManager';\n\nexport {\n AudioSession,\n AudioConfiguration,\n AndroidAudioTypeOptions,\n AndroidAudioTypePresets,\n AppleAudioCategory,\n AppleAudioCategoryOption,\n AppleAudioConfiguration,\n AppleAudioMode,\n AudioTrackState,\n getDefaultAppleAudioConfigurationForMode,\n LogLevel,\n SetLogLevelOptions,\n};\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
(function (q) {
|
|
4
|
+
function x() {}
|
|
5
|
+
|
|
6
|
+
function y() {}
|
|
7
|
+
|
|
8
|
+
var z = String.fromCharCode,
|
|
9
|
+
v = {}.toString,
|
|
10
|
+
A = v.call(q.SharedArrayBuffer),
|
|
11
|
+
B = v(),
|
|
12
|
+
r = q.Uint8Array,
|
|
13
|
+
t = r || Array,
|
|
14
|
+
w = r ? ArrayBuffer : t,
|
|
15
|
+
C = w.isView || function (g) {
|
|
16
|
+
return g && "length" in g;
|
|
17
|
+
},
|
|
18
|
+
D = v.call(w.prototype);
|
|
19
|
+
|
|
20
|
+
w = y.prototype;
|
|
21
|
+
var E = q.TextEncoder,
|
|
22
|
+
F = q.TextDecoder,
|
|
23
|
+
a = new (r ? Uint16Array : t)(32);
|
|
24
|
+
|
|
25
|
+
x.prototype.decode = function (g) {
|
|
26
|
+
if (!C(g)) {
|
|
27
|
+
var l = v.call(g);
|
|
28
|
+
if (l !== D && l !== A && l !== B) throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
29
|
+
g = r ? new t(g) : g || [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (var f = l = "", b = 0, c = g.length | 0, u = c - 32 | 0, e, d, h = 0, p = 0, m, k = 0, n = -1; b < c;) {
|
|
33
|
+
for (e = b <= u ? 32 : c - b | 0; k < e; b = b + 1 | 0, k = k + 1 | 0) {
|
|
34
|
+
d = g[b] & 255;
|
|
35
|
+
|
|
36
|
+
switch (d >> 4) {
|
|
37
|
+
case 15:
|
|
38
|
+
m = g[b = b + 1 | 0] & 255;
|
|
39
|
+
|
|
40
|
+
if (2 !== m >> 6 || 247 < d) {
|
|
41
|
+
b = b - 1 | 0;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h = (d & 7) << 6 | m & 63;
|
|
46
|
+
p = 5;
|
|
47
|
+
d = 256;
|
|
48
|
+
|
|
49
|
+
case 14:
|
|
50
|
+
m = g[b = b + 1 | 0] & 255, h <<= 6, h |= (d & 15) << 6 | m & 63, p = 2 === m >> 6 ? p + 4 | 0 : 24, d = d + 256 & 768;
|
|
51
|
+
|
|
52
|
+
case 13:
|
|
53
|
+
case 12:
|
|
54
|
+
m = g[b = b + 1 | 0] & 255, h <<= 6, h |= (d & 31) << 6 | m & 63, p = p + 7 | 0, b < c && 2 === m >> 6 && h >> p && 1114112 > h ? (d = h, h = h - 65536 | 0, 0 <= h && (n = (h >> 10) + 55296 | 0, d = (h & 1023) + 56320 | 0, 31 > k ? (a[k] = n, k = k + 1 | 0, n = -1) : (m = n, n = d, d = m))) : (d >>= 8, b = b - d - 1 | 0, d = 65533), h = p = 0, e = b <= u ? 32 : c - b | 0;
|
|
55
|
+
|
|
56
|
+
default:
|
|
57
|
+
a[k] = d;
|
|
58
|
+
continue;
|
|
59
|
+
|
|
60
|
+
case 11:
|
|
61
|
+
case 10:
|
|
62
|
+
case 9:
|
|
63
|
+
case 8:
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a[k] = 65533;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
f += z(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20], a[21], a[22], a[23], a[24], a[25], a[26], a[27], a[28], a[29], a[30], a[31]);
|
|
70
|
+
32 > k && (f = f.slice(0, k - 32 | 0));
|
|
71
|
+
|
|
72
|
+
if (b < c) {
|
|
73
|
+
if (a[0] = n, k = ~n >>> 31, n = -1, f.length < l.length) continue;
|
|
74
|
+
} else -1 !== n && (f += z(n));
|
|
75
|
+
|
|
76
|
+
l += f;
|
|
77
|
+
f = "";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return l;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
w.encode = function (g) {
|
|
84
|
+
g = void 0 === g ? "" : "" + g;
|
|
85
|
+
var l = g.length | 0,
|
|
86
|
+
f = new t((l << 1) + 8 | 0),
|
|
87
|
+
b,
|
|
88
|
+
c = 0,
|
|
89
|
+
u = !r;
|
|
90
|
+
|
|
91
|
+
for (b = 0; b < l; b = b + 1 | 0, c = c + 1 | 0) {
|
|
92
|
+
var e = g.charCodeAt(b) | 0;
|
|
93
|
+
if (127 >= e) f[c] = e;else {
|
|
94
|
+
if (2047 >= e) f[c] = 192 | e >> 6;else {
|
|
95
|
+
a: {
|
|
96
|
+
if (55296 <= e) if (56319 >= e) {
|
|
97
|
+
var d = g.charCodeAt(b = b + 1 | 0) | 0;
|
|
98
|
+
|
|
99
|
+
if (56320 <= d && 57343 >= d) {
|
|
100
|
+
e = (e << 10) + d - 56613888 | 0;
|
|
101
|
+
|
|
102
|
+
if (65535 < e) {
|
|
103
|
+
f[c] = 240 | e >> 18;
|
|
104
|
+
f[c = c + 1 | 0] = 128 | e >> 12 & 63;
|
|
105
|
+
f[c = c + 1 | 0] = 128 | e >> 6 & 63;
|
|
106
|
+
f[c = c + 1 | 0] = 128 | e & 63;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
break a;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
e = 65533;
|
|
114
|
+
} else 57343 >= e && (e = 65533);
|
|
115
|
+
!u && b << 1 < c && b << 1 < (c - 7 | 0) && (u = !0, d = new t(3 * l), d.set(f), f = d);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
f[c] = 224 | e >> 12;
|
|
119
|
+
f[c = c + 1 | 0] = 128 | e >> 6 & 63;
|
|
120
|
+
}
|
|
121
|
+
f[c = c + 1 | 0] = 128 | e & 63;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return r ? f.subarray(0, c) : f.slice(0, c);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
E || (q.TextEncoder = y);
|
|
129
|
+
F || (q.TextDecoder = x);
|
|
130
|
+
})("" + void 0 == typeof global ? "" + void 0 == typeof self ? this : self : global); //AnonyCo
|
|
131
|
+
//# sourceMappingURL=EncoderDecoderTogether.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["EncoderDecoderTogether.min.js"],"names":["q","x","y","z","String","fromCharCode","v","toString","A","call","SharedArrayBuffer","B","r","Uint8Array","t","Array","w","ArrayBuffer","C","isView","g","D","prototype","E","TextEncoder","F","TextDecoder","a","Uint16Array","decode","l","TypeError","f","b","c","length","u","e","d","h","p","m","k","n","slice","encode","charCodeAt","set","subarray","global","self"],"mappings":"AAAA;;AAAa,CAAC,UAASA,CAAT,EAAW;AAAC,WAASC,CAAT,GAAY,CAAE;;AAAA,WAASC,CAAT,GAAY,CAAE;;AAAA,MAAIC,CAAC,GAACC,MAAM,CAACC,YAAb;AAAA,MAA0BC,CAAC,GAAC,GAAGC,QAA/B;AAAA,MAAwCC,CAAC,GAACF,CAAC,CAACG,IAAF,CAAOT,CAAC,CAACU,iBAAT,CAA1C;AAAA,MAAsEC,CAAC,GAACL,CAAC,EAAzE;AAAA,MAA4EM,CAAC,GAACZ,CAAC,CAACa,UAAhF;AAAA,MAA2FC,CAAC,GAACF,CAAC,IAAEG,KAAhG;AAAA,MAAsGC,CAAC,GAACJ,CAAC,GAACK,WAAD,GAAaH,CAAtH;AAAA,MAAwHI,CAAC,GAACF,CAAC,CAACG,MAAF,IAAU,UAASC,CAAT,EAAW;AAAC,WAAOA,CAAC,IAAE,YAAWA,CAArB;AAAuB,GAAvK;AAAA,MAAwKC,CAAC,GAACf,CAAC,CAACG,IAAF,CAAOO,CAAC,CAACM,SAAT,CAA1K;;AAA8LN,EAAAA,CAAC,GAACd,CAAC,CAACoB,SAAJ;AAAc,MAAIC,CAAC,GAACvB,CAAC,CAACwB,WAAR;AAAA,MAAoBC,CAAC,GAACzB,CAAC,CAAC0B,WAAxB;AAAA,MAAoCC,CAAC,GAAC,KAAKf,CAAC,GAACgB,WAAD,GAAad,CAAnB,EAAsB,EAAtB,CAAtC;;AAAgEb,EAAAA,CAAC,CAACqB,SAAF,CAAYO,MAAZ,GAAmB,UAAST,CAAT,EAAW;AAAC,QAAG,CAACF,CAAC,CAACE,CAAD,CAAL,EAAS;AAAC,UAAIU,CAAC,GAACxB,CAAC,CAACG,IAAF,CAAOW,CAAP,CAAN;AAAgB,UAAGU,CAAC,KA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AAG,KAAK,CAAR,IAAW,OAAOgD,MAAlB,GAAyB,KAAG,KAAK,CAAR,IAAW,OAAOC,IAAlB,GAAuB,IAAvB,GAA4BA,IAArD,GAA0DD,MAJvH,E,CAI+H","sourcesContent":["'use strict';(function(q){function x(){}function y(){}var z=String.fromCharCode,v={}.toString,A=v.call(q.SharedArrayBuffer),B=v(),r=q.Uint8Array,t=r||Array,w=r?ArrayBuffer:t,C=w.isView||function(g){return g&&\"length\"in g},D=v.call(w.prototype);w=y.prototype;var E=q.TextEncoder,F=q.TextDecoder,a=new (r?Uint16Array:t)(32);x.prototype.decode=function(g){if(!C(g)){var l=v.call(g);if(l!==D&&l!==A&&l!==B)throw TypeError(\"Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'\");\ng=r?new t(g):g||[]}for(var f=l=\"\",b=0,c=g.length|0,u=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=u?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=g[b]&255;switch(d>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=g[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=g[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):\n(m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=u?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}f+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(f=f.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,f.length<l.length)continue}else-1!==n&&(f+=z(n));l+=f;f=\"\"}return l};w.encode=function(g){g=void 0===g?\"\":\"\"+g;var l=g.length|\n0,f=new t((l<<1)+8|0),b,c=0,u=!r;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=g.charCodeAt(b)|0;if(127>=e)f[c]=e;else{if(2047>=e)f[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=g.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){f[c]=240|e>>18;f[c=c+1|0]=128|e>>12&63;f[c=c+1|0]=128|e>>6&63;f[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!u&&b<<1<c&&b<<1<(c-7|0)&&(u=!0,d=new t(3*l),d.set(f),f=d)}f[c]=224|e>>12;f[c=c+1|0]=128|e>>6&63}f[c=c+1|0]=128|e&63}}return r?\nf.subarray(0,c):f.slice(0,c)};E||(q.TextEncoder=y);F||(q.TextDecoder=x)})(\"\"+void 0==typeof global?\"\"+void 0==typeof self?this:self:global);//AnonyCo\n//# sourceMappingURL=https://cdn.jsdelivr.net/gh/davidliu/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, UseLocalParticipantOptions, useLocalParticipantPermissions, useParticipantInfo, UseParticipantInfoOptions, useParticipants, UseParticipantsOptions, useRemoteParticipants, UseRemoteParticipantOptions, useRemoteParticipant, UseRemoteParticipantsOptions, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, UseTracksOptions, TrackReference, TrackReferenceOrPlaceholder, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate, UseVisualStableUpdateOptions, } from '@livekit/components-react';
|
|
1
|
+
export { useConnectionState, useDataChannel, useIsSpeaking, useLocalParticipant, UseLocalParticipantOptions, useLocalParticipantPermissions, useParticipantInfo, UseParticipantInfoOptions, useParticipants, UseParticipantsOptions, useRemoteParticipants, UseRemoteParticipantOptions, useRemoteParticipant, UseRemoteParticipantsOptions, useSpeakingParticipants, useSortedParticipants, useChat, useIsEncrypted, useRoomInfo, useIsMuted, useParticipantTracks, useLiveKitRoom, RoomContext, useRoomContext, ParticipantContext, useParticipantContext, TrackRefContext, useTrackRefContext, useTracks, UseTracksOptions, TrackReference, TrackReferenceOrPlaceholder, isTrackReference, useEnsureTrackRef, useTrackMutedIndicator, useVisualStableUpdate, UseVisualStableUpdateOptions, } from '@livekit/components-react';
|
|
2
2
|
export { ReceivedDataMessage } from '@livekit/components-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import './polyfills/EncoderDecoderTogether.min.js';
|
|
2
2
|
import AudioSession, { AndroidAudioTypePresets, AndroidAudioTypeOptions, AppleAudioCategory, AppleAudioCategoryOption, AppleAudioConfiguration, AppleAudioMode, AudioTrackState, getDefaultAppleAudioConfigurationForMode } from './audio/AudioSession';
|
|
3
3
|
import type { AudioConfiguration } from './audio/AudioSession';
|
|
4
4
|
import type { LogLevel, SetLogLevelOptions } from './logger';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livekit/react-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "LiveKit for React Native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@livekit/components-react": "^2.0.6",
|
|
46
46
|
"array.prototype.at": "^1.1.1",
|
|
47
|
-
"fastestsmallesttextencoderdecoder": "^1.0.22",
|
|
48
47
|
"livekit-client": "^2.0.0",
|
|
49
48
|
"loglevel": "^1.8.0",
|
|
50
49
|
"promise.allsettled": "^1.0.5",
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
"typescript": "4.8.4"
|
|
82
81
|
},
|
|
83
82
|
"peerDependencies": {
|
|
84
|
-
"@livekit/react-native-webrtc": "^114.1.
|
|
83
|
+
"@livekit/react-native-webrtc": "^114.1.3",
|
|
85
84
|
"react": "*",
|
|
86
85
|
"react-native": "*"
|
|
87
86
|
},
|
|
@@ -36,8 +36,6 @@ const LivekitReactNative = NativeModules.LivekitReactNative
|
|
|
36
36
|
*
|
|
37
37
|
* See {@link AndroidAudioTypePresets} for pre-configured values.
|
|
38
38
|
*
|
|
39
|
-
* NOTE: If `audioTypeOptions` is set, this must also be reflected in your android MainApplication setup.
|
|
40
|
-
*
|
|
41
39
|
* ----
|
|
42
40
|
* iOS
|
|
43
41
|
*
|
package/src/hooks.ts
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';
|
|
2
2
|
import { setupURLPolyfill } from 'react-native-url-polyfill';
|
|
3
|
-
import '
|
|
3
|
+
import './polyfills/EncoderDecoderTogether.min.js';
|
|
4
4
|
import AudioSession, {
|
|
5
5
|
AndroidAudioTypePresets,
|
|
6
6
|
AndroidAudioTypeOptions,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';(function(q){function x(){}function y(){}var z=String.fromCharCode,v={}.toString,A=v.call(q.SharedArrayBuffer),B=v(),r=q.Uint8Array,t=r||Array,w=r?ArrayBuffer:t,C=w.isView||function(g){return g&&"length"in g},D=v.call(w.prototype);w=y.prototype;var E=q.TextEncoder,F=q.TextDecoder,a=new (r?Uint16Array:t)(32);x.prototype.decode=function(g){if(!C(g)){var l=v.call(g);if(l!==D&&l!==A&&l!==B)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
2
|
+
g=r?new t(g):g||[]}for(var f=l="",b=0,c=g.length|0,u=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=u?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=g[b]&255;switch(d>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=g[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=g[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):
|
|
3
|
+
(m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=u?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}f+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(f=f.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,f.length<l.length)continue}else-1!==n&&(f+=z(n));l+=f;f=""}return l};w.encode=function(g){g=void 0===g?"":""+g;var l=g.length|
|
|
4
|
+
0,f=new t((l<<1)+8|0),b,c=0,u=!r;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=g.charCodeAt(b)|0;if(127>=e)f[c]=e;else{if(2047>=e)f[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=g.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){f[c]=240|e>>18;f[c=c+1|0]=128|e>>12&63;f[c=c+1|0]=128|e>>6&63;f[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!u&&b<<1<c&&b<<1<(c-7|0)&&(u=!0,d=new t(3*l),d.set(f),f=d)}f[c]=224|e>>12;f[c=c+1|0]=128|e>>6&63}f[c=c+1|0]=128|e&63}}return r?
|
|
5
|
+
f.subarray(0,c):f.slice(0,c)};E||(q.TextEncoder=y);F||(q.TextDecoder=x)})(""+void 0==typeof global?""+void 0==typeof self?this:self:global);//AnonyCo
|
|
6
|
+
//# sourceMappingURL=https://cdn.jsdelivr.net/gh/davidliu/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map
|