livevoice-sdk-react-native 1.0.3 → 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/ChannelView.js +14 -38
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/LiveVoiceView.js +46 -23
- 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 +19 -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 +11 -15
- 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/ChannelView.tsx +18 -25
- package/src/components/LiveVoiceView.tsx +110 -59
- 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 +95 -79
- 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 -144
- 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 -107
- 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 -327
- 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 -149
- 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,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
|
}
|
|
@@ -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,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
type UiState,
|
|
14
|
-
type
|
|
14
|
+
type AvailableSubtitle,
|
|
15
15
|
getCurrentUiState,
|
|
16
16
|
onUiStateChanged,
|
|
17
17
|
startChannel,
|
|
@@ -22,28 +22,32 @@ import {
|
|
|
22
22
|
getCurrentClaims,
|
|
23
23
|
BrandingView,
|
|
24
24
|
ErrorView,
|
|
25
|
-
ReconnectingView
|
|
26
|
-
|
|
25
|
+
ReconnectingView,
|
|
26
|
+
startSubtitles,
|
|
27
|
+
} from "livevoice-sdk-react-native";
|
|
27
28
|
|
|
28
|
-
import {
|
|
29
|
-
import { View, ActivityIndicator } from 'react-native';
|
|
29
|
+
import { PlayingState } from "../util/PlayingState";
|
|
30
30
|
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
|
|
31
|
+
import { useEffect, useState } from "react";
|
|
32
|
+
import { View, ActivityIndicator } from "react-native";
|
|
33
|
+
|
|
34
|
+
import { COLORS } from "../util/Colors";
|
|
35
|
+
import { type Channel } from "../util/UIState";
|
|
36
|
+
import { ChannelView } from "./ChannelView";
|
|
34
37
|
|
|
35
38
|
export interface LiveVoiceViewProps {
|
|
36
39
|
isDarkMode?: boolean;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
export const LiveVoiceView: React.FC<LiveVoiceViewProps> = ({ isDarkMode }) => {
|
|
40
|
-
const [uiState, setUiState] = useState<UiState>((
|
|
43
|
+
const [uiState, setUiState] = useState<UiState>(() => getCurrentUiState());
|
|
41
44
|
|
|
42
45
|
useEffect(() => {
|
|
43
|
-
let subscription: { remove: () => void
|
|
44
|
-
|
|
46
|
+
let subscription: { remove: () => void } | undefined = onUiStateChanged(
|
|
47
|
+
(data: UiState) => {
|
|
45
48
|
setUiState(data);
|
|
46
|
-
}
|
|
49
|
+
},
|
|
50
|
+
);
|
|
47
51
|
return () => {
|
|
48
52
|
subscription?.remove();
|
|
49
53
|
subscription = undefined;
|
|
@@ -51,9 +55,11 @@ export const LiveVoiceView: React.FC<LiveVoiceViewProps> = ({ isDarkMode }) => {
|
|
|
51
55
|
}, []);
|
|
52
56
|
|
|
53
57
|
useEffect(() => {
|
|
54
|
-
let subscription: { remove: () => void
|
|
55
|
-
onAvailableSubtitleConfigsChanged((data:
|
|
56
|
-
console.log(
|
|
58
|
+
let subscription: { remove: () => void } | undefined =
|
|
59
|
+
onAvailableSubtitleConfigsChanged((data: [AvailableSubtitle]) => {
|
|
60
|
+
console.log(
|
|
61
|
+
"available subtitles changed! …" + JSON.stringify(data).slice(-20),
|
|
62
|
+
);
|
|
57
63
|
});
|
|
58
64
|
return () => {
|
|
59
65
|
subscription?.remove();
|
|
@@ -62,68 +68,113 @@ export const LiveVoiceView: React.FC<LiveVoiceViewProps> = ({ isDarkMode }) => {
|
|
|
62
68
|
}, []);
|
|
63
69
|
|
|
64
70
|
useEffect(() => {
|
|
65
|
-
let subscription: { remove: () => void
|
|
66
|
-
|
|
67
|
-
console.log(
|
|
68
|
-
|
|
71
|
+
let subscription: { remove: () => void } | undefined = onSubtitlesChanged(
|
|
72
|
+
(data: [String]) => {
|
|
73
|
+
console.log(
|
|
74
|
+
"available subtitles changed! …" + JSON.stringify(data).slice(-20),
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
69
78
|
return () => {
|
|
70
79
|
subscription?.remove();
|
|
71
80
|
subscription = undefined;
|
|
72
81
|
};
|
|
73
82
|
}, []);
|
|
74
83
|
|
|
75
|
-
const claims = getCurrentClaims()
|
|
84
|
+
const claims = getCurrentClaims();
|
|
76
85
|
|
|
77
86
|
switch (uiState.type) {
|
|
78
|
-
case
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
case "ready":
|
|
88
|
+
const backgroundColor = isDarkMode ? COLORS.cardBgDark : COLORS.cardBg;
|
|
89
|
+
const dividerColor = isDarkMode ? COLORS.dividerDark : COLORS.divider;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View style={{ width: "100%" }}>
|
|
93
|
+
<View
|
|
94
|
+
style={{
|
|
95
|
+
backgroundColor: backgroundColor,
|
|
96
|
+
borderRadius: 8,
|
|
97
|
+
overflow: "hidden",
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
{uiState.channels.map((channel: Channel, index: number) => (
|
|
101
|
+
<View key={index}>
|
|
102
|
+
<ChannelView
|
|
103
|
+
playingState={channel.playingState}
|
|
104
|
+
isDarkMode={isDarkMode}
|
|
105
|
+
muted={channel.isAudioMuted}
|
|
106
|
+
isOnline={channel.isOnline}
|
|
107
|
+
hasAudio={channel.hasAudio}
|
|
108
|
+
hasSubtitles={channel.hasSubtitles}
|
|
109
|
+
channelName={channel.name}
|
|
110
|
+
onAudioPress={() =>
|
|
111
|
+
channel.playingState === PlayingState.PLAYING
|
|
112
|
+
? stopChannel()
|
|
113
|
+
: startChannel(channel.id)
|
|
114
|
+
}
|
|
115
|
+
onSubtitlesPress={() => startSubtitles(channel.id)}
|
|
116
|
+
/>
|
|
117
|
+
{index < uiState.channels.length - 1 && (
|
|
118
|
+
<View
|
|
119
|
+
style={{
|
|
120
|
+
height: 1,
|
|
121
|
+
backgroundColor: dividerColor,
|
|
122
|
+
marginHorizontal: 10,
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
</View>
|
|
127
|
+
))}
|
|
128
|
+
</View>
|
|
129
|
+
|
|
130
|
+
{(claims === null || !claims.hideBranding) && (
|
|
131
|
+
<BrandingView isDarkMode={isDarkMode} />
|
|
132
|
+
)}
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
case "loading":
|
|
137
|
+
const loadingBackgroundColor = isDarkMode
|
|
138
|
+
? COLORS.cardBgDark
|
|
139
|
+
: COLORS.cardBg;
|
|
101
140
|
|
|
102
141
|
return (
|
|
103
|
-
<View
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
142
|
+
<View
|
|
143
|
+
style={{
|
|
144
|
+
width: "100%",
|
|
145
|
+
padding: 10,
|
|
146
|
+
borderRadius: 8,
|
|
147
|
+
justifyContent: "center",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
backgroundColor: loadingBackgroundColor,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
111
152
|
<ActivityIndicator size={40} color={COLORS.primary} />
|
|
112
153
|
</View>
|
|
113
154
|
);
|
|
114
155
|
|
|
115
|
-
case
|
|
156
|
+
case "error":
|
|
116
157
|
return (
|
|
117
|
-
<ErrorView
|
|
118
|
-
|
|
158
|
+
<ErrorView
|
|
159
|
+
state={uiState}
|
|
160
|
+
onPress={() => {
|
|
161
|
+
reconnect();
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
119
165
|
|
|
120
|
-
case
|
|
166
|
+
case "reconnecting":
|
|
121
167
|
return (
|
|
122
|
-
<ReconnectingView
|
|
123
|
-
|
|
168
|
+
<ReconnectingView
|
|
169
|
+
state={uiState}
|
|
170
|
+
onPress={() => {
|
|
171
|
+
reconnect();
|
|
172
|
+
}}
|
|
173
|
+
/>
|
|
174
|
+
);
|
|
124
175
|
default:
|
|
125
|
-
return <View
|
|
176
|
+
return <View />;
|
|
126
177
|
}
|
|
127
178
|
};
|
|
128
179
|
|
|
129
|
-
export default LiveVoiceView;
|
|
180
|
+
export default LiveVoiceView;
|