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
|
@@ -18,28 +18,27 @@ import com.facebook.react.bridge.NativeModule
|
|
|
18
18
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
19
19
|
import com.facebook.react.module.model.ReactModuleInfo
|
|
20
20
|
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
21
|
+
import java.util.HashMap
|
|
21
22
|
|
|
22
23
|
class LiveVoiceSdkReactNativePackage : BaseReactPackage() {
|
|
23
24
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
24
25
|
return if (name == LiveVoiceModule.NAME) {
|
|
25
|
-
|
|
26
|
+
LiveVoiceModule(reactContext)
|
|
26
27
|
} else {
|
|
27
28
|
null
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
override fun getReactModuleInfoProvider()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
LiveVoiceModule.NAME,
|
|
36
|
-
|
|
37
|
-
false,
|
|
38
|
-
false,
|
|
39
|
-
|
|
40
|
-
true // isTurboModule
|
|
32
|
+
override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
|
|
33
|
+
mapOf(
|
|
34
|
+
LiveVoiceModule.NAME to ReactModuleInfo(
|
|
35
|
+
name = LiveVoiceModule.NAME,
|
|
36
|
+
className = LiveVoiceModule.NAME,
|
|
37
|
+
canOverrideExistingModule = false,
|
|
38
|
+
needsEagerInit = false,
|
|
39
|
+
isCxxModule = false,
|
|
40
|
+
isTurboModule = true
|
|
41
41
|
)
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
)
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
14
|
+
// GENERATED CODE - DO NOT MODIFY BY HAND.
|
|
15
|
+
// Generated by tool/generate-native-versions.mjs from package.json.
|
|
2
16
|
package io.livevoice.react
|
|
3
17
|
|
|
4
18
|
object Version {
|
|
5
|
-
const val SDK_VERSION = "
|
|
19
|
+
const val SDK_VERSION = "2.0.1"
|
|
6
20
|
}
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
//
|
|
12
12
|
//===----------------------------------------------------------------------===//
|
|
13
13
|
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
//// See https://reactnative.dev/docs/next/legacy/native-modules-ios
|
|
17
|
-
//#import <React/RCTEventEmitter.h>
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
#import "RNLiveVoiceSpec.h"
|
|
18
16
|
|
|
19
|
-
@interface LiveVoiceSdkReactNative
|
|
17
|
+
@interface LiveVoiceSdkReactNative
|
|
18
|
+
: NativeLiveVoiceSdkSpecBase <NativeLiveVoiceSdkSpec>
|
|
20
19
|
|
|
21
20
|
@end
|
|
21
|
+
#endif
|
|
@@ -0,0 +1,308 @@
|
|
|
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
|
+
|
|
14
|
+
#import "LiveVoiceSdkReactNative.h"
|
|
15
|
+
#import "LiveVoiceSDK/LiveVoiceSDK.h"
|
|
16
|
+
#import "React/RCTVersion.h"
|
|
17
|
+
#import "__SDK.h"
|
|
18
|
+
#import <os/log.h>
|
|
19
|
+
|
|
20
|
+
static os_log_t LiveVoiceLogHandle(void) {
|
|
21
|
+
static os_log_t logHandle;
|
|
22
|
+
static dispatch_once_t onceToken;
|
|
23
|
+
dispatch_once(&onceToken, ^{
|
|
24
|
+
logHandle = os_log_create("io.livevoice.react-native", "LiveVoiceSdkReactNative");
|
|
25
|
+
});
|
|
26
|
+
return logHandle;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static NSString *LiveVoiceFormatMessage(NSString *event,
|
|
30
|
+
NSDictionary<NSString *, id> *fields) {
|
|
31
|
+
NSMutableArray<NSString *> *parts = [NSMutableArray arrayWithObject:event];
|
|
32
|
+
NSArray<NSString *> *keys =
|
|
33
|
+
[[fields allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
|
34
|
+
|
|
35
|
+
for (NSString *key in keys) {
|
|
36
|
+
id value = fields[key];
|
|
37
|
+
if (value == nil || value == [NSNull null]) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return [parts componentsJoinedByString:@" "];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static void LiveVoiceLogInfo(NSString *event, NSDictionary<NSString *, id> *fields) {
|
|
48
|
+
NSString *message = LiveVoiceFormatMessage(event, fields);
|
|
49
|
+
os_log_with_type(LiveVoiceLogHandle(), OS_LOG_TYPE_INFO, "%{public}s",
|
|
50
|
+
message.UTF8String);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Declare conformance privately
|
|
54
|
+
@interface LiveVoiceSdkReactNative () <LiveVoiceDelegate>
|
|
55
|
+
@end
|
|
56
|
+
|
|
57
|
+
@implementation LiveVoiceSdkReactNative
|
|
58
|
+
|
|
59
|
+
RCT_EXPORT_MODULE(LiveVoiceModule)
|
|
60
|
+
|
|
61
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
62
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
63
|
+
return std::make_shared<facebook::react::NativeLiveVoiceSdkSpecJSI>(params);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
- (void)initialize:(NSString *_Nullable)androidServiceConfig {
|
|
69
|
+
NSDictionary *versionInfo = RCTGetReactNativeVersion();
|
|
70
|
+
NSString *major = versionInfo[RCTVersionMajor];
|
|
71
|
+
NSString *minor = versionInfo[RCTVersionMinor];
|
|
72
|
+
NSString *patch = versionInfo[RCTVersionPatch];
|
|
73
|
+
NSString *const PLATFORM_VERSION =
|
|
74
|
+
[NSString stringWithFormat:@"%@.%@.%@", major, minor, patch];
|
|
75
|
+
|
|
76
|
+
[LiveVoice initializeWithDelegate:self
|
|
77
|
+
platform:SDKPlatformReactNative
|
|
78
|
+
platformVersion:PLATFORM_VERSION
|
|
79
|
+
sdkVersion:SDK_VERSION];
|
|
80
|
+
LiveVoiceLogInfo(@"LV_INIT", @{@"platformVersion" : PLATFORM_VERSION});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// The bridge commands take a completion now. These turbomodule methods are
|
|
84
|
+
// void/fire-and-forget: the bridge serializes lifecycle commands internally and
|
|
85
|
+
// turbomodule calls arrive in order, so leave→join stays ordered without it.
|
|
86
|
+
- (void)joinEvent:(nonnull NSString *)joinCode
|
|
87
|
+
password:(nullable NSString *)password
|
|
88
|
+
apiKey:(nonnull NSString *)apiKey {
|
|
89
|
+
[LiveVoice joinEventWithCode:joinCode password:password apiKey:apiKey completion:^{}];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- (void)leaveEvent {
|
|
93
|
+
[LiveVoice leaveEventWithCompletion:^{}];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
- (void)reconnect {
|
|
97
|
+
[LiveVoice reconnectWithCompletion:^{}];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#pragma mark - Initial values
|
|
101
|
+
|
|
102
|
+
// The bridge accessors are completion-based; RN turbomodule getters must return
|
|
103
|
+
// synchronously, so we block on a semaphore until the completion lands. These run
|
|
104
|
+
// on the JS thread (off-main) while the completion fires on the main actor, so the
|
|
105
|
+
// wait can't deadlock. `getCurrentClaims` keeps its wire name but reads `currentFeatures`.
|
|
106
|
+
- (nullable NSString *)getCurrentClaims {
|
|
107
|
+
__block NSString *result = nil;
|
|
108
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
109
|
+
[LiveVoice currentFeaturesWithCompletion:^(NSString *_Nullable value) {
|
|
110
|
+
result = value;
|
|
111
|
+
dispatch_semaphore_signal(sema);
|
|
112
|
+
}];
|
|
113
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
- (nonnull NSString *)getCurrentUiState {
|
|
118
|
+
__block NSString *result = @"";
|
|
119
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
120
|
+
[LiveVoice currentViewStateWithCompletion:^(NSString *value) {
|
|
121
|
+
result = value;
|
|
122
|
+
dispatch_semaphore_signal(sema);
|
|
123
|
+
}];
|
|
124
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// true=speaker, false=headphones
|
|
129
|
+
- (nonnull NSNumber *)getCurrentAudioState {
|
|
130
|
+
__block BOOL result = NO;
|
|
131
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
132
|
+
[LiveVoice currentAudioOutputIsSpeakerWithCompletion:^(BOOL value) {
|
|
133
|
+
result = value;
|
|
134
|
+
dispatch_semaphore_signal(sema);
|
|
135
|
+
}];
|
|
136
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
137
|
+
return [NSNumber numberWithBool:result];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (nonnull NSString *)getCurrentAvailableSubtitleConfigs {
|
|
141
|
+
__block NSString *result = @"";
|
|
142
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
143
|
+
[LiveVoice currentAvailableSubtitlesWithCompletion:^(NSString *value) {
|
|
144
|
+
result = value;
|
|
145
|
+
dispatch_semaphore_signal(sema);
|
|
146
|
+
}];
|
|
147
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
- (nonnull NSString *)getCurrentSubtitles {
|
|
152
|
+
__block NSString *result = @"";
|
|
153
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
154
|
+
[LiveVoice currentSubtitlesWithCompletion:^(NSString *value) {
|
|
155
|
+
result = value;
|
|
156
|
+
dispatch_semaphore_signal(sema);
|
|
157
|
+
}];
|
|
158
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
- (nonnull NSString *)getCurrentSubtitleState {
|
|
163
|
+
__block NSString *result = @"";
|
|
164
|
+
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
|
165
|
+
[LiveVoice currentSubtitleStateWithCompletion:^(NSString *value) {
|
|
166
|
+
result = value;
|
|
167
|
+
dispatch_semaphore_signal(sema);
|
|
168
|
+
}];
|
|
169
|
+
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#pragma mark - Actions
|
|
174
|
+
|
|
175
|
+
- (void)setLiveVoiceUseSpeaker:(BOOL)useSpeaker {
|
|
176
|
+
[LiveVoice setAudioOutputToSpeaker:useSpeaker completion:^{}];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
- (void)startChannel:(double)channelID {
|
|
180
|
+
[LiveVoice startWithChannelID:channelID completion:^{}];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
- (void)stopChannel {
|
|
184
|
+
[LiveVoice stopWithCompletion:^{}];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
#pragma mark - Subtitles
|
|
188
|
+
|
|
189
|
+
- (void)startSubtitles:(double)channelId {
|
|
190
|
+
NSNumber *_Nullable optionalChannelID =
|
|
191
|
+
(channelId == -1) ? nil : [NSNumber numberWithLongLong:channelId];
|
|
192
|
+
[LiveVoice startSubtitlesWithChannelID:optionalChannelID completion:^{}];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
- (void)stopSubtitles {
|
|
196
|
+
[LiveVoice stopSubtitlesWithCompletion:^{}];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
- (void)openLiveVoiceWebsite {
|
|
200
|
+
[LiveVoice openLiveVoiceWebsiteWithCompletion:^{}];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
- (nonnull NSString *)getSdkVersion {
|
|
204
|
+
return SDK_VERSION;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
#pragma mark - Translations
|
|
208
|
+
|
|
209
|
+
- (nonnull NSString *)channelStatusOffline {
|
|
210
|
+
return [Translations channel_status_offline];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
- (nonnull NSString *)errorScreenRetrying {
|
|
214
|
+
return [Translations error_screen_retrying];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
- (nonnull NSString *)errorScreenRetryingIn:(double)seconds {
|
|
218
|
+
return [Translations error_screen_retrying_in:(int)seconds];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
- (nonnull NSString *)sdkErrorGeneric {
|
|
222
|
+
return [Translations sdk_error_generic];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
- (nonnull NSString *)sdkErrorInactive {
|
|
226
|
+
return [Translations sdk_error_inactive];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
- (nonnull NSString *)sdkErrorInvalidApiKey {
|
|
230
|
+
return [Translations sdk_error_invalid_api_key];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
- (nonnull NSString *)sdkErrorListenerLimitReached {
|
|
234
|
+
return [Translations sdk_error_listener_limit_reached];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
- (nonnull NSString *)sdkErrorNoNetwork {
|
|
238
|
+
return [Translations sdk_error_no_network];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
- (nonnull NSString *)sdkErrorNotFound {
|
|
242
|
+
return [Translations sdk_error_not_found];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
- (nonnull NSString *)sdkErrorRequestFailed:(double)errorCode {
|
|
246
|
+
return [Translations
|
|
247
|
+
sdk_error_request_failed:[NSString stringWithFormat:@"%1.0f", errorCode]];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
- (nonnull NSString *)sdkErrorWrongPassword {
|
|
251
|
+
return [Translations sdk_error_wrong_password];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
- (nonnull NSString *)sdkNoMatchingChannels {
|
|
255
|
+
return [Translations sdk_no_matching_channels];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
- (nonnull NSString *)streamingByTitle {
|
|
259
|
+
return [Translations streaming_by_title];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
- (nonnull NSString *)accessibilityChannelPlay {
|
|
263
|
+
return [Translations a11y_channel_play];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
- (nonnull NSString *)accessibilityChannelStatusMuted {
|
|
267
|
+
return [Translations a11y_channel_status_muted];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
- (nonnull NSString *)accessibilityChannelStop {
|
|
271
|
+
return [Translations a11y_channel_stop];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
- (nonnull NSString *)isAiChannelStatusMessage {
|
|
275
|
+
return [Translations channel_status_is_ai];
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
- (nonnull NSString *)noChannels {
|
|
279
|
+
return [Translations sdk_no_matching_channels];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
- (nonnull NSString *)errorRetryNowButton {
|
|
283
|
+
return [Translations action_retry_now];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
#pragma mark - LiveVoiceDelegate
|
|
287
|
+
|
|
288
|
+
- (void)viewStateDidChange:(nonnull NSString *)serializedState {
|
|
289
|
+
[self emitOnUiStateChanged:serializedState];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
- (void)audioOutputDidChange:(BOOL)useSpeaker {
|
|
293
|
+
[self emitOnAudioOutputChanged:useSpeaker];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
- (void)availableSubtitlesDidChange:(NSString *)available {
|
|
297
|
+
[self emitOnAvailableSubtitleConfigsChanged:available];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
- (void)subtitlesDidChange:(NSString *)subtitles {
|
|
301
|
+
[self emitOnSubtitlesChanged:subtitles];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
- (void)subtitleStateDidChange:(nonnull NSString *)serialized {
|
|
305
|
+
[self emitOnSubtitleStateChanged:serialized];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@end
|
package/ios/__SDK.h
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
14
|
+
// GENERATED CODE - DO NOT MODIFY BY HAND.
|
|
15
|
+
// Generated by tool/generate-native-versions.mjs from package.json.
|
|
2
16
|
#import <Foundation/Foundation.h>
|
|
3
17
|
|
|
4
|
-
NSString* const SDK_VERSION = @"
|
|
18
|
+
NSString* const SDK_VERSION = @"2.0.1";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
//===----------------------------------------------------------------------===//
|
|
4
|
+
//
|
|
5
|
+
// This source file is part of the LiveVoice SDK project
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) LiveVoice GmbH
|
|
8
|
+
// Licensed under the MIT license
|
|
9
|
+
//
|
|
10
|
+
// See LICENSE for license information
|
|
11
|
+
//
|
|
12
|
+
// SPDX-License-Identifier: MIT
|
|
13
|
+
//
|
|
14
|
+
//===----------------------------------------------------------------------===//
|
|
13
15
|
|
|
14
|
-
import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from
|
|
16
|
+
import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from "../sdk/LiveVoiceSdk.js";
|
|
15
17
|
import React, { useState, useRef, useEffect } from 'react';
|
|
16
18
|
import { View, TouchableOpacity, StyleSheet, Animated, Easing, Image, useColorScheme } from 'react-native';
|
|
17
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -19,7 +21,6 @@ export const AudioOutputSwitchView = props => {
|
|
|
19
21
|
const [isSpeaker, setIsSpeaker] = useState(() => getCurrentAudioState());
|
|
20
22
|
useEffect(() => {
|
|
21
23
|
let subscription = onAudioOutputChanged(value => {
|
|
22
|
-
console.log('State changed: ' + value);
|
|
23
24
|
setIsSpeaker(value);
|
|
24
25
|
});
|
|
25
26
|
return () => {
|
|
@@ -46,7 +47,6 @@ export const AudioOutputSwitchView = props => {
|
|
|
46
47
|
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
47
48
|
activeOpacity: 1,
|
|
48
49
|
onPress: () => {
|
|
49
|
-
console.log('Clicked: with current' + isSpeaker);
|
|
50
50
|
setLiveVoiceUseSpeaker(!isSpeaker);
|
|
51
51
|
},
|
|
52
52
|
style: [styles.container, isDarkMode ? styles.darkMode : styles.lightMode],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getCurrentAudioState","onAudioOutputChanged","setLiveVoiceUseSpeaker","React","useState","useRef","useEffect","View","TouchableOpacity","StyleSheet","Animated","Easing","Image","useColorScheme","jsx","_jsx","jsxs","_jsxs","AudioOutputSwitchView","props","isSpeaker","setIsSpeaker","subscription","value","
|
|
1
|
+
{"version":3,"names":["getCurrentAudioState","onAudioOutputChanged","setLiveVoiceUseSpeaker","React","useState","useRef","useEffect","View","TouchableOpacity","StyleSheet","Animated","Easing","Image","useColorScheme","jsx","_jsx","jsxs","_jsxs","AudioOutputSwitchView","props","isSpeaker","setIsSpeaker","subscription","value","remove","undefined","isDarkMode","animation","Value","current","timing","toValue","duration","easing","out","circle","useNativeDriver","start","togglePosition","interpolate","inputRange","outputRange","iconColor","activeOpacity","onPress","style","styles","container","darkMode","lightMode","children","iconContainer","source","require","tintColor","width","height","resizeMode","toggle","toggleBackgroundDark","toggleBackgroundLight","transform","translateX","create","borderRadius","flexDirection","alignItems","justifyContent","paddingHorizontal","position","backgroundColor","flex"],"sourceRoot":"../../../src","sources":["components/AudioOutputSwitchView.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
//===----------------------------------------------------------------------===//
|
|
4
|
+
//
|
|
5
|
+
// This source file is part of the LiveVoice SDK project
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) LiveVoice GmbH
|
|
8
|
+
// Licensed under the MIT license
|
|
9
|
+
//
|
|
10
|
+
// See LICENSE for license information
|
|
11
|
+
//
|
|
12
|
+
// SPDX-License-Identifier: MIT
|
|
13
|
+
//
|
|
14
|
+
//===----------------------------------------------------------------------===//
|
|
13
15
|
|
|
14
16
|
import React from 'react';
|
|
15
17
|
import { View, Text, useColorScheme, StyleSheet, Image, Pressable } from 'react-native';
|
|
16
18
|
import { COLORS } from "../util/Colors.js";
|
|
17
|
-
import { openLiveVoiceWebsite } from
|
|
19
|
+
import { openLiveVoiceWebsite } from "../sdk/LiveVoiceSdk.js";
|
|
18
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
21
|
export const BrandingView = props => {
|
|
20
22
|
const isDarkMode = props.isDarkMode ?? useColorScheme() === 'dark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","useColorScheme","StyleSheet","Image","Pressable","COLORS","openLiveVoiceWebsite","jsx","_jsx","jsxs","_jsxs","BrandingView","props","isDarkMode","openLink","onPress","style","width","alignItems","children","styles","container","text","darkText","lightText","source","require","image","height","tintColor","white","black","resizeMode","create","padding","justifyContent","borderRadius","textAlign","fontSize","fontWeight","marginBottom","color","undefined","aspectRatio"],"sourceRoot":"../../../src","sources":["components/BrandingView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,UAAU,EACVC,KAAK,EACLC,SAAS,QACJ,cAAc;AAErB,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,oBAAoB,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","View","Text","useColorScheme","StyleSheet","Image","Pressable","COLORS","openLiveVoiceWebsite","jsx","_jsx","jsxs","_jsxs","BrandingView","props","isDarkMode","openLink","onPress","style","width","alignItems","children","styles","container","text","darkText","lightText","source","require","image","height","tintColor","white","black","resizeMode","create","padding","justifyContent","borderRadius","textAlign","fontSize","fontWeight","marginBottom","color","undefined","aspectRatio"],"sourceRoot":"../../../src","sources":["components/BrandingView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,UAAU,EACVC,KAAK,EACLC,SAAS,QACJ,cAAc;AAErB,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,oBAAoB,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAM3D,OAAO,MAAMC,YAAqC,GAAIC,KAAK,IAAK;EAC9D,MAAMC,UAAU,GAAGD,KAAK,CAACC,UAAU,IAAIZ,cAAc,CAAC,CAAC,KAAK,MAAM;EAElE,MAAMa,QAAQ,GAAG,MAAAA,CAAA,KAAY;IAAER,oBAAoB,CAAC,CAAC;EAAE,CAAC;EAExD,oBACEE,IAAA,CAACJ,SAAS;IAACW,OAAO,EAAED,QAAS;IAACE,KAAK,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,UAAU,EAAE;IAAS,CAAE;IAAAC,QAAA,eAC3ET,KAAA,CAACX,IAAI;MAACiB,KAAK,EAAEI,MAAM,CAACC,SAAU;MAAAF,QAAA,gBAC5BX,IAAA,CAACR,IAAI;QAACgB,KAAK,EAAE,CAACI,MAAM,CAACE,IAAI,EAAET,UAAU,GAAGO,MAAM,CAACG,QAAQ,GAAGH,MAAM,CAACI,SAAS,CAAE;QAAAL,QAAA,EAAC;MAE7E,CAAM,CAAC,eACPX,IAAA,CAACL,KAAK;QACJsB,MAAM,EAAEC,OAAO,CAAC,uBAAuB,CAAE;QACzCV,KAAK,EAAE,CACLI,MAAM,CAACO,KAAK,EACZ;UACEC,MAAM,EAAE,EAAE;UACVC,SAAS,EAAEhB,UAAU,GAAGR,MAAM,CAACyB,KAAK,GAAGzB,MAAM,CAAC0B;QAChD,CAAC,CACD;QACFC,UAAU,EAAC;MAAS,CACrB,CAAC;IAAA,CACE;EAAC,CACE,CAAC;AAEhB,CAAC;AAED,MAAMZ,MAAM,GAAGlB,UAAU,CAAC+B,MAAM,CAAC;EAC/BZ,SAAS,EAAE;IACTa,OAAO,EAAE,EAAE;IACXhB,UAAU,EAAE,QAAQ;IACpBiB,cAAc,EAAE,QAAQ;IACxBC,YAAY,EAAE,CAAC;IACfnB,KAAK,EAAE;EACT,CAAC;EACDK,IAAI,EAAE;IACJe,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,YAAY,EAAE;EAChB,CAAC;EACDjB,QAAQ,EAAE;IACRkB,KAAK,EAAE;EACT,CAAC;EACDjB,SAAS,EAAE;IACTiB,KAAK,EAAE;EACT,CAAC;EACDd,KAAK,EAAE;IACLV,KAAK,EAAE,MAAM;IACbW,MAAM,EAAEc,SAAS;IACjBC,WAAW,EAAE;EACf;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
//===----------------------------------------------------------------------===//
|
|
4
|
+
//
|
|
5
|
+
// This source file is part of the LiveVoice SDK project
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) LiveVoice GmbH
|
|
8
|
+
// Licensed under the MIT license
|
|
9
|
+
//
|
|
10
|
+
// See LICENSE for license information
|
|
11
|
+
//
|
|
12
|
+
// SPDX-License-Identifier: MIT
|
|
13
|
+
//
|
|
14
|
+
//===----------------------------------------------------------------------===//
|
|
13
15
|
|
|
14
16
|
import React, { useState } from 'react';
|
|
15
17
|
import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, Image } from 'react-native';
|
|
16
18
|
import { COLORS } from "../util/Colors.js";
|
|
17
|
-
import { Translations } from "../util/Translations.js";
|
|
18
19
|
import PlayButtonView from "./PlayButtonView.js";
|
|
19
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
21
|
export const ChannelView = ({
|
|
@@ -22,29 +23,30 @@ export const ChannelView = ({
|
|
|
22
23
|
playingState,
|
|
23
24
|
muted,
|
|
24
25
|
isOnline,
|
|
25
|
-
|
|
26
|
+
hasAudio,
|
|
27
|
+
hasSubtitles,
|
|
26
28
|
isDarkMode = useColorScheme() === 'dark',
|
|
27
|
-
|
|
29
|
+
onAudioPress,
|
|
30
|
+
onSubtitlesPress
|
|
28
31
|
}) => {
|
|
29
32
|
const [collapsed, setCollapsed] = useState(true);
|
|
30
|
-
const backgroundColor = isDarkMode ? COLORS.cardBgDark : COLORS.cardBg;
|
|
31
|
-
const secondaryColor = isDarkMode ? COLORS['gray-300'] : COLORS.gray;
|
|
32
33
|
const iconColor = isDarkMode ? COLORS.white : COLORS.black;
|
|
33
34
|
return /*#__PURE__*/_jsxs(View, {
|
|
34
|
-
style:
|
|
35
|
-
backgroundColor
|
|
36
|
-
}],
|
|
35
|
+
style: styles.container,
|
|
37
36
|
children: [/*#__PURE__*/_jsx(PlayButtonView, {
|
|
38
37
|
playingState: playingState,
|
|
39
|
-
|
|
38
|
+
onAudioPress: onAudioPress,
|
|
39
|
+
onSubtitlesPress: onSubtitlesPress,
|
|
40
40
|
isDarkMode: isDarkMode,
|
|
41
|
-
isChannelOnline: isOnline
|
|
42
|
-
|
|
41
|
+
isChannelOnline: isOnline,
|
|
42
|
+
hasAudio: hasAudio,
|
|
43
|
+
hasSubtitles: hasSubtitles
|
|
44
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
43
45
|
style: {
|
|
44
46
|
flex: 1,
|
|
45
47
|
marginLeft: 10
|
|
46
48
|
},
|
|
47
|
-
children:
|
|
49
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
48
50
|
onPress: () => setCollapsed(!collapsed),
|
|
49
51
|
activeOpacity: 1,
|
|
50
52
|
children: /*#__PURE__*/_jsx(Text, {
|
|
@@ -55,28 +57,7 @@ export const ChannelView = ({
|
|
|
55
57
|
}],
|
|
56
58
|
children: channelName
|
|
57
59
|
})
|
|
58
|
-
})
|
|
59
|
-
aiSpeaker && /*#__PURE__*/_jsxs(View, {
|
|
60
|
-
style: {
|
|
61
|
-
flex: 1,
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
alignItems: 'center'
|
|
64
|
-
},
|
|
65
|
-
children: [/*#__PURE__*/_jsx(Image, {
|
|
66
|
-
source: require('../icons/cpu.png'),
|
|
67
|
-
style: {
|
|
68
|
-
width: 16,
|
|
69
|
-
height: 16,
|
|
70
|
-
tintColor: secondaryColor,
|
|
71
|
-
resizeMode: 'contain'
|
|
72
|
-
}
|
|
73
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
74
|
-
style: [styles.aiText, {
|
|
75
|
-
color: secondaryColor
|
|
76
|
-
}],
|
|
77
|
-
children: Translations.isAiChannelStatusMessage()
|
|
78
|
-
})]
|
|
79
|
-
})]
|
|
60
|
+
})
|
|
80
61
|
}), muted && /*#__PURE__*/_jsx(Image, {
|
|
81
62
|
source: require('../icons/mic.png'),
|
|
82
63
|
style: {
|
|
@@ -92,10 +73,8 @@ const styles = StyleSheet.create({
|
|
|
92
73
|
container: {
|
|
93
74
|
flexDirection: 'row',
|
|
94
75
|
alignItems: 'center',
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
borderRadius: 8,
|
|
98
|
-
marginBottom: 10
|
|
76
|
+
paddingHorizontal: 12,
|
|
77
|
+
paddingVertical: 8
|
|
99
78
|
},
|
|
100
79
|
text: {
|
|
101
80
|
fontSize: 16,
|