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.
Files changed (231) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +119 -7
  3. package/android/build.gradle +52 -84
  4. package/android/gradle.properties +10 -6
  5. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +93 -126
  6. package/android/src/main/java/io/livevoice/react/LiveVoiceSdkReactNativePackage.kt +12 -13
  7. package/android/src/main/java/io/livevoice/react/__SDK.kt +16 -2
  8. package/ios/LiveVoiceSdkReactNative.h +5 -5
  9. package/ios/LiveVoiceSdkReactNative.mm +308 -0
  10. package/ios/__SDK.h +16 -2
  11. package/lib/module/components/AudioOutputSwitchView.js +13 -13
  12. package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
  13. package/lib/module/components/BrandingView.js +13 -11
  14. package/lib/module/components/BrandingView.js.map +1 -1
  15. package/lib/module/components/ChannelView.js +27 -48
  16. package/lib/module/components/ChannelView.js.map +1 -1
  17. package/lib/module/components/ErrorView.js +12 -10
  18. package/lib/module/components/ErrorView.js.map +1 -1
  19. package/lib/module/components/LiveVoiceView.js +153 -61
  20. package/lib/module/components/LiveVoiceView.js.map +1 -1
  21. package/lib/module/components/PlayButtonView.js +255 -94
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +16 -13
  24. package/lib/module/components/ReconnectingView.js.map +1 -1
  25. package/lib/module/components/WarningView.js +12 -10
  26. package/lib/module/components/WarningView.js.map +1 -1
  27. package/lib/module/components/index.js +12 -10
  28. package/lib/module/components/index.js.map +1 -1
  29. package/lib/module/icons/captions@1x.png +0 -0
  30. package/lib/module/icons/captions@2x.png +0 -0
  31. package/lib/module/icons/pause@1x.png +0 -0
  32. package/lib/module/icons/pause@2x.png +0 -0
  33. package/lib/module/icons/play@1x.png +0 -0
  34. package/lib/module/icons/play@2x.png +0 -0
  35. package/lib/module/index.js +14 -222
  36. package/lib/module/index.js.map +1 -1
  37. package/lib/module/sdk/LiveVoiceSdk.js +371 -0
  38. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  39. package/lib/module/sdk/LiveVoiceState.js +66 -0
  40. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  41. package/lib/module/specs/NativeLiveVoiceSdk.js +16 -10
  42. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  43. package/lib/module/util/Colors.js +14 -11
  44. package/lib/module/util/Colors.js.map +1 -1
  45. package/lib/module/util/ForegroundServiceConfig.js +21 -11
  46. package/lib/module/util/ForegroundServiceConfig.js.map +1 -1
  47. package/lib/module/util/PlayingState.js +12 -10
  48. package/lib/module/util/PlayingState.js.map +1 -1
  49. package/lib/module/util/Translations.js +12 -10
  50. package/lib/module/util/Translations.js.map +1 -1
  51. package/lib/module/util/logger.js +76 -0
  52. package/lib/module/util/logger.js.map +1 -0
  53. package/lib/typescript/package.json +1 -0
  54. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +1 -0
  55. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -0
  56. package/lib/typescript/{commonjs/src → src}/components/ChannelView.d.ts +4 -2
  57. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -0
  58. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -0
  59. package/lib/typescript/src/components/LiveVoiceView.d.ts +28 -0
  60. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -0
  61. package/lib/typescript/src/components/PlayButtonView.d.ts +341 -0
  62. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -0
  63. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -0
  64. package/lib/typescript/src/components/WarningView.d.ts.map +1 -0
  65. package/lib/typescript/src/components/index.d.ts.map +1 -0
  66. package/lib/typescript/src/index.d.ts +7 -0
  67. package/lib/typescript/src/index.d.ts.map +1 -0
  68. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +210 -0
  69. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  70. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +12 -0
  71. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  72. package/lib/typescript/{module/src → src}/specs/NativeLiveVoiceSdk.d.ts +6 -3
  73. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -0
  74. package/lib/typescript/{commonjs/src → src}/util/Colors.d.ts +2 -1
  75. package/lib/typescript/src/util/Colors.d.ts.map +1 -0
  76. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +19 -0
  77. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +1 -0
  78. package/lib/typescript/src/util/PlayingState.d.ts.map +1 -0
  79. package/lib/typescript/src/util/Translations.d.ts.map +1 -0
  80. package/lib/typescript/src/util/UIState.d.ts +86 -0
  81. package/lib/typescript/src/util/UIState.d.ts.map +1 -0
  82. package/lib/typescript/src/util/logger.d.ts +23 -0
  83. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  84. package/livevoice-sdk-react-native.podspec +20 -41
  85. package/package.json +41 -122
  86. package/src/components/AudioOutputSwitchView.tsx +13 -13
  87. package/src/components/BrandingView.tsx +13 -11
  88. package/src/components/ChannelView.tsx +32 -36
  89. package/src/components/ErrorView.tsx +12 -10
  90. package/src/components/LiveVoiceView.tsx +231 -89
  91. package/src/components/PlayButtonView.tsx +293 -98
  92. package/src/components/ReconnectingView.tsx +20 -13
  93. package/src/components/WarningView.tsx +12 -10
  94. package/src/components/index.tsx +12 -10
  95. package/src/icons/captions@1x.png +0 -0
  96. package/src/icons/captions@2x.png +0 -0
  97. package/src/icons/pause@1x.png +0 -0
  98. package/src/icons/pause@2x.png +0 -0
  99. package/src/icons/play@1x.png +0 -0
  100. package/src/icons/play@2x.png +0 -0
  101. package/src/index.tsx +19 -236
  102. package/src/sdk/LiveVoiceSdk.ts +408 -0
  103. package/src/sdk/LiveVoiceState.ts +89 -0
  104. package/src/specs/NativeLiveVoiceSdk.ts +24 -16
  105. package/src/util/Colors.ts +15 -11
  106. package/src/util/ForegroundServiceConfig.tsx +21 -11
  107. package/src/util/PlayingState.ts +12 -10
  108. package/src/util/Translations.ts +12 -10
  109. package/src/util/UIState.ts +54 -13
  110. package/src/util/logger.ts +92 -0
  111. package/android/generated/java/io/livevoice/react/NativeLiveVoiceSdkSpec.java +0 -186
  112. package/android/generated/jni/CMakeLists.txt +0 -36
  113. package/android/generated/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  114. package/android/generated/jni/RNLiveVoiceSpec.h +0 -31
  115. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI-generated.cpp +0 -245
  116. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -398
  117. package/android/src/main/AndroidManifest.xml +0 -3
  118. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -54
  119. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -77
  120. package/ios/LivevoiceSdkReactNative.mm +0 -250
  121. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec-generated.mm +0 -292
  122. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h +0 -101
  123. package/ios/generated/RNLiveVoiceSpecJSI-generated.cpp +0 -245
  124. package/ios/generated/RNLiveVoiceSpecJSI.h +0 -398
  125. package/lib/commonjs/components/AudioOutputSwitchView.js +0 -144
  126. package/lib/commonjs/components/AudioOutputSwitchView.js.map +0 -1
  127. package/lib/commonjs/components/BrandingView.js +0 -78
  128. package/lib/commonjs/components/BrandingView.js.map +0 -1
  129. package/lib/commonjs/components/ChannelView.js +0 -117
  130. package/lib/commonjs/components/ChannelView.js.map +0 -1
  131. package/lib/commonjs/components/ErrorView.js +0 -88
  132. package/lib/commonjs/components/ErrorView.js.map +0 -1
  133. package/lib/commonjs/components/LiveVoiceView.js +0 -107
  134. package/lib/commonjs/components/LiveVoiceView.js.map +0 -1
  135. package/lib/commonjs/components/PlayButtonView.js +0 -161
  136. package/lib/commonjs/components/PlayButtonView.js.map +0 -1
  137. package/lib/commonjs/components/ReconnectingView.js +0 -109
  138. package/lib/commonjs/components/ReconnectingView.js.map +0 -1
  139. package/lib/commonjs/components/WarningView.js +0 -58
  140. package/lib/commonjs/components/WarningView.js.map +0 -1
  141. package/lib/commonjs/components/index.js +0 -94
  142. package/lib/commonjs/components/index.js.map +0 -1
  143. package/lib/commonjs/icons/branding.png +0 -0
  144. package/lib/commonjs/icons/cpu.png +0 -0
  145. package/lib/commonjs/icons/headphones.png +0 -0
  146. package/lib/commonjs/icons/mic.png +0 -0
  147. package/lib/commonjs/icons/pause.png +0 -0
  148. package/lib/commonjs/icons/play.png +0 -0
  149. package/lib/commonjs/icons/speaker.png +0 -0
  150. package/lib/commonjs/index.js +0 -327
  151. package/lib/commonjs/index.js.map +0 -1
  152. package/lib/commonjs/specs/NativeLiveVoiceSdk.js +0 -19
  153. package/lib/commonjs/specs/NativeLiveVoiceSdk.js.map +0 -1
  154. package/lib/commonjs/util/Colors.js +0 -30
  155. package/lib/commonjs/util/Colors.js.map +0 -1
  156. package/lib/commonjs/util/ForegroundServiceConfig.js +0 -33
  157. package/lib/commonjs/util/ForegroundServiceConfig.js.map +0 -1
  158. package/lib/commonjs/util/PlayingState.js +0 -24
  159. package/lib/commonjs/util/PlayingState.js.map +0 -1
  160. package/lib/commonjs/util/Translations.js +0 -47
  161. package/lib/commonjs/util/Translations.js.map +0 -1
  162. package/lib/commonjs/util/UIState.js +0 -6
  163. package/lib/commonjs/util/UIState.js.map +0 -1
  164. package/lib/module/icons/pause.png +0 -0
  165. package/lib/module/icons/play.png +0 -0
  166. package/lib/typescript/commonjs/package.json +0 -1
  167. package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  168. package/lib/typescript/commonjs/src/components/BrandingView.d.ts.map +0 -1
  169. package/lib/typescript/commonjs/src/components/ChannelView.d.ts.map +0 -1
  170. package/lib/typescript/commonjs/src/components/ErrorView.d.ts.map +0 -1
  171. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts +0 -6
  172. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts.map +0 -1
  173. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts +0 -146
  174. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts.map +0 -1
  175. package/lib/typescript/commonjs/src/components/ReconnectingView.d.ts.map +0 -1
  176. package/lib/typescript/commonjs/src/components/WarningView.d.ts.map +0 -1
  177. package/lib/typescript/commonjs/src/components/index.d.ts.map +0 -1
  178. package/lib/typescript/commonjs/src/index.d.ts +0 -149
  179. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  180. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts +0 -48
  181. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
  182. package/lib/typescript/commonjs/src/util/Colors.d.ts.map +0 -1
  183. package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts +0 -12
  184. package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  185. package/lib/typescript/commonjs/src/util/PlayingState.d.ts.map +0 -1
  186. package/lib/typescript/commonjs/src/util/Translations.d.ts.map +0 -1
  187. package/lib/typescript/commonjs/src/util/UIState.d.ts +0 -45
  188. package/lib/typescript/commonjs/src/util/UIState.d.ts.map +0 -1
  189. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts +0 -6
  190. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  191. package/lib/typescript/module/src/components/BrandingView.d.ts +0 -6
  192. package/lib/typescript/module/src/components/BrandingView.d.ts.map +0 -1
  193. package/lib/typescript/module/src/components/ChannelView.d.ts +0 -13
  194. package/lib/typescript/module/src/components/ChannelView.d.ts.map +0 -1
  195. package/lib/typescript/module/src/components/ErrorView.d.ts +0 -9
  196. package/lib/typescript/module/src/components/ErrorView.d.ts.map +0 -1
  197. package/lib/typescript/module/src/components/LiveVoiceView.d.ts +0 -6
  198. package/lib/typescript/module/src/components/LiveVoiceView.d.ts.map +0 -1
  199. package/lib/typescript/module/src/components/PlayButtonView.d.ts +0 -146
  200. package/lib/typescript/module/src/components/PlayButtonView.d.ts.map +0 -1
  201. package/lib/typescript/module/src/components/ReconnectingView.d.ts +0 -9
  202. package/lib/typescript/module/src/components/ReconnectingView.d.ts.map +0 -1
  203. package/lib/typescript/module/src/components/WarningView.d.ts +0 -8
  204. package/lib/typescript/module/src/components/WarningView.d.ts.map +0 -1
  205. package/lib/typescript/module/src/components/index.d.ts +0 -9
  206. package/lib/typescript/module/src/components/index.d.ts.map +0 -1
  207. package/lib/typescript/module/src/index.d.ts +0 -149
  208. package/lib/typescript/module/src/index.d.ts.map +0 -1
  209. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
  210. package/lib/typescript/module/src/util/Colors.d.ts +0 -13
  211. package/lib/typescript/module/src/util/Colors.d.ts.map +0 -1
  212. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts +0 -12
  213. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  214. package/lib/typescript/module/src/util/PlayingState.d.ts +0 -7
  215. package/lib/typescript/module/src/util/PlayingState.d.ts.map +0 -1
  216. package/lib/typescript/module/src/util/Translations.d.ts +0 -22
  217. package/lib/typescript/module/src/util/Translations.d.ts.map +0 -1
  218. package/lib/typescript/module/src/util/UIState.d.ts +0 -45
  219. package/lib/typescript/module/src/util/UIState.d.ts.map +0 -1
  220. package/react-native.config.js +0 -12
  221. package/src/icons/pause.png +0 -0
  222. package/src/icons/play.png +0 -0
  223. /package/lib/{typescript/module → module}/package.json +0 -0
  224. /package/lib/typescript/{commonjs/src → src}/components/AudioOutputSwitchView.d.ts +0 -0
  225. /package/lib/typescript/{commonjs/src → src}/components/BrandingView.d.ts +0 -0
  226. /package/lib/typescript/{commonjs/src → src}/components/ErrorView.d.ts +0 -0
  227. /package/lib/typescript/{commonjs/src → src}/components/ReconnectingView.d.ts +0 -0
  228. /package/lib/typescript/{commonjs/src → src}/components/WarningView.d.ts +0 -0
  229. /package/lib/typescript/{commonjs/src → src}/components/index.d.ts +0 -0
  230. /package/lib/typescript/{commonjs/src → src}/util/PlayingState.d.ts +0 -0
  231. /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
- LiveVoiceModule(reactContext)
26
+ LiveVoiceModule(reactContext)
26
27
  } else {
27
28
  null
28
29
  }
29
30
  }
30
31
 
31
- override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
32
- return ReactModuleInfoProvider {
33
- val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
34
- moduleInfos[LiveVoiceModule.NAME] = ReactModuleInfo(
35
- LiveVoiceModule.NAME,
36
- LiveVoiceModule.NAME,
37
- false, // canOverrideExistingModule
38
- false, // needsEagerInit
39
- false, // isCxxModule
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
- moduleInfos
43
- }
42
+ )
44
43
  }
45
44
  }
@@ -1,6 +1,20 @@
1
- // AUTO-GENERATED FILE
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 = "1.0.3"
19
+ const val SDK_VERSION = "2.0.1"
6
20
  }
@@ -11,11 +11,11 @@
11
11
  //
12
12
  //===----------------------------------------------------------------------===//
13
13
 
14
- #import "generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h"
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 : NativeLiveVoiceSdkSpecBase <NativeLiveVoiceSdkSpec>
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
- // AUTO-GENERATED FILE
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 = @"1.0.3";
18
+ NSString* const SDK_VERSION = @"2.0.1";
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
 
3
- /*
4
- * This source file is part of the LiveVoice SDK project
5
- *
6
- * Copyright (c) LiveVoice GmbH
7
- * Licensed under the MIT license
8
- *
9
- * See LICENSE for license information
10
- *
11
- * SPDX-License-Identifier: MIT
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 'livevoice-sdk-react-native';
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","console","log","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":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EAAEC,oBAAoB,EAAEC,sBAAsB,QAAQ,4BAA4B;AAC/G,OAAOC,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAS,OAAO;AAC3D,SACEC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,cAAc,QACT,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMtB,OAAO,MAAMC,qBAAuD,GAAIC,KAAK,IAAK;EAChF,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAAW,MAAOJ,oBAAoB,CAAC,CAAG,CAAC;EACrFM,SAAS,CAAC,MAAM;IACd,IAAIgB,YAA4C,GAAGrB,oBAAoB,C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O,CAAC,yBAAyB,CAAE;QAC3CR,KAAK,EAAE;UAAES,SAAS,EAAEZ,SAAS;UAAEa,KAAK,EAAE,EAAE;UAAEC,MAAM,EAAE,EAAE;UAAEC,UAAU,EAAE;QAAU;MAAE,CAC/E;IAAC,CAES,CAAC;EAAA,CACA,CAAC;AAEvB,CAAC;AAED,MAAMX,MAAM,GAAGvC,UAAU,CAACwD,MAAM,CAAC;EAC/BhB,SAAS,EAAE;IACTQ,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,EAAE;IACVQ,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,iBAAiB,EAAE,EAAE;IACrBC,QAAQ,EAAE;EACZ,CAAC;EACDrB,QAAQ,EAAE;IACRsB,eAAe,EAAE;EACnB,CAAC;EACDrB,SAAS,EAAE;IACTqB,eAAe,EAAE;EACnB,CAAC;EACDnB,aAAa,EAAE;IACbc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BZ,KAAK,EAAE,MAAM;IACba,iBAAiB,EAAE;EACrB,CAAC;EACDV,MAAM,EAAE;IACNH,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,YAAY,EAAE,EAAE;IAChBK,QAAQ,EAAE,UAAU;IACpBE,IAAI,EAAE,CAAC;IACPL,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDR,oBAAoB,EAAE;IACpBW,eAAe,EAAE;EACnB,CAAC;EACDV,qBAAqB,EAAE;IACrBU,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
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":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EAAEC,oBAAoB,EAAEC,sBAAsB,QAAQ,wBAAqB;AACxG,OAAOC,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAS,OAAO;AAC3D,SACEC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,cAAc,QACT,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMtB,OAAO,MAAMC,qBAAuD,GAAIC,KAAK,IAAK;EAChF,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAAW,MAAOJ,oBAAoB,CAAC,CAAG,CAAC;EACrFM,SAAS,CAAC,MAAM;IACd,IAAIgB,YAA4C,GAAGrB,oBAAoB,CAAEsB,KAAc,IAAK;MAC1FF,YAAY,CAACE,KAAK,CAAC;IACrB,CAAC,CAAC;IACF,OAAO,MAAM;MACXD,YAAY,EAAEE,MAAM,CAAC,CAAC;MACtBF,YAAY,GAAGG,SAAS;IAC1B,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,UAAU,GAAGP,KAAK,CAACO,UAAU,IAAID,SAAS,GAAGN,KAAK,CAACO,UAAU,GAAGb,cAAc,CAAC,CAAC,KAAK,MAAM;EACjG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,EAAE,EAAE;IACrBC,QAAQ,EAAE;EACZ,CAAC;EACDrB,QAAQ,EAAE;IACRsB,eAAe,EAAE;EACnB,CAAC;EACDrB,SAAS,EAAE;IACTqB,eAAe,EAAE;EACnB,CAAC;EACDnB,aAAa,EAAE;IACbc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BZ,KAAK,EAAE,MAAM;IACba,iBAAiB,EAAE;EACrB,CAAC;EACDV,MAAM,EAAE;IACNH,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,YAAY,EAAE,EAAE;IAChBK,QAAQ,EAAE,UAAU;IACpBE,IAAI,EAAE,CAAC;IACPL,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDR,oBAAoB,EAAE;IACpBW,eAAe,EAAE;EACnB,CAAC;EACDV,qBAAqB,EAAE;IACrBU,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,20 +1,22 @@
1
1
  "use strict";
2
2
 
3
- /*
4
- * This source file is part of the LiveVoice SDK project
5
- *
6
- * Copyright (c) LiveVoice GmbH
7
- * Licensed under the MIT license
8
- *
9
- * See LICENSE for license information
10
- *
11
- * SPDX-License-Identifier: MIT
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 'livevoice-sdk-react-native';
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,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMlE,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
+ {"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.t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ACE,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
- * This source file is part of the LiveVoice SDK project
5
- *
6
- * Copyright (c) LiveVoice GmbH
7
- * Licensed under the MIT license
8
- *
9
- * See LICENSE for license information
10
- *
11
- * SPDX-License-Identifier: MIT
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
- aiSpeaker,
26
+ hasAudio,
27
+ hasSubtitles,
26
28
  isDarkMode = useColorScheme() === 'dark',
27
- onPress
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: [styles.container, {
35
- backgroundColor
36
- }],
35
+ style: styles.container,
37
36
  children: [/*#__PURE__*/_jsx(PlayButtonView, {
38
37
  playingState: playingState,
39
- onPress: onPress,
38
+ onAudioPress: onAudioPress,
39
+ onSubtitlesPress: onSubtitlesPress,
40
40
  isDarkMode: isDarkMode,
41
- isChannelOnline: isOnline
42
- }), /*#__PURE__*/_jsxs(View, {
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: [/*#__PURE__*/_jsx(TouchableOpacity, {
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
- }), /* Ai-Speaker status message */
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
- padding: 10,
96
- backgroundColor: '#fff',
97
- borderRadius: 8,
98
- marginBottom: 10
76
+ paddingHorizontal: 12,
77
+ paddingVertical: 8
99
78
  },
100
79
  text: {
101
80
  fontSize: 16,