livevoice-sdk-react-native 1.0.2 → 2.0.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/LICENSE +1 -1
- package/README.md +5 -5
- package/android/{generated/java/io/livevoice/react → app/build/generated/source/codegen/java/com/facebook/fbreact/specs}/NativeLiveVoiceSdkSpec.java +2 -2
- package/android/{generated → app/build/generated/source/codegen}/jni/CMakeLists.txt +1 -9
- package/android/{generated → app/build/generated/source/codegen}/jni/RNLiveVoiceSpec-generated.cpp +3 -3
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +341 -0
- package/android/build.gradle +41 -84
- package/android/gradle.properties +10 -6
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +17 -16
- package/android/src/main/java/io/livevoice/react/LiveVoiceSdkReactNativePackage.kt +12 -13
- package/android/src/main/java/io/livevoice/react/Mappings.kt +36 -5
- package/android/src/main/java/io/livevoice/react/NativeModels.kt +2 -0
- package/android/src/main/java/io/livevoice/react/__SDK.kt +1 -1
- package/ios/LiveVoiceSdkReactNative.h +5 -5
- package/ios/{LivevoiceSdkReactNative.mm → LiveVoiceSdkReactNative.mm} +59 -74
- package/ios/__SDK.h +1 -1
- package/lib/module/components/AudioOutputSwitchView.js +5 -1
- package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
- package/lib/module/components/ChannelView.js +14 -38
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/LiveVoiceView.js +61 -26
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PlayButtonView.js +243 -84
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/icons/captions@1x.png +0 -0
- package/lib/module/icons/captions@2x.png +0 -0
- package/lib/module/icons/pause@1x.png +0 -0
- package/lib/module/icons/pause@2x.png +0 -0
- package/lib/module/icons/play@1x.png +0 -0
- package/lib/module/icons/play@2x.png +0 -0
- package/lib/module/index.js +27 -21
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeLiveVoiceSdk.js +4 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +2 -1
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +1 -0
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/components/ChannelView.d.ts +4 -2
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -0
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts +341 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -0
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -0
- package/lib/typescript/src/components/WarningView.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/index.d.ts +30 -18
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/specs/NativeLiveVoiceSdk.d.ts +3 -3
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/util/Colors.d.ts +2 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -0
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +1 -0
- package/lib/typescript/src/util/PlayingState.d.ts.map +1 -0
- package/lib/typescript/src/util/Translations.d.ts.map +1 -0
- package/lib/typescript/{module/src → src}/util/UIState.d.ts +22 -1
- package/lib/typescript/src/util/UIState.d.ts.map +1 -0
- package/livevoice-sdk-react-native.podspec +6 -27
- package/package.json +33 -123
- package/src/components/AudioOutputSwitchView.tsx +10 -9
- package/src/components/ChannelView.tsx +18 -25
- package/src/components/LiveVoiceView.tsx +143 -83
- package/src/components/PlayButtonView.tsx +280 -87
- package/src/icons/captions@1x.png +0 -0
- package/src/icons/captions@2x.png +0 -0
- package/src/icons/pause@1x.png +0 -0
- package/src/icons/pause@2x.png +0 -0
- package/src/icons/play@1x.png +0 -0
- package/src/icons/play@2x.png +0 -0
- package/src/index.tsx +99 -75
- package/src/specs/NativeLiveVoiceSdk.ts +7 -5
- package/src/util/Colors.ts +3 -1
- package/src/util/UIState.ts +25 -1
- package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI-generated.cpp +0 -245
- package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -398
- package/android/src/main/AndroidManifest.xml +0 -3
- package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec-generated.mm +0 -292
- package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h +0 -101
- package/ios/generated/RNLiveVoiceSpecJSI-generated.cpp +0 -245
- package/ios/generated/RNLiveVoiceSpecJSI.h +0 -398
- package/lib/commonjs/components/AudioOutputSwitchView.js +0 -140
- package/lib/commonjs/components/AudioOutputSwitchView.js.map +0 -1
- package/lib/commonjs/components/BrandingView.js +0 -78
- package/lib/commonjs/components/BrandingView.js.map +0 -1
- package/lib/commonjs/components/ChannelView.js +0 -117
- package/lib/commonjs/components/ChannelView.js.map +0 -1
- package/lib/commonjs/components/ErrorView.js +0 -88
- package/lib/commonjs/components/ErrorView.js.map +0 -1
- package/lib/commonjs/components/LiveVoiceView.js +0 -95
- package/lib/commonjs/components/LiveVoiceView.js.map +0 -1
- package/lib/commonjs/components/PlayButtonView.js +0 -161
- package/lib/commonjs/components/PlayButtonView.js.map +0 -1
- package/lib/commonjs/components/ReconnectingView.js +0 -109
- package/lib/commonjs/components/ReconnectingView.js.map +0 -1
- package/lib/commonjs/components/WarningView.js +0 -58
- package/lib/commonjs/components/WarningView.js.map +0 -1
- package/lib/commonjs/components/index.js +0 -94
- package/lib/commonjs/components/index.js.map +0 -1
- package/lib/commonjs/icons/branding.png +0 -0
- package/lib/commonjs/icons/cpu.png +0 -0
- package/lib/commonjs/icons/headphones.png +0 -0
- package/lib/commonjs/icons/mic.png +0 -0
- package/lib/commonjs/icons/pause.png +0 -0
- package/lib/commonjs/icons/play.png +0 -0
- package/lib/commonjs/icons/speaker.png +0 -0
- package/lib/commonjs/index.js +0 -319
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/specs/NativeLiveVoiceSdk.js +0 -19
- package/lib/commonjs/specs/NativeLiveVoiceSdk.js.map +0 -1
- package/lib/commonjs/util/Colors.js +0 -30
- package/lib/commonjs/util/Colors.js.map +0 -1
- package/lib/commonjs/util/ForegroundServiceConfig.js +0 -33
- package/lib/commonjs/util/ForegroundServiceConfig.js.map +0 -1
- package/lib/commonjs/util/PlayingState.js +0 -24
- package/lib/commonjs/util/PlayingState.js.map +0 -1
- package/lib/commonjs/util/Translations.js +0 -47
- package/lib/commonjs/util/Translations.js.map +0 -1
- package/lib/commonjs/util/UIState.js +0 -6
- package/lib/commonjs/util/UIState.js.map +0 -1
- package/lib/module/icons/pause.png +0 -0
- package/lib/module/icons/play.png +0 -0
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/BrandingView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ChannelView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ErrorView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts +0 -146
- package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ReconnectingView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/WarningView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/util/Colors.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/util/Translations.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/util/UIState.d.ts +0 -45
- package/lib/typescript/commonjs/src/util/UIState.d.ts.map +0 -1
- package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts +0 -6
- package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/BrandingView.d.ts +0 -6
- package/lib/typescript/module/src/components/BrandingView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ChannelView.d.ts +0 -13
- package/lib/typescript/module/src/components/ChannelView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ErrorView.d.ts +0 -9
- package/lib/typescript/module/src/components/ErrorView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/LiveVoiceView.d.ts +0 -6
- package/lib/typescript/module/src/components/LiveVoiceView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/PlayButtonView.d.ts +0 -146
- package/lib/typescript/module/src/components/PlayButtonView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ReconnectingView.d.ts +0 -9
- package/lib/typescript/module/src/components/ReconnectingView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/WarningView.d.ts +0 -8
- package/lib/typescript/module/src/components/WarningView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/index.d.ts +0 -9
- package/lib/typescript/module/src/components/index.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -133
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts +0 -48
- package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/util/Colors.d.ts +0 -13
- package/lib/typescript/module/src/util/Colors.d.ts.map +0 -1
- package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts +0 -12
- package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/module/src/util/PlayingState.d.ts +0 -7
- package/lib/typescript/module/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/module/src/util/Translations.d.ts +0 -22
- package/lib/typescript/module/src/util/Translations.d.ts.map +0 -1
- package/lib/typescript/module/src/util/UIState.d.ts.map +0 -1
- package/react-native.config.js +0 -12
- package/src/icons/pause.png +0 -0
- package/src/icons/play.png +0 -0
- /package/android/{generated → app/build/generated/source/codegen}/jni/RNLiveVoiceSpec.h +0 -0
- /package/lib/{typescript/module → module}/package.json +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/AudioOutputSwitchView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/BrandingView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ErrorView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/LiveVoiceView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ReconnectingView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/WarningView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/index.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/util/ForegroundServiceConfig.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/util/PlayingState.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/util/Translations.d.ts +0 -0
package/src/index.tsx
CHANGED
|
@@ -9,83 +9,90 @@
|
|
|
9
9
|
* SPDX-License-Identifier: MIT
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import LiveVoiceSdkReactNative from
|
|
13
|
-
import { type UiState } from
|
|
14
|
-
import {
|
|
12
|
+
import LiveVoiceSdkReactNative from "./specs/NativeLiveVoiceSdk";
|
|
13
|
+
import { type UiState, type AvailableSubtitle } from "./util/UIState";
|
|
14
|
+
import {
|
|
15
|
+
type ForegroundServiceConfig,
|
|
16
|
+
serviceDisabled,
|
|
17
|
+
} from "./util/ForegroundServiceConfig";
|
|
15
18
|
|
|
16
|
-
export type
|
|
17
|
-
export type Claims = { hideBranding: boolean, customUiAllowed: boolean }
|
|
19
|
+
export type Claims = { hideBranding: boolean; customUiAllowed: boolean };
|
|
18
20
|
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
21
|
+
export * from "./components";
|
|
22
|
+
export * from "./util/Translations";
|
|
23
|
+
export * from "./util/ForegroundServiceConfig";
|
|
24
|
+
export * from "./util/UIState";
|
|
25
|
+
export * from "./util/PlayingState";
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* Initialize the LiveVoice SDK.
|
|
27
|
-
*
|
|
29
|
+
*
|
|
28
30
|
* @param {ForegroundServiceConfig} [androidServiceConfig=serviceDisabled] - Pass the service config on Android.
|
|
29
31
|
*/
|
|
30
|
-
export function initialize(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
export function initialize(
|
|
33
|
+
androidServiceConfig: ForegroundServiceConfig = serviceDisabled,
|
|
34
|
+
): void {
|
|
35
|
+
let serviceTypeAsString: string | null;
|
|
36
|
+
switch (androidServiceConfig.type) {
|
|
37
|
+
case "Disabled":
|
|
38
|
+
serviceTypeAsString = null;
|
|
39
|
+
break;
|
|
40
|
+
case "Enabled":
|
|
41
|
+
if (androidServiceConfig.message == null)
|
|
42
|
+
serviceTypeAsString = "LV_NOTIFICATION_DEFAULT_MESSAGE";
|
|
43
|
+
else serviceTypeAsString = androidServiceConfig.message;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
// Interface cannot take default-parameter, so we need to wrap it here
|
|
48
|
+
LiveVoiceSdkReactNative.initialize(serviceTypeAsString);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* Join an event.
|
|
50
|
-
*
|
|
53
|
+
*
|
|
51
54
|
* @abstract By joining an event you can display the event's channels.
|
|
52
|
-
*
|
|
55
|
+
*
|
|
53
56
|
* @param {string} joinCode - The listener code of your event. You can find it on the event page of the admin web-interface by clicking on 'Share with your audience'.
|
|
54
57
|
* @param {string | null} password - The optional password to join the event. If a password has been set for listeners in your event, it can be found in the 'Access' tab of the event page of the admin web-interface.
|
|
55
58
|
* @param {string} apiKey - Your API key. You can find your API key in the account page when logged in on the website.
|
|
56
59
|
*/
|
|
57
|
-
export function joinEvent(
|
|
58
|
-
|
|
60
|
+
export function joinEvent(
|
|
61
|
+
joinCode: string,
|
|
62
|
+
password: string | null,
|
|
63
|
+
apiKey: string,
|
|
64
|
+
): void {
|
|
65
|
+
return LiveVoiceSdkReactNative.joinEvent(joinCode, password, apiKey);
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
/**
|
|
62
69
|
* Leave the current event.
|
|
63
|
-
*
|
|
70
|
+
*
|
|
64
71
|
* @abstract You can explicitly leave an event to tear down any network connections the SDK uses when you no longer display any channels.
|
|
65
72
|
*/
|
|
66
73
|
export function leaveEvent(): void {
|
|
67
|
-
|
|
74
|
+
return LiveVoiceSdkReactNative.leaveEvent();
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
/**
|
|
71
78
|
* Reconnect when a connection error occurred.
|
|
72
|
-
*
|
|
79
|
+
*
|
|
73
80
|
* @abstract Call this method to try to reconnect when a connection error has occurred.
|
|
74
81
|
*/
|
|
75
82
|
export function reconnect(): void {
|
|
76
|
-
|
|
83
|
+
return LiveVoiceSdkReactNative.reconnect();
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
/**
|
|
80
87
|
* Get the claims for the current event.
|
|
81
|
-
*
|
|
88
|
+
*
|
|
82
89
|
* @abstract The claims determine the authorized features for an API key. Claims are available, once an event has been joined.
|
|
83
90
|
* @returns {Claims | null} The authorization claims, or `nil` if not yet joined
|
|
84
91
|
*/
|
|
85
92
|
export function getCurrentClaims(): Claims | null {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
const claims = LiveVoiceSdkReactNative.getCurrentClaims();
|
|
94
|
+
if (claims == null) return null;
|
|
95
|
+
return JSON.parse(claims);
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
/**
|
|
@@ -96,7 +103,7 @@ export function getCurrentClaims(): Claims | null {
|
|
|
96
103
|
* @returns {UiState} The current view state
|
|
97
104
|
*/
|
|
98
105
|
export function getCurrentUiState(): UiState {
|
|
99
|
-
|
|
106
|
+
return JSON.parse(LiveVoiceSdkReactNative.getCurrentUiState());
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
/**
|
|
@@ -104,13 +111,14 @@ export function getCurrentUiState(): UiState {
|
|
|
104
111
|
*
|
|
105
112
|
* @abstract You should only need to call this method to get an initial value. Use {@link onAvailableSubtitleConfigsChanged}
|
|
106
113
|
` to be updated when the available subtitle configurations change.
|
|
107
|
-
* @returns {
|
|
114
|
+
* @returns {[AvailableSubtitle]} The current available subtitles
|
|
108
115
|
*/
|
|
109
|
-
export function getCurrentSubtitleConfiguration():
|
|
110
|
-
|
|
116
|
+
export function getCurrentSubtitleConfiguration(): [AvailableSubtitle] {
|
|
117
|
+
return JSON.parse(
|
|
118
|
+
LiveVoiceSdkReactNative.getCurrentAvailableSubtitleConfigs(),
|
|
119
|
+
);
|
|
111
120
|
}
|
|
112
121
|
|
|
113
|
-
|
|
114
122
|
/**
|
|
115
123
|
* Get the current subtitle elemens LiveVoice SDK.
|
|
116
124
|
*
|
|
@@ -119,7 +127,7 @@ export function getCurrentSubtitleConfiguration(): AvailableSubtitleConfigs {
|
|
|
119
127
|
* @returns {[String]} The current subtitles
|
|
120
128
|
*/
|
|
121
129
|
export function getCurrentSubtitles(): [String] {
|
|
122
|
-
|
|
130
|
+
return JSON.parse(LiveVoiceSdkReactNative.getCurrentSubtitles());
|
|
123
131
|
}
|
|
124
132
|
|
|
125
133
|
/**
|
|
@@ -130,7 +138,7 @@ export function getCurrentSubtitles(): [String] {
|
|
|
130
138
|
* @returns {boolean} `true` for the speaker and `false` for the receiver.
|
|
131
139
|
*/
|
|
132
140
|
export function getCurrentAudioState(): boolean {
|
|
133
|
-
|
|
141
|
+
return LiveVoiceSdkReactNative.getCurrentAudioState();
|
|
134
142
|
}
|
|
135
143
|
|
|
136
144
|
/**
|
|
@@ -138,7 +146,7 @@ export function getCurrentAudioState(): boolean {
|
|
|
138
146
|
* @param {boolean} value - Set to `true` to use the speaker, and `false` to use the receiver.
|
|
139
147
|
*/
|
|
140
148
|
export function setLiveVoiceUseSpeaker(value: boolean): void {
|
|
141
|
-
|
|
149
|
+
return LiveVoiceSdkReactNative.setLiveVoiceUseSpeaker(value);
|
|
142
150
|
}
|
|
143
151
|
|
|
144
152
|
/**
|
|
@@ -147,14 +155,14 @@ export function setLiveVoiceUseSpeaker(value: boolean): void {
|
|
|
147
155
|
* @param {number} [id] - The channel ID.
|
|
148
156
|
*/
|
|
149
157
|
export function startChannel(id: number): void {
|
|
150
|
-
|
|
158
|
+
return LiveVoiceSdkReactNative.startChannel(id);
|
|
151
159
|
}
|
|
152
160
|
|
|
153
161
|
/**
|
|
154
162
|
* Stop playing the currently playing channel.
|
|
155
163
|
*/
|
|
156
164
|
export function stopChannel(): void {
|
|
157
|
-
|
|
165
|
+
return LiveVoiceSdkReactNative.stopChannel();
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
/**
|
|
@@ -162,67 +170,83 @@ export function stopChannel(): void {
|
|
|
162
170
|
* @abstract The SDK can receive a single stream of subtitle fragments at a time.
|
|
163
171
|
* You can stop receiving subtitles using {@link stopSubtitles()}.
|
|
164
172
|
* Whenever you call this method, any previous subtitle streams are stopped automatically and you receive the subtitles for the requested channel and language instead.
|
|
165
|
-
*
|
|
173
|
+
*
|
|
166
174
|
* Note: You have to make sure that subtitles for the given channel and language are enabled in the web-interface. You can use the {@link onAvailableSubtitleConfigsChanged} handler to check if subtitles are available for a given channel in a given language.
|
|
167
|
-
*
|
|
175
|
+
*
|
|
168
176
|
* @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
|
|
169
|
-
* @param {string | null} language - The language code for the translation, or `null` to request the transcript.
|
|
170
177
|
*/
|
|
171
|
-
export function startSubtitles(channelId: number | null
|
|
172
|
-
|
|
173
|
-
|
|
178
|
+
export function startSubtitles(channelId: number | null) {
|
|
179
|
+
const nativeSafeId = channelId == null ? -1 : channelId;
|
|
180
|
+
LiveVoiceSdkReactNative.startSubtitles(nativeSafeId);
|
|
174
181
|
}
|
|
175
182
|
|
|
176
183
|
/**
|
|
177
184
|
* Stop receiving subtitles.
|
|
178
185
|
*/
|
|
179
186
|
export function stopSubtitles(): void {
|
|
180
|
-
|
|
187
|
+
return LiveVoiceSdkReactNative.stopSubtitles();
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
// Event handlers
|
|
184
191
|
|
|
185
192
|
/**
|
|
186
193
|
* Handle changes of the audio output.
|
|
194
|
+
*
|
|
195
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
187
196
|
*/
|
|
188
|
-
export function onAudioOutputChanged(handler: (useSpeaker: boolean) => void):
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
197
|
+
export function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): {
|
|
198
|
+
remove: () => void;
|
|
199
|
+
} {
|
|
200
|
+
return LiveVoiceSdkReactNative.onAudioOutputChanged((data: boolean) => {
|
|
201
|
+
handler(data);
|
|
202
|
+
});
|
|
192
203
|
}
|
|
193
204
|
|
|
194
205
|
/**
|
|
195
206
|
* Handle changes of the UI state.
|
|
207
|
+
*
|
|
208
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
196
209
|
*/
|
|
197
|
-
export function onUiStateChanged(handler: (arg: UiState) => void):
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
export function onUiStateChanged(handler: (arg: UiState) => void): {
|
|
211
|
+
remove: () => void;
|
|
212
|
+
} {
|
|
213
|
+
return LiveVoiceSdkReactNative.onUiStateChanged((data: string) => {
|
|
214
|
+
handler(JSON.parse(data));
|
|
215
|
+
});
|
|
201
216
|
}
|
|
202
217
|
|
|
203
218
|
/**
|
|
204
219
|
* Handle changes of the available subtitles.
|
|
220
|
+
*
|
|
221
|
+
* @returns { object } - An object with a`remove` method to unsubscribe from the event.
|
|
205
222
|
*/
|
|
206
|
-
export function onAvailableSubtitleConfigsChanged(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
export function onAvailableSubtitleConfigsChanged(
|
|
224
|
+
handler: (arg: [AvailableSubtitle]) => void,
|
|
225
|
+
): { remove: () => void } {
|
|
226
|
+
return LiveVoiceSdkReactNative.onAvailableSubtitleConfigsChanged(
|
|
227
|
+
(data: string) => {
|
|
228
|
+
handler(JSON.parse(data));
|
|
229
|
+
},
|
|
230
|
+
);
|
|
211
231
|
}
|
|
212
232
|
|
|
213
233
|
/**
|
|
214
234
|
* Handle changes of the available subtitles.
|
|
235
|
+
*
|
|
236
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
215
237
|
*/
|
|
216
|
-
export function onSubtitlesChanged(handler: (arg: [String]) => void):
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
238
|
+
export function onSubtitlesChanged(handler: (arg: [String]) => void): {
|
|
239
|
+
remove: () => void;
|
|
240
|
+
} {
|
|
241
|
+
return LiveVoiceSdkReactNative.onSubtitlesChanged((data: string) => {
|
|
242
|
+
const mapOfSubtitles: [String] = JSON.parse(data);
|
|
243
|
+
handler(mapOfSubtitles);
|
|
244
|
+
});
|
|
221
245
|
}
|
|
222
246
|
|
|
223
247
|
/**
|
|
224
248
|
* Open the LiveVoice website in the device's default browser.
|
|
225
249
|
*/
|
|
226
250
|
export function openLiveVoiceWebsite(): void {
|
|
227
|
-
|
|
228
|
-
}
|
|
251
|
+
return LiveVoiceSdkReactNative.openLiveVoiceWebsite();
|
|
252
|
+
}
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
* SPDX-License-Identifier: MIT
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { type TurboModule } from 'react-native';
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import { TurboModuleRegistry, type TurboModule, type CodegenTypes } from 'react-native';
|
|
13
|
+
|
|
14
|
+
// Type alias is required for backwards compatibility with RN < 0.80 codegen parsers
|
|
15
|
+
// which statically look for the exact identifier name 'EventEmitter'
|
|
16
|
+
type EventEmitter<T> = CodegenTypes.EventEmitter<T>;
|
|
15
17
|
|
|
16
18
|
export interface Spec extends TurboModule {
|
|
17
19
|
initialize(androidServiceConfig: string | null): void
|
|
@@ -36,7 +38,7 @@ export interface Spec extends TurboModule {
|
|
|
36
38
|
/**
|
|
37
39
|
* @param channelId: -1 denotes an unspecified channel (i.e: the currently playing one)
|
|
38
40
|
*/
|
|
39
|
-
startSubtitles(channelId: number
|
|
41
|
+
startSubtitles(channelId: number): void
|
|
40
42
|
stopSubtitles(): void
|
|
41
43
|
|
|
42
44
|
openLiveVoiceWebsite(): void
|
|
@@ -74,4 +76,4 @@ export interface Spec extends TurboModule {
|
|
|
74
76
|
accessibilityChannelStop(): string
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('LiveVoiceModule');
|
|
79
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('LiveVoiceModule');
|
package/src/util/Colors.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
export const COLORS = {
|
|
13
13
|
primary: '#F1521B',
|
|
14
|
-
primaryOutline: 'rgba(241, 82, 27, 0.2)',
|
|
15
14
|
|
|
16
15
|
bg: '#F5F5F5',
|
|
17
16
|
bgDark: '#1E1F23',
|
|
@@ -19,6 +18,9 @@ export const COLORS = {
|
|
|
19
18
|
cardBg: '#fff',
|
|
20
19
|
cardBgDark: '#212429',
|
|
21
20
|
|
|
21
|
+
divider: '#f0f0f0',
|
|
22
|
+
dividerDark: '#333333',
|
|
23
|
+
|
|
22
24
|
white: '#fff',
|
|
23
25
|
black: '#191919',
|
|
24
26
|
gray: '#808080',
|
package/src/util/UIState.ts
CHANGED
|
@@ -59,7 +59,31 @@ export interface Channel {
|
|
|
59
59
|
id: number;
|
|
60
60
|
name: string;
|
|
61
61
|
isOnline: boolean;
|
|
62
|
+
hasAudio: boolean;
|
|
63
|
+
hasSubtitles: boolean;
|
|
62
64
|
isAudioMuted: boolean;
|
|
63
|
-
|
|
65
|
+
aiTranslationInfo: AITranslationInfo | null;
|
|
66
|
+
dependenChannels: [DependentChannel];
|
|
64
67
|
playingState: PlayingState;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface AITranslationInfo {
|
|
71
|
+
sourceID: number;
|
|
72
|
+
targetLanguage: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DependentChannel {
|
|
76
|
+
id: number;
|
|
77
|
+
name: string;
|
|
78
|
+
sourceChannelID: number;
|
|
79
|
+
language: string;
|
|
80
|
+
hasSubtitles: boolean;
|
|
81
|
+
hasAudio: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AvailableSubtitle {
|
|
85
|
+
id: number;
|
|
86
|
+
name: string;
|
|
87
|
+
language: string | null;
|
|
88
|
+
parent: number | null;
|
|
65
89
|
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "RNLiveVoiceSpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->initialize(
|
|
16
|
-
rt,
|
|
17
|
-
count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt))
|
|
18
|
-
);
|
|
19
|
-
return jsi::Value::undefined();
|
|
20
|
-
}
|
|
21
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_joinEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
22
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->joinEvent(
|
|
23
|
-
rt,
|
|
24
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
25
|
-
count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)),
|
|
26
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
27
|
-
);
|
|
28
|
-
return jsi::Value::undefined();
|
|
29
|
-
}
|
|
30
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_leaveEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->leaveEvent(
|
|
32
|
-
rt
|
|
33
|
-
);
|
|
34
|
-
return jsi::Value::undefined();
|
|
35
|
-
}
|
|
36
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_reconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
37
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->reconnect(
|
|
38
|
-
rt
|
|
39
|
-
);
|
|
40
|
-
return jsi::Value::undefined();
|
|
41
|
-
}
|
|
42
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentClaims(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
43
|
-
auto result = static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->getCurrentClaims(
|
|
44
|
-
rt
|
|
45
|
-
);
|
|
46
|
-
return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
|
|
47
|
-
}
|
|
48
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentUiState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
49
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->getCurrentUiState(
|
|
50
|
-
rt
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentAudioState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
54
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->getCurrentAudioState(
|
|
55
|
-
rt
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentSubtitles(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
59
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->getCurrentSubtitles(
|
|
60
|
-
rt
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentAvailableSubtitleConfigs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
64
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->getCurrentAvailableSubtitleConfigs(
|
|
65
|
-
rt
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_setLiveVoiceUseSpeaker(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
69
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->setLiveVoiceUseSpeaker(
|
|
70
|
-
rt,
|
|
71
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
|
|
72
|
-
);
|
|
73
|
-
return jsi::Value::undefined();
|
|
74
|
-
}
|
|
75
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_startChannel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
76
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->startChannel(
|
|
77
|
-
rt,
|
|
78
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
|
|
79
|
-
);
|
|
80
|
-
return jsi::Value::undefined();
|
|
81
|
-
}
|
|
82
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_stopChannel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
83
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->stopChannel(
|
|
84
|
-
rt
|
|
85
|
-
);
|
|
86
|
-
return jsi::Value::undefined();
|
|
87
|
-
}
|
|
88
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_startSubtitles(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
89
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->startSubtitles(
|
|
90
|
-
rt,
|
|
91
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
92
|
-
count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt))
|
|
93
|
-
);
|
|
94
|
-
return jsi::Value::undefined();
|
|
95
|
-
}
|
|
96
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_stopSubtitles(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
97
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->stopSubtitles(
|
|
98
|
-
rt
|
|
99
|
-
);
|
|
100
|
-
return jsi::Value::undefined();
|
|
101
|
-
}
|
|
102
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_openLiveVoiceWebsite(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
103
|
-
static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->openLiveVoiceWebsite(
|
|
104
|
-
rt
|
|
105
|
-
);
|
|
106
|
-
return jsi::Value::undefined();
|
|
107
|
-
}
|
|
108
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_channelStatusOffline(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
109
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->channelStatusOffline(
|
|
110
|
-
rt
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_noChannels(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
114
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->noChannels(
|
|
115
|
-
rt
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_isAiChannelStatusMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
119
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->isAiChannelStatusMessage(
|
|
120
|
-
rt
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkNoMatchingChannels(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
124
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkNoMatchingChannels(
|
|
125
|
-
rt
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorScreenRetrying(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
129
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->errorScreenRetrying(
|
|
130
|
-
rt
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorScreenRetryingIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
134
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->errorScreenRetryingIn(
|
|
135
|
-
rt,
|
|
136
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorGeneric(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
140
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorGeneric(
|
|
141
|
-
rt
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorInactive(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
145
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorInactive(
|
|
146
|
-
rt
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorInvalidApiKey(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
150
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorInvalidApiKey(
|
|
151
|
-
rt
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorListenerLimitReached(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
155
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorListenerLimitReached(
|
|
156
|
-
rt
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorNoNetwork(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
160
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorNoNetwork(
|
|
161
|
-
rt
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorNotFound(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
165
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorNotFound(
|
|
166
|
-
rt
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorRequestFailed(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
170
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorRequestFailed(
|
|
171
|
-
rt,
|
|
172
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorWrongPassword(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
176
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->sdkErrorWrongPassword(
|
|
177
|
-
rt
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_streamingByTitle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
181
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->streamingByTitle(
|
|
182
|
-
rt
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorRetryNowButton(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
186
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->errorRetryNowButton(
|
|
187
|
-
rt
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelPlay(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
191
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->accessibilityChannelPlay(
|
|
192
|
-
rt
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelStatusMuted(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
196
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->accessibilityChannelStatusMuted(
|
|
197
|
-
rt
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
static jsi::Value __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelStop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
201
|
-
return static_cast<NativeLiveVoiceSdkCxxSpecJSI *>(&turboModule)->accessibilityChannelStop(
|
|
202
|
-
rt
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
NativeLiveVoiceSdkCxxSpecJSI::NativeLiveVoiceSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
207
|
-
: TurboModule("LiveVoiceModule", jsInvoker) {
|
|
208
|
-
methodMap_["initialize"] = MethodMetadata {1, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_initialize};
|
|
209
|
-
methodMap_["joinEvent"] = MethodMetadata {3, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_joinEvent};
|
|
210
|
-
methodMap_["leaveEvent"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_leaveEvent};
|
|
211
|
-
methodMap_["reconnect"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_reconnect};
|
|
212
|
-
methodMap_["getCurrentClaims"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentClaims};
|
|
213
|
-
methodMap_["getCurrentUiState"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentUiState};
|
|
214
|
-
methodMap_["getCurrentAudioState"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentAudioState};
|
|
215
|
-
methodMap_["getCurrentSubtitles"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentSubtitles};
|
|
216
|
-
methodMap_["getCurrentAvailableSubtitleConfigs"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_getCurrentAvailableSubtitleConfigs};
|
|
217
|
-
methodMap_["setLiveVoiceUseSpeaker"] = MethodMetadata {1, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_setLiveVoiceUseSpeaker};
|
|
218
|
-
methodMap_["startChannel"] = MethodMetadata {1, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_startChannel};
|
|
219
|
-
methodMap_["stopChannel"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_stopChannel};
|
|
220
|
-
methodMap_["startSubtitles"] = MethodMetadata {2, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_startSubtitles};
|
|
221
|
-
methodMap_["stopSubtitles"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_stopSubtitles};
|
|
222
|
-
methodMap_["openLiveVoiceWebsite"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_openLiveVoiceWebsite};
|
|
223
|
-
methodMap_["channelStatusOffline"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_channelStatusOffline};
|
|
224
|
-
methodMap_["noChannels"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_noChannels};
|
|
225
|
-
methodMap_["isAiChannelStatusMessage"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_isAiChannelStatusMessage};
|
|
226
|
-
methodMap_["sdkNoMatchingChannels"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkNoMatchingChannels};
|
|
227
|
-
methodMap_["errorScreenRetrying"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorScreenRetrying};
|
|
228
|
-
methodMap_["errorScreenRetryingIn"] = MethodMetadata {1, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorScreenRetryingIn};
|
|
229
|
-
methodMap_["sdkErrorGeneric"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorGeneric};
|
|
230
|
-
methodMap_["sdkErrorInactive"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorInactive};
|
|
231
|
-
methodMap_["sdkErrorInvalidApiKey"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorInvalidApiKey};
|
|
232
|
-
methodMap_["sdkErrorListenerLimitReached"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorListenerLimitReached};
|
|
233
|
-
methodMap_["sdkErrorNoNetwork"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorNoNetwork};
|
|
234
|
-
methodMap_["sdkErrorNotFound"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorNotFound};
|
|
235
|
-
methodMap_["sdkErrorRequestFailed"] = MethodMetadata {1, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorRequestFailed};
|
|
236
|
-
methodMap_["sdkErrorWrongPassword"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_sdkErrorWrongPassword};
|
|
237
|
-
methodMap_["streamingByTitle"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_streamingByTitle};
|
|
238
|
-
methodMap_["errorRetryNowButton"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_errorRetryNowButton};
|
|
239
|
-
methodMap_["accessibilityChannelPlay"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelPlay};
|
|
240
|
-
methodMap_["accessibilityChannelStatusMuted"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelStatusMuted};
|
|
241
|
-
methodMap_["accessibilityChannelStop"] = MethodMetadata {0, __hostFunction_NativeLiveVoiceSdkCxxSpecJSI_accessibilityChannelStop};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
} // namespace facebook::react
|