livevoice-sdk-react-native 1.0.3 → 2.0.1
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 +119 -7
- package/android/build.gradle +52 -84
- package/android/gradle.properties +10 -6
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +93 -126
- package/android/src/main/java/io/livevoice/react/LiveVoiceSdkReactNativePackage.kt +12 -13
- package/android/src/main/java/io/livevoice/react/__SDK.kt +16 -2
- package/ios/LiveVoiceSdkReactNative.h +5 -5
- package/ios/LiveVoiceSdkReactNative.mm +308 -0
- package/ios/__SDK.h +16 -2
- package/lib/module/components/AudioOutputSwitchView.js +13 -13
- package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
- package/lib/module/components/BrandingView.js +13 -11
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +27 -48
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +12 -10
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceView.js +153 -61
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PlayButtonView.js +255 -94
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +16 -13
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/components/WarningView.js +12 -10
- package/lib/module/components/WarningView.js.map +1 -1
- package/lib/module/components/index.js +12 -10
- package/lib/module/components/index.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 +14 -222
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/LiveVoiceSdk.js +371 -0
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
- package/lib/module/sdk/LiveVoiceState.js +66 -0
- package/lib/module/sdk/LiveVoiceState.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js +16 -10
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +14 -11
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/ForegroundServiceConfig.js +21 -11
- package/lib/module/util/ForegroundServiceConfig.js.map +1 -1
- package/lib/module/util/PlayingState.js +12 -10
- package/lib/module/util/PlayingState.js.map +1 -1
- package/lib/module/util/Translations.js +12 -10
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/logger.js +76 -0
- package/lib/module/util/logger.js.map +1 -0
- 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 +28 -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/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +210 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +12 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
- package/lib/typescript/{module/src → src}/specs/NativeLiveVoiceSdk.d.ts +6 -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 +19 -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/src/util/UIState.d.ts +86 -0
- package/lib/typescript/src/util/UIState.d.ts.map +1 -0
- package/lib/typescript/src/util/logger.d.ts +23 -0
- package/lib/typescript/src/util/logger.d.ts.map +1 -0
- package/livevoice-sdk-react-native.podspec +20 -41
- package/package.json +41 -122
- package/src/components/AudioOutputSwitchView.tsx +13 -13
- package/src/components/BrandingView.tsx +13 -11
- package/src/components/ChannelView.tsx +32 -36
- package/src/components/ErrorView.tsx +12 -10
- package/src/components/LiveVoiceView.tsx +231 -89
- package/src/components/PlayButtonView.tsx +293 -98
- package/src/components/ReconnectingView.tsx +20 -13
- package/src/components/WarningView.tsx +12 -10
- package/src/components/index.tsx +12 -10
- 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 +19 -236
- package/src/sdk/LiveVoiceSdk.ts +408 -0
- package/src/sdk/LiveVoiceState.ts +89 -0
- package/src/specs/NativeLiveVoiceSdk.ts +24 -16
- package/src/util/Colors.ts +15 -11
- package/src/util/ForegroundServiceConfig.tsx +21 -11
- package/src/util/PlayingState.ts +12 -10
- package/src/util/Translations.ts +12 -10
- package/src/util/UIState.ts +54 -13
- package/src/util/logger.ts +92 -0
- package/android/generated/java/io/livevoice/react/NativeLiveVoiceSdkSpec.java +0 -186
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNLiveVoiceSpec-generated.cpp +0 -235
- package/android/generated/jni/RNLiveVoiceSpec.h +0 -31
- 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/android/src/main/java/io/livevoice/react/Mappings.kt +0 -54
- package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -77
- package/ios/LivevoiceSdkReactNative.mm +0 -250
- 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 +0 -6
- 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 +0 -149
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts +0 -48
- 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 +0 -12
- 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.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 +0 -45
- 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/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/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/PlayingState.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/util/Translations.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAcA,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;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AAG1E,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAgE,CAAC;AAEhH,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":"AAaA,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":"AAoBA,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"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type PlayingState } from './PlayingState';
|
|
2
|
+
export type UiState = Ready | ErrorState | Loading | Reconnecting;
|
|
3
|
+
/**
|
|
4
|
+
* UI state top-level types
|
|
5
|
+
*/
|
|
6
|
+
export interface Ready {
|
|
7
|
+
type: 'ready';
|
|
8
|
+
channels: Channel[];
|
|
9
|
+
outputMode: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Loading {
|
|
12
|
+
type: 'loading';
|
|
13
|
+
}
|
|
14
|
+
export interface ErrorState {
|
|
15
|
+
type: 'error';
|
|
16
|
+
message: string;
|
|
17
|
+
canBeRetried: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface RetryInProgress {
|
|
20
|
+
type: 'inProgress';
|
|
21
|
+
}
|
|
22
|
+
export interface AwaitingRetry {
|
|
23
|
+
type: 'awaitingRetry';
|
|
24
|
+
retryAt: Date;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use retryAt instead. This is a Unix timestamp in seconds.
|
|
27
|
+
*/
|
|
28
|
+
atTimestamp: number;
|
|
29
|
+
}
|
|
30
|
+
export type RetryState = RetryInProgress | AwaitingRetry;
|
|
31
|
+
export interface Reconnecting {
|
|
32
|
+
type: 'reconnecting';
|
|
33
|
+
state: RetryState;
|
|
34
|
+
}
|
|
35
|
+
export type ErrorOrReconnecting = ErrorState | Reconnecting;
|
|
36
|
+
/**
|
|
37
|
+
* Other types
|
|
38
|
+
*/
|
|
39
|
+
export interface Channel {
|
|
40
|
+
type: 'channel';
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
isOnline: boolean;
|
|
44
|
+
hasAudio: boolean;
|
|
45
|
+
hasSubtitles: boolean;
|
|
46
|
+
isAudioMuted: boolean;
|
|
47
|
+
aiTranslationInfo: AITranslationInfo | null;
|
|
48
|
+
dependentChannels: DependentChannel[];
|
|
49
|
+
playingState: PlayingState;
|
|
50
|
+
}
|
|
51
|
+
export interface AITranslationInfo {
|
|
52
|
+
sourceID: number;
|
|
53
|
+
targetLanguage: string;
|
|
54
|
+
}
|
|
55
|
+
export interface DependentChannel {
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
sourceChannelID: number;
|
|
59
|
+
language: string;
|
|
60
|
+
hasSubtitles: boolean;
|
|
61
|
+
hasAudio: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface AvailableSubtitle {
|
|
64
|
+
id: number;
|
|
65
|
+
name: string;
|
|
66
|
+
language: string | null;
|
|
67
|
+
parent: number | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The current subtitle state.
|
|
71
|
+
*
|
|
72
|
+
* - `disabled`: no subtitles are being received.
|
|
73
|
+
* - `automatic`: subtitles follow the currently playing channel.
|
|
74
|
+
* - `specific`: subtitles for an explicitly chosen channel.
|
|
75
|
+
*/
|
|
76
|
+
export type SubtitleState = {
|
|
77
|
+
type: 'disabled';
|
|
78
|
+
} | {
|
|
79
|
+
type: 'automatic';
|
|
80
|
+
fragments: string[];
|
|
81
|
+
} | {
|
|
82
|
+
type: 'specific';
|
|
83
|
+
channelId: number;
|
|
84
|
+
fragments: string[];
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=UIState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIState.d.ts","sourceRoot":"","sources":["../../../../src/util/UIState.ts"],"names":[],"mappings":"AAaA,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,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,OAAO,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,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,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,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;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ForegroundServiceConfig } from "./ForegroundServiceConfig";
|
|
2
|
+
import { type UiState } from "./UIState";
|
|
3
|
+
type LogFields = Record<string, string | number | boolean | null | undefined>;
|
|
4
|
+
export declare const LiveVoiceLogEvent: {
|
|
5
|
+
readonly init: "LV_INIT";
|
|
6
|
+
readonly joinRequest: "LV_JOIN_REQUEST";
|
|
7
|
+
readonly leave: "LV_LEAVE";
|
|
8
|
+
readonly reconnectRequest: "LV_RECONNECT_REQUEST";
|
|
9
|
+
readonly uiState: "LV_UI_STATE";
|
|
10
|
+
readonly audioOutputSet: "LV_AUDIO_OUTPUT_SET";
|
|
11
|
+
readonly audioOutputChanged: "LV_AUDIO_OUTPUT_CHANGED";
|
|
12
|
+
readonly channelStart: "LV_CHANNEL_START";
|
|
13
|
+
readonly channelStop: "LV_CHANNEL_STOP";
|
|
14
|
+
readonly subtitlesStart: "LV_SUBTITLES_START";
|
|
15
|
+
readonly subtitlesStop: "LV_SUBTITLES_STOP";
|
|
16
|
+
readonly openWebsite: "LV_OPEN_WEBSITE";
|
|
17
|
+
};
|
|
18
|
+
export declare function logInfo(event: string, fields?: LogFields): void;
|
|
19
|
+
export declare function logUiState(state: UiState): void;
|
|
20
|
+
export declare function logAudioOutputChanged(useSpeaker: boolean): void;
|
|
21
|
+
export declare function describeForegroundServiceConfig(serviceConfig: ForegroundServiceConfig): string;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/util/logger.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,WAAW,CAAC;AAE1D,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAapB,CAAC;AAEX,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAE/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE/C;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAI/D;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,uBAAuB,GACrC,MAAM,CAGR"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# This source file is part of the LiveVoice SDK project
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) LiveVoice GmbH
|
|
6
|
+
# Licensed under the MIT license
|
|
7
|
+
#
|
|
8
|
+
# See LICENSE for license information
|
|
9
|
+
#
|
|
10
|
+
# SPDX-License-Identifier: MIT
|
|
11
|
+
#
|
|
12
|
+
#===----------------------------------------------------------------------===#
|
|
13
13
|
|
|
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.
|
|
32
|
-
|
|
33
|
-
# 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
|
|
29
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
30
|
+
s.exclude_files = "ios/generated/**/*"
|
|
31
|
+
|
|
32
|
+
# The native LiveVoice SDK.
|
|
33
|
+
s.dependency "LiveVoiceSDK", '2.0.2'
|
|
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.1",
|
|
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,22 @@
|
|
|
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
|
-
"
|
|
50
|
-
"
|
|
39
|
+
"prepare": "bob build",
|
|
40
|
+
"test": "jest --runInBand",
|
|
41
|
+
"typecheck": "tsc",
|
|
42
|
+
"check:headers": "node tool/license-headers.mjs --check",
|
|
43
|
+
"fix:headers": "node tool/license-headers.mjs --fix",
|
|
44
|
+
"check:pins": "node tool/check-native-pins.mjs",
|
|
45
|
+
"headers:check": "node tool/license-headers.mjs --check",
|
|
46
|
+
"headers:fix": "node tool/license-headers.mjs --fix",
|
|
47
|
+
"native-version-generate": "node tool/generate-native-versions.mjs",
|
|
48
|
+
"versions:sync": "node tool/generate-native-versions.mjs",
|
|
49
|
+
"matrix:list": "node tool/test-rn-version.mjs --list-versions-json",
|
|
50
|
+
"matrix:test": "node tool/test-rn-version.mjs",
|
|
51
|
+
"clear-all": "node tool/clean-all.mjs",
|
|
52
|
+
"clean:all": "node tool/clean-all.mjs"
|
|
51
53
|
},
|
|
52
54
|
"keywords": [
|
|
53
55
|
"react-native",
|
|
@@ -69,29 +71,18 @@
|
|
|
69
71
|
"registry": "https://registry.npmjs.org/"
|
|
70
72
|
},
|
|
71
73
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@react-native-
|
|
74
|
-
"@react-native/
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"@types/react": "^19.0.0",
|
|
78
|
-
"commitlint": "^17.0.2",
|
|
79
|
-
"del-cli": "^5.1.0",
|
|
80
|
-
"eslint": "^8.51.0",
|
|
81
|
-
"eslint-config-prettier": "^9.0.0",
|
|
82
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
74
|
+
"@react-native-community/cli": "latest",
|
|
75
|
+
"@react-native/babel-preset": "0.85.0",
|
|
76
|
+
"@react-native/jest-preset": "0.85.0",
|
|
77
|
+
"@types/react": "^19.2.0",
|
|
78
|
+
"del-cli": "^7.0.0",
|
|
83
79
|
"jest": "^29.7.0",
|
|
84
|
-
"
|
|
85
|
-
"react": "
|
|
86
|
-
"react-native": "0.
|
|
87
|
-
"react-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"typedoc": "^0.28.2",
|
|
91
|
-
"typescript": "^5.2.2"
|
|
92
|
-
},
|
|
93
|
-
"resolutions": {
|
|
94
|
-
"@types/react": "^18.2.44"
|
|
80
|
+
"react": "19.2.3",
|
|
81
|
+
"react-native": "0.85.0",
|
|
82
|
+
"react-native-builder-bob": "^0.41.0",
|
|
83
|
+
"react-test-renderer": "19.2.3",
|
|
84
|
+
"turbo": "^2.8.21",
|
|
85
|
+
"typescript": "^6.0.2"
|
|
95
86
|
},
|
|
96
87
|
"peerDependencies": {
|
|
97
88
|
"react": "*",
|
|
@@ -100,78 +91,11 @@
|
|
|
100
91
|
"workspaces": [
|
|
101
92
|
"example"
|
|
102
93
|
],
|
|
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
|
-
},
|
|
94
|
+
"packageManager": "yarn@4.11.0",
|
|
164
95
|
"react-native-builder-bob": {
|
|
165
96
|
"source": "src",
|
|
166
97
|
"output": "lib",
|
|
167
98
|
"targets": [
|
|
168
|
-
"codegen",
|
|
169
|
-
[
|
|
170
|
-
"commonjs",
|
|
171
|
-
{
|
|
172
|
-
"esm": true
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
99
|
[
|
|
176
100
|
"module",
|
|
177
101
|
{
|
|
@@ -181,8 +105,7 @@
|
|
|
181
105
|
[
|
|
182
106
|
"typescript",
|
|
183
107
|
{
|
|
184
|
-
"project": "tsconfig.build.json"
|
|
185
|
-
"esm": true
|
|
108
|
+
"project": "tsconfig.build.json"
|
|
186
109
|
}
|
|
187
110
|
]
|
|
188
111
|
]
|
|
@@ -191,18 +114,14 @@
|
|
|
191
114
|
"name": "RNLiveVoiceSpec",
|
|
192
115
|
"type": "modules",
|
|
193
116
|
"jsSrcsDir": "src/specs",
|
|
194
|
-
"outputDir": {
|
|
195
|
-
"ios": "ios/generated",
|
|
196
|
-
"android": "android/generated"
|
|
197
|
-
},
|
|
198
117
|
"android": {
|
|
199
118
|
"javaPackageName": "io.livevoice.react"
|
|
200
|
-
}
|
|
201
|
-
"includesGeneratedCode": true
|
|
119
|
+
}
|
|
202
120
|
},
|
|
203
121
|
"create-react-native-library": {
|
|
204
122
|
"type": "turbo-module",
|
|
205
123
|
"languages": "kotlin-objc",
|
|
206
|
-
"
|
|
124
|
+
"tools": [],
|
|
125
|
+
"version": "0.62.0"
|
|
207
126
|
}
|
|
208
127
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
|
2
|
+
//
|
|
3
|
+
// This source file is part of the LiveVoice SDK project
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) LiveVoice GmbH
|
|
6
|
+
// Licensed under the MIT license
|
|
7
|
+
//
|
|
8
|
+
// See LICENSE for license information
|
|
9
|
+
//
|
|
10
|
+
// SPDX-License-Identifier: MIT
|
|
11
|
+
//
|
|
12
|
+
//===----------------------------------------------------------------------===//
|
|
11
13
|
|
|
12
|
-
import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from '
|
|
14
|
+
import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from '../sdk/LiveVoiceSdk';
|
|
13
15
|
import React, { useState, useRef, useEffect, } from 'react';
|
|
14
16
|
import {
|
|
15
17
|
View,
|
|
@@ -29,7 +31,6 @@ export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) =
|
|
|
29
31
|
const [isSpeaker, setIsSpeaker] = useState<Boolean>((() => (getCurrentAudioState())))
|
|
30
32
|
useEffect(() => {
|
|
31
33
|
let subscription: { remove(): void } | undefined = onAudioOutputChanged((value: boolean) => {
|
|
32
|
-
console.log('State changed: ' + value);
|
|
33
34
|
setIsSpeaker(value);
|
|
34
35
|
});
|
|
35
36
|
return () => {
|
|
@@ -61,7 +62,6 @@ export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) =
|
|
|
61
62
|
<TouchableOpacity
|
|
62
63
|
activeOpacity={1}
|
|
63
64
|
onPress={() => {
|
|
64
|
-
console.log('Clicked: with current' + isSpeaker);
|
|
65
65
|
setLiveVoiceUseSpeaker(!isSpeaker);
|
|
66
66
|
}}
|
|
67
67
|
style={[
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
|
2
|
+
//
|
|
3
|
+
// This source file is part of the LiveVoice SDK project
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) LiveVoice GmbH
|
|
6
|
+
// Licensed under the MIT license
|
|
7
|
+
//
|
|
8
|
+
// See LICENSE for license information
|
|
9
|
+
//
|
|
10
|
+
// SPDX-License-Identifier: MIT
|
|
11
|
+
//
|
|
12
|
+
//===----------------------------------------------------------------------===//
|
|
11
13
|
|
|
12
14
|
import React from 'react';
|
|
13
15
|
import {
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
} from 'react-native';
|
|
21
23
|
|
|
22
24
|
import { COLORS } from '../util/Colors';
|
|
23
|
-
import { openLiveVoiceWebsite } from '
|
|
25
|
+
import { openLiveVoiceWebsite } from '../sdk/LiveVoiceSdk';
|
|
24
26
|
|
|
25
27
|
export interface BrandingProps {
|
|
26
28
|
isDarkMode?: boolean;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
|
2
|
+
//
|
|
3
|
+
// This source file is part of the LiveVoice SDK project
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) LiveVoice GmbH
|
|
6
|
+
// Licensed under the MIT license
|
|
7
|
+
//
|
|
8
|
+
// See LICENSE for license information
|
|
9
|
+
//
|
|
10
|
+
// SPDX-License-Identifier: MIT
|
|
11
|
+
//
|
|
12
|
+
//===----------------------------------------------------------------------===//
|
|
11
13
|
|
|
12
14
|
import React, { useState } from 'react';
|
|
13
15
|
import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, Image } from 'react-native';
|
|
14
16
|
import { COLORS } from '../util/Colors';
|
|
15
|
-
import { Translations } from '../util/Translations';
|
|
16
17
|
import { type PlayingState } from '../util/PlayingState';
|
|
17
18
|
import PlayButtonView from './PlayButtonView';
|
|
18
19
|
|
|
@@ -22,9 +23,11 @@ export interface ChannelProps {
|
|
|
22
23
|
playingState: PlayingState;
|
|
23
24
|
muted: boolean;
|
|
24
25
|
isOnline: boolean;
|
|
25
|
-
|
|
26
|
+
hasAudio: boolean;
|
|
27
|
+
hasSubtitles: boolean;
|
|
26
28
|
isDarkMode?: boolean;
|
|
27
|
-
|
|
29
|
+
onAudioPress?: () => void;
|
|
30
|
+
onSubtitlesPress?: () => void;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
export const ChannelView: React.FC<ChannelProps> = ({
|
|
@@ -32,20 +35,28 @@ export const ChannelView: React.FC<ChannelProps> = ({
|
|
|
32
35
|
playingState,
|
|
33
36
|
muted,
|
|
34
37
|
isOnline,
|
|
35
|
-
|
|
38
|
+
hasAudio,
|
|
39
|
+
hasSubtitles,
|
|
36
40
|
isDarkMode = useColorScheme() === 'dark',
|
|
37
|
-
|
|
41
|
+
onAudioPress,
|
|
42
|
+
onSubtitlesPress,
|
|
38
43
|
}) => {
|
|
39
44
|
|
|
40
45
|
const [collapsed, setCollapsed] = useState(true);
|
|
41
46
|
|
|
42
|
-
const backgroundColor = isDarkMode ? COLORS.cardBgDark : COLORS.cardBg
|
|
43
|
-
const secondaryColor = isDarkMode ? COLORS['gray-300'] : COLORS.gray
|
|
44
47
|
const iconColor = isDarkMode ? COLORS.white : COLORS.black
|
|
45
48
|
|
|
46
49
|
return (
|
|
47
|
-
<View style={
|
|
48
|
-
<PlayButtonView
|
|
50
|
+
<View style={styles.container}>
|
|
51
|
+
<PlayButtonView
|
|
52
|
+
playingState={playingState}
|
|
53
|
+
onAudioPress={onAudioPress}
|
|
54
|
+
onSubtitlesPress={onSubtitlesPress}
|
|
55
|
+
isDarkMode={isDarkMode}
|
|
56
|
+
isChannelOnline={isOnline}
|
|
57
|
+
hasAudio={hasAudio}
|
|
58
|
+
hasSubtitles={hasSubtitles}
|
|
59
|
+
/>
|
|
49
60
|
|
|
50
61
|
{/* Channel Name */}
|
|
51
62
|
<View style={{ flex: 1, marginLeft: 10 }}>
|
|
@@ -54,19 +65,6 @@ export const ChannelView: React.FC<ChannelProps> = ({
|
|
|
54
65
|
{channelName}
|
|
55
66
|
</Text>
|
|
56
67
|
</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
68
|
</View>
|
|
71
69
|
{
|
|
72
70
|
muted &&
|
|
@@ -82,10 +80,8 @@ const styles = StyleSheet.create({
|
|
|
82
80
|
container: {
|
|
83
81
|
flexDirection: 'row',
|
|
84
82
|
alignItems: 'center',
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
borderRadius: 8,
|
|
88
|
-
marginBottom: 10,
|
|
83
|
+
paddingHorizontal: 12,
|
|
84
|
+
paddingVertical: 8,
|
|
89
85
|
},
|
|
90
86
|
text: {
|
|
91
87
|
fontSize: 16,
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
|
2
|
+
//
|
|
3
|
+
// This source file is part of the LiveVoice SDK project
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) LiveVoice GmbH
|
|
6
|
+
// Licensed under the MIT license
|
|
7
|
+
//
|
|
8
|
+
// See LICENSE for license information
|
|
9
|
+
//
|
|
10
|
+
// SPDX-License-Identifier: MIT
|
|
11
|
+
//
|
|
12
|
+
//===----------------------------------------------------------------------===//
|
|
11
13
|
|
|
12
14
|
import React from 'react';
|
|
13
15
|
import { View, Text, useColorScheme, StyleSheet, TouchableOpacity } from 'react-native';
|