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
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { type UiState } from
|
|
2
|
-
import { type ForegroundServiceConfig } from
|
|
3
|
-
export type AvailableSubtitleConfigs = {
|
|
4
|
-
[key: string]: (string | null)[];
|
|
5
|
-
};
|
|
1
|
+
import { type UiState, type AvailableSubtitle } from "./util/UIState";
|
|
2
|
+
import { type ForegroundServiceConfig } from "./util/ForegroundServiceConfig";
|
|
6
3
|
export type Claims = {
|
|
7
4
|
hideBranding: boolean;
|
|
8
5
|
customUiAllowed: boolean;
|
|
9
6
|
};
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
7
|
+
export * from "./components";
|
|
8
|
+
export * from "./util/Translations";
|
|
9
|
+
export * from "./util/ForegroundServiceConfig";
|
|
10
|
+
export * from "./util/UIState";
|
|
11
|
+
export * from "./util/PlayingState";
|
|
15
12
|
/**
|
|
16
13
|
* Initialize the LiveVoice SDK.
|
|
17
14
|
*
|
|
@@ -60,9 +57,9 @@ export declare function getCurrentUiState(): UiState;
|
|
|
60
57
|
*
|
|
61
58
|
* @abstract You should only need to call this method to get an initial value. Use {@link onAvailableSubtitleConfigsChanged}
|
|
62
59
|
` to be updated when the available subtitle configurations change.
|
|
63
|
-
* @returns {
|
|
60
|
+
* @returns {[AvailableSubtitle]} The current available subtitles
|
|
64
61
|
*/
|
|
65
|
-
export declare function getCurrentSubtitleConfiguration():
|
|
62
|
+
export declare function getCurrentSubtitleConfiguration(): [AvailableSubtitle];
|
|
66
63
|
/**
|
|
67
64
|
* Get the current subtitle elemens LiveVoice SDK.
|
|
68
65
|
*
|
|
@@ -103,29 +100,44 @@ export declare function stopChannel(): void;
|
|
|
103
100
|
* 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.
|
|
104
101
|
*
|
|
105
102
|
* @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
|
|
106
|
-
* @param {string | null} language - The language code for the translation, or `null` to request the transcript.
|
|
107
103
|
*/
|
|
108
|
-
export declare function startSubtitles(channelId: number | null
|
|
104
|
+
export declare function startSubtitles(channelId: number | null): void;
|
|
109
105
|
/**
|
|
110
106
|
* Stop receiving subtitles.
|
|
111
107
|
*/
|
|
112
108
|
export declare function stopSubtitles(): void;
|
|
113
109
|
/**
|
|
114
110
|
* Handle changes of the audio output.
|
|
111
|
+
*
|
|
112
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
115
113
|
*/
|
|
116
|
-
export declare function onAudioOutputChanged(handler: (useSpeaker: boolean) => void):
|
|
114
|
+
export declare function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): {
|
|
115
|
+
remove: () => void;
|
|
116
|
+
};
|
|
117
117
|
/**
|
|
118
118
|
* Handle changes of the UI state.
|
|
119
|
+
*
|
|
120
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
119
121
|
*/
|
|
120
|
-
export declare function onUiStateChanged(handler: (arg: UiState) => void):
|
|
122
|
+
export declare function onUiStateChanged(handler: (arg: UiState) => void): {
|
|
123
|
+
remove: () => void;
|
|
124
|
+
};
|
|
121
125
|
/**
|
|
122
126
|
* Handle changes of the available subtitles.
|
|
127
|
+
*
|
|
128
|
+
* @returns { object } - An object with a`remove` method to unsubscribe from the event.
|
|
123
129
|
*/
|
|
124
|
-
export declare function onAvailableSubtitleConfigsChanged(handler: (arg:
|
|
130
|
+
export declare function onAvailableSubtitleConfigsChanged(handler: (arg: [AvailableSubtitle]) => void): {
|
|
131
|
+
remove: () => void;
|
|
132
|
+
};
|
|
125
133
|
/**
|
|
126
134
|
* Handle changes of the available subtitles.
|
|
135
|
+
*
|
|
136
|
+
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
127
137
|
*/
|
|
128
|
-
export declare function onSubtitlesChanged(handler: (arg: [String]) => void):
|
|
138
|
+
export declare function onSubtitlesChanged(handler: (arg: [String]) => void): {
|
|
139
|
+
remove: () => void;
|
|
140
|
+
};
|
|
129
141
|
/**
|
|
130
142
|
* Open the LiveVoice website in the device's default browser.
|
|
131
143
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,MAAM,GAAG;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,oBAAoB,GAAE,uBAAyC,GAC9D,IAAI,CAeN;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,MAAM,GACb,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,CAAC,iBAAiB,CAAC,CAIrE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,CAAC,MAAM,CAAC,CAE9C;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,QAGtD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,GAAG;IAC5E,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAIA;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG;IACjE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAIA;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAC1C;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAMxB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,GAAG;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAKA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TurboModule } from 'react-native';
|
|
2
|
-
|
|
1
|
+
import { type TurboModule, type CodegenTypes } from 'react-native';
|
|
2
|
+
type EventEmitter<T> = CodegenTypes.EventEmitter<T>;
|
|
3
3
|
export interface Spec extends TurboModule {
|
|
4
4
|
initialize(androidServiceConfig: string | null): void;
|
|
5
5
|
joinEvent(joinCode: string, password: string | null, apiKey: string): void;
|
|
@@ -16,7 +16,7 @@ export interface Spec extends TurboModule {
|
|
|
16
16
|
/**
|
|
17
17
|
* @param channelId: -1 denotes an unspecified channel (i.e: the currently playing one)
|
|
18
18
|
*/
|
|
19
|
-
startSubtitles(channelId: number
|
|
19
|
+
startSubtitles(channelId: number): void;
|
|
20
20
|
stopSubtitles(): void;
|
|
21
21
|
openLiveVoiceWebsite(): void;
|
|
22
22
|
readonly onUiStateChanged: EventEmitter<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeLiveVoiceSdk.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeLiveVoiceSdk.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAIxF,KAAK,YAAY,CAAC,CAAC,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IACrD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3E,UAAU,IAAI,IAAI,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAElB,gBAAgB,IAAI,MAAM,GAAC,IAAI,CAAC;IAGhC,iBAAiB,IAAI,MAAM,CAAC;IAC5B,oBAAoB,IAAI,OAAO,CAAC;IAChC,mBAAmB,IAAI,MAAM,CAAC;IAC9B,kCAAkC,IAAI,MAAM,CAAC;IAG7C,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;IAE5C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,IAAI,IAAI,CAAA;IAEnB;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,aAAa,IAAI,IAAI,CAAA;IAErB,oBAAoB,IAAI,IAAI,CAAA;IAI5B,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC/C,QAAQ,CAAC,oBAAoB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;IACpD,QAAQ,CAAC,iCAAiC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAChE,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAIjD,oBAAoB,IAAI,MAAM,CAAA;IAC9B,UAAU,IAAI,MAAM,CAAA;IACpB,wBAAwB,IAAI,MAAM,CAAA;IAClC,qBAAqB,IAAI,MAAM,CAAA;IAE/B,mBAAmB,IAAI,MAAM,CAAA;IAC7B,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IAE9C,eAAe,IAAI,MAAM,CAAA;IACzB,gBAAgB,IAAI,MAAM,CAAA;IAC1B,qBAAqB,IAAI,MAAM,CAAA;IAC/B,4BAA4B,IAAI,MAAM,CAAA;IACtC,iBAAiB,IAAI,MAAM,CAAA;IAC3B,gBAAgB,IAAI,MAAM,CAAA;IAC1B,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IAChD,qBAAqB,IAAI,MAAM,CAAA;IAC/B,gBAAgB,IAAI,MAAM,CAAA;IAC1B,mBAAmB,IAAI,MAAM,CAAA;IAE7B,wBAAwB,IAAI,MAAM,CAAA;IAClC,+BAA+B,IAAI,MAAM,CAAA;IACzC,wBAAwB,IAAI,MAAM,CAAA;CACnC;;AAED,wBAAyE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../../src/util/Colors.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM;;;;;;;;;;;;CAiBlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAGD,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAyE,CAAC;AAEzH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAGjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayingState.d.ts","sourceRoot":"","sources":["../../../../src/util/PlayingState.ts"],"names":[],"mappings":"AAWA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Translations.d.ts","sourceRoot":"","sources":["../../../../src/util/Translations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY;gCACG,MAAM;sBAChB,MAAM;oCACQ,MAAM;iCACT,MAAM;+BACR,MAAM;qCACE,MAAM,KAAG,MAAM;2BAC3B,MAAM;4BACL,MAAM;iCACD,MAAM;wCACC,MAAM;6BACjB,MAAM;4BACP,MAAM;uCACO,MAAM,KAAG,MAAM;iCACvB,MAAM;+BACR,MAAM;4BACT,MAAM;oCACE,MAAM;2CACC,MAAM;oCACb,MAAM;CACrC,CAAC"}
|
|
@@ -38,8 +38,29 @@ export interface Channel {
|
|
|
38
38
|
id: number;
|
|
39
39
|
name: string;
|
|
40
40
|
isOnline: boolean;
|
|
41
|
+
hasAudio: boolean;
|
|
42
|
+
hasSubtitles: boolean;
|
|
41
43
|
isAudioMuted: boolean;
|
|
42
|
-
|
|
44
|
+
aiTranslationInfo: AITranslationInfo | null;
|
|
45
|
+
dependenChannels: [DependentChannel];
|
|
43
46
|
playingState: PlayingState;
|
|
44
47
|
}
|
|
48
|
+
export interface AITranslationInfo {
|
|
49
|
+
sourceID: number;
|
|
50
|
+
targetLanguage: string;
|
|
51
|
+
}
|
|
52
|
+
export interface DependentChannel {
|
|
53
|
+
id: number;
|
|
54
|
+
name: string;
|
|
55
|
+
sourceChannelID: number;
|
|
56
|
+
language: string;
|
|
57
|
+
hasSubtitles: boolean;
|
|
58
|
+
hasAudio: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface AvailableSubtitle {
|
|
61
|
+
id: number;
|
|
62
|
+
name: string;
|
|
63
|
+
language: string | null;
|
|
64
|
+
parent: number | null;
|
|
65
|
+
}
|
|
45
66
|
//# sourceMappingURL=UIState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIState.d.ts","sourceRoot":"","sources":["../../../../src/util/UIState.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,aAAa,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
require "json"
|
|
15
15
|
|
|
16
16
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
17
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
18
17
|
|
|
19
18
|
Pod::Spec.new do |s|
|
|
20
19
|
s.name = "livevoice-sdk-react-native"
|
|
@@ -27,32 +26,12 @@ Pod::Spec.new do |s|
|
|
|
27
26
|
s.platforms = { :ios => min_ios_version_supported }
|
|
28
27
|
s.source = { :git => "#{package["repository"]}", :tag => "#{s.version}" }
|
|
29
28
|
|
|
30
|
-
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
31
|
-
s.
|
|
29
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
30
|
+
s.exclude_files = "ios/generated/**/*"
|
|
32
31
|
|
|
33
32
|
# The native LiveVoice SDK
|
|
34
|
-
s.dependency "LiveVoiceSDK", '~>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if respond_to?(:install_modules_dependencies, true)
|
|
39
|
-
install_modules_dependencies(s)
|
|
40
|
-
else
|
|
41
|
-
s.dependency "React-Core"
|
|
42
|
-
|
|
43
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
44
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
45
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
46
|
-
s.pod_target_xcconfig = {
|
|
47
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
48
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
49
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
50
|
-
}
|
|
51
|
-
s.dependency "React-Codegen"
|
|
52
|
-
s.dependency "RCT-Folly"
|
|
53
|
-
s.dependency "RCTRequired"
|
|
54
|
-
s.dependency "RCTTypeSafety"
|
|
55
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
56
|
-
end
|
|
57
|
-
end
|
|
33
|
+
s.dependency "LiveVoiceSDK", '~> 2.0.0'
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
install_modules_dependencies(s)
|
|
58
37
|
end
|
package/package.json
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livevoice-sdk-react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The LiveVoice SDK for integrating simultaneous interpretation, AI voice translation, guided tours, silent events, and more into your app.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"module": "./lib/module/index.js",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
-
"default": "./lib/commonjs/index.js"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
19
14
|
},
|
|
20
15
|
"files": [
|
|
21
16
|
"src",
|
|
@@ -26,6 +21,8 @@
|
|
|
26
21
|
"*.podspec",
|
|
27
22
|
"react-native.config.js",
|
|
28
23
|
"!ios/build",
|
|
24
|
+
"!ios/generated",
|
|
25
|
+
"!android/generated",
|
|
29
26
|
"!android/build",
|
|
30
27
|
"!android/gradle",
|
|
31
28
|
"!android/gradlew",
|
|
@@ -37,17 +34,12 @@
|
|
|
37
34
|
"!**/.*"
|
|
38
35
|
],
|
|
39
36
|
"scripts": {
|
|
40
|
-
"example": "yarn
|
|
41
|
-
"test": "jest",
|
|
42
|
-
"typecheck": "tsc",
|
|
43
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
37
|
+
"example": "yarn workspace livevoice-sdk-react-native-example",
|
|
44
38
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
45
|
-
"prepare": "
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"clear-all": "sh clear-all.sh",
|
|
50
|
-
"native-version-generate": "node generate-native-versions.js"
|
|
39
|
+
"prepare": "bob build",
|
|
40
|
+
"typecheck": "tsc",
|
|
41
|
+
"native-version-generate": "node generate-native-versions.js",
|
|
42
|
+
"clear-all": "sh clear-all.sh"
|
|
51
43
|
},
|
|
52
44
|
"keywords": [
|
|
53
45
|
"react-native",
|
|
@@ -59,6 +51,10 @@
|
|
|
59
51
|
"silent events",
|
|
60
52
|
"realtime audio"
|
|
61
53
|
],
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://livevoice.iolivevoice.io.git"
|
|
57
|
+
},
|
|
62
58
|
"author": "LiveVoice GmbH <sdk-support@livevoice.io> (https://livevoice.io)",
|
|
63
59
|
"license": "MIT",
|
|
64
60
|
"bugs": {
|
|
@@ -69,29 +65,15 @@
|
|
|
69
65
|
"registry": "https://registry.npmjs.org/"
|
|
70
66
|
},
|
|
71
67
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@react-native-
|
|
74
|
-
"@react
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"eslint-config-prettier": "^9.0.0",
|
|
82
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
83
|
-
"jest": "^29.7.0",
|
|
84
|
-
"prettier": "^3.0.3",
|
|
85
|
-
"react": "19.0.0",
|
|
86
|
-
"react-native": "0.78.1",
|
|
87
|
-
"react-native-builder-bob": "^0.37.0",
|
|
88
|
-
"release-it": "^17.10.0",
|
|
89
|
-
"turbo": "^1.10.7",
|
|
90
|
-
"typedoc": "^0.28.2",
|
|
91
|
-
"typescript": "^5.2.2"
|
|
92
|
-
},
|
|
93
|
-
"resolutions": {
|
|
94
|
-
"@types/react": "^18.2.44"
|
|
68
|
+
"@react-native-community/cli": "latest",
|
|
69
|
+
"@react-native/babel-preset": "0.85.0",
|
|
70
|
+
"@types/react": "^19.2.0",
|
|
71
|
+
"del-cli": "^7.0.0",
|
|
72
|
+
"react": "19.2.3",
|
|
73
|
+
"react-native": "0.85.0",
|
|
74
|
+
"react-native-builder-bob": "^0.41.0",
|
|
75
|
+
"turbo": "^2.8.21",
|
|
76
|
+
"typescript": "^6.0.2"
|
|
95
77
|
},
|
|
96
78
|
"peerDependencies": {
|
|
97
79
|
"react": "*",
|
|
@@ -100,78 +82,11 @@
|
|
|
100
82
|
"workspaces": [
|
|
101
83
|
"example"
|
|
102
84
|
],
|
|
103
|
-
"packageManager": "yarn@
|
|
104
|
-
"jest": {
|
|
105
|
-
"preset": "react-native",
|
|
106
|
-
"modulePathIgnorePatterns": [
|
|
107
|
-
"<rootDir>/example/node_modules",
|
|
108
|
-
"<rootDir>/lib/"
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
|
-
"commitlint": {
|
|
112
|
-
"extends": [
|
|
113
|
-
"@commitlint/config-conventional"
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
"release-it": {
|
|
117
|
-
"git": {
|
|
118
|
-
"commitMessage": "chore: release ${version}",
|
|
119
|
-
"tagName": "v${version}"
|
|
120
|
-
},
|
|
121
|
-
"npm": {
|
|
122
|
-
"publish": true
|
|
123
|
-
},
|
|
124
|
-
"github": {
|
|
125
|
-
"release": true
|
|
126
|
-
},
|
|
127
|
-
"plugins": {
|
|
128
|
-
"@release-it/conventional-changelog": {
|
|
129
|
-
"preset": "angular"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"eslintConfig": {
|
|
134
|
-
"root": true,
|
|
135
|
-
"extends": [
|
|
136
|
-
"@react-native",
|
|
137
|
-
"prettier"
|
|
138
|
-
],
|
|
139
|
-
"rules": {
|
|
140
|
-
"react/react-in-jsx-scope": "off",
|
|
141
|
-
"prettier/prettier": [
|
|
142
|
-
"error",
|
|
143
|
-
{
|
|
144
|
-
"quoteProps": "consistent",
|
|
145
|
-
"singleQuote": true,
|
|
146
|
-
"tabWidth": 2,
|
|
147
|
-
"trailingComma": "es5",
|
|
148
|
-
"useTabs": false
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
"eslintIgnore": [
|
|
154
|
-
"node_modules/",
|
|
155
|
-
"lib/"
|
|
156
|
-
],
|
|
157
|
-
"prettier": {
|
|
158
|
-
"quoteProps": "consistent",
|
|
159
|
-
"singleQuote": true,
|
|
160
|
-
"tabWidth": 2,
|
|
161
|
-
"trailingComma": "es5",
|
|
162
|
-
"useTabs": false
|
|
163
|
-
},
|
|
85
|
+
"packageManager": "yarn@4.11.0",
|
|
164
86
|
"react-native-builder-bob": {
|
|
165
87
|
"source": "src",
|
|
166
88
|
"output": "lib",
|
|
167
89
|
"targets": [
|
|
168
|
-
"codegen",
|
|
169
|
-
[
|
|
170
|
-
"commonjs",
|
|
171
|
-
{
|
|
172
|
-
"esm": true
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
90
|
[
|
|
176
91
|
"module",
|
|
177
92
|
{
|
|
@@ -181,8 +96,7 @@
|
|
|
181
96
|
[
|
|
182
97
|
"typescript",
|
|
183
98
|
{
|
|
184
|
-
"project": "tsconfig.build.json"
|
|
185
|
-
"esm": true
|
|
99
|
+
"project": "tsconfig.build.json"
|
|
186
100
|
}
|
|
187
101
|
]
|
|
188
102
|
]
|
|
@@ -191,18 +105,14 @@
|
|
|
191
105
|
"name": "RNLiveVoiceSpec",
|
|
192
106
|
"type": "modules",
|
|
193
107
|
"jsSrcsDir": "src/specs",
|
|
194
|
-
"outputDir": {
|
|
195
|
-
"ios": "ios/generated",
|
|
196
|
-
"android": "android/generated"
|
|
197
|
-
},
|
|
198
108
|
"android": {
|
|
199
109
|
"javaPackageName": "io.livevoice.react"
|
|
200
|
-
}
|
|
201
|
-
"includesGeneratedCode": true
|
|
110
|
+
}
|
|
202
111
|
},
|
|
203
112
|
"create-react-native-library": {
|
|
204
113
|
"type": "turbo-module",
|
|
205
114
|
"languages": "kotlin-objc",
|
|
206
|
-
"
|
|
115
|
+
"tools": [],
|
|
116
|
+
"version": "0.62.0"
|
|
207
117
|
}
|
|
208
118
|
}
|
|
@@ -27,15 +27,16 @@ export interface AudioOutputSwitchProps {
|
|
|
27
27
|
|
|
28
28
|
export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) => {
|
|
29
29
|
const [isSpeaker, setIsSpeaker] = useState<Boolean>((() => (getCurrentAudioState())))
|
|
30
|
-
useEffect(
|
|
31
|
-
() => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
let subscription: { remove(): void } | undefined = onAudioOutputChanged((value: boolean) => {
|
|
32
|
+
console.log('State changed: ' + value);
|
|
33
|
+
setIsSpeaker(value);
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
subscription?.remove();
|
|
37
|
+
subscription = undefined;
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
39
40
|
|
|
40
41
|
const isDarkMode = props.isDarkMode != undefined ? props.isDarkMode : useColorScheme() === 'dark';
|
|
41
42
|
const animation = useRef(new Animated.Value(isSpeaker ? 1 : 0)).current;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import React, { useState } from 'react';
|
|
13
13
|
import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, Image } from 'react-native';
|
|
14
14
|
import { COLORS } from '../util/Colors';
|
|
15
|
-
import { Translations } from '../util/Translations';
|
|
16
15
|
import { type PlayingState } from '../util/PlayingState';
|
|
17
16
|
import PlayButtonView from './PlayButtonView';
|
|
18
17
|
|
|
@@ -22,9 +21,11 @@ export interface ChannelProps {
|
|
|
22
21
|
playingState: PlayingState;
|
|
23
22
|
muted: boolean;
|
|
24
23
|
isOnline: boolean;
|
|
25
|
-
|
|
24
|
+
hasAudio: boolean;
|
|
25
|
+
hasSubtitles: boolean;
|
|
26
26
|
isDarkMode?: boolean;
|
|
27
|
-
|
|
27
|
+
onAudioPress?: () => void;
|
|
28
|
+
onSubtitlesPress?: () => void;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export const ChannelView: React.FC<ChannelProps> = ({
|
|
@@ -32,20 +33,28 @@ export const ChannelView: React.FC<ChannelProps> = ({
|
|
|
32
33
|
playingState,
|
|
33
34
|
muted,
|
|
34
35
|
isOnline,
|
|
35
|
-
|
|
36
|
+
hasAudio,
|
|
37
|
+
hasSubtitles,
|
|
36
38
|
isDarkMode = useColorScheme() === 'dark',
|
|
37
|
-
|
|
39
|
+
onAudioPress,
|
|
40
|
+
onSubtitlesPress,
|
|
38
41
|
}) => {
|
|
39
42
|
|
|
40
43
|
const [collapsed, setCollapsed] = useState(true);
|
|
41
44
|
|
|
42
|
-
const backgroundColor = isDarkMode ? COLORS.cardBgDark : COLORS.cardBg
|
|
43
|
-
const secondaryColor = isDarkMode ? COLORS['gray-300'] : COLORS.gray
|
|
44
45
|
const iconColor = isDarkMode ? COLORS.white : COLORS.black
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
|
-
<View style={
|
|
48
|
-
<PlayButtonView
|
|
48
|
+
<View style={styles.container}>
|
|
49
|
+
<PlayButtonView
|
|
50
|
+
playingState={playingState}
|
|
51
|
+
onAudioPress={onAudioPress}
|
|
52
|
+
onSubtitlesPress={onSubtitlesPress}
|
|
53
|
+
isDarkMode={isDarkMode}
|
|
54
|
+
isChannelOnline={isOnline}
|
|
55
|
+
hasAudio={hasAudio}
|
|
56
|
+
hasSubtitles={hasSubtitles}
|
|
57
|
+
/>
|
|
49
58
|
|
|
50
59
|
{/* Channel Name */}
|
|
51
60
|
<View style={{ flex: 1, marginLeft: 10 }}>
|
|
@@ -54,19 +63,6 @@ export const ChannelView: React.FC<ChannelProps> = ({
|
|
|
54
63
|
{channelName}
|
|
55
64
|
</Text>
|
|
56
65
|
</TouchableOpacity>
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
/* Ai-Speaker status message */
|
|
60
|
-
aiSpeaker && (
|
|
61
|
-
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}>
|
|
62
|
-
<Image
|
|
63
|
-
source={require('../icons/cpu.png')}
|
|
64
|
-
style={{ width: 16, height: 16, tintColor: secondaryColor, resizeMode: 'contain' }} />
|
|
65
|
-
|
|
66
|
-
<Text style={[styles.aiText, { color: secondaryColor }]}>{Translations.isAiChannelStatusMessage()}</Text>
|
|
67
|
-
</View>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
66
|
</View>
|
|
71
67
|
{
|
|
72
68
|
muted &&
|
|
@@ -83,9 +79,6 @@ const styles = StyleSheet.create({
|
|
|
83
79
|
flexDirection: 'row',
|
|
84
80
|
alignItems: 'center',
|
|
85
81
|
padding: 10,
|
|
86
|
-
backgroundColor: '#fff',
|
|
87
|
-
borderRadius: 8,
|
|
88
|
-
marginBottom: 10,
|
|
89
82
|
},
|
|
90
83
|
text: {
|
|
91
84
|
fontSize: 16,
|