livevoice-sdk-react-native 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +158 -7
  2. package/android/build.gradle +18 -6
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +121 -221
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +17 -3
  5. package/ios/LiveVoiceRNBridge.swift +362 -0
  6. package/ios/LiveVoiceSdkReactNative.mm +247 -145
  7. package/ios/__SDK.h +16 -2
  8. package/ios/livevoice_spm_backport.rb +202 -0
  9. package/lib/module/components/BrandingView.js +71 -50
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +368 -54
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +17 -16
  14. package/lib/module/components/ErrorView.js.map +1 -1
  15. package/lib/module/components/LiveVoiceSpinner.js +81 -0
  16. package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
  17. package/lib/module/components/LiveVoiceView.js +351 -104
  18. package/lib/module/components/LiveVoiceView.js.map +1 -1
  19. package/lib/module/components/PasswordPrompt.js +165 -0
  20. package/lib/module/components/PasswordPrompt.js.map +1 -0
  21. package/lib/module/components/PlayButtonView.js +192 -254
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +43 -62
  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/icons/branding-ios.png +0 -0
  28. package/lib/module/icons/camera-off-android.png +0 -0
  29. package/lib/module/icons/camera-off-android@2x.png +0 -0
  30. package/lib/module/icons/camera-off-android@3x.png +0 -0
  31. package/lib/module/icons/cpu-android.png +0 -0
  32. package/lib/module/icons/cpu-android@2x.png +0 -0
  33. package/lib/module/icons/cpu-android@3x.png +0 -0
  34. package/lib/module/icons/cpu-ios.png +0 -0
  35. package/lib/module/icons/cpu-ios@2x.png +0 -0
  36. package/lib/module/icons/cpu-ios@3x.png +0 -0
  37. package/lib/module/icons/lock-android.png +0 -0
  38. package/lib/module/icons/lock-android@2x.png +0 -0
  39. package/lib/module/icons/lock-android@3x.png +0 -0
  40. package/lib/module/icons/lock-ios.png +0 -0
  41. package/lib/module/icons/lock-ios@2x.png +0 -0
  42. package/lib/module/icons/lock-ios@3x.png +0 -0
  43. package/lib/module/icons/mic-off-android.png +0 -0
  44. package/lib/module/icons/mic-off-android@2x.png +0 -0
  45. package/lib/module/icons/mic-off-android@3x.png +0 -0
  46. package/lib/module/icons/mic-slash-ios.png +0 -0
  47. package/lib/module/icons/mic-slash-ios@2x.png +0 -0
  48. package/lib/module/icons/mic-slash-ios@3x.png +0 -0
  49. package/lib/module/icons/video-slash-ios.png +0 -0
  50. package/lib/module/icons/video-slash-ios@2x.png +0 -0
  51. package/lib/module/icons/video-slash-ios@3x.png +0 -0
  52. package/lib/module/index.js +24 -225
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/sdk/Bridge.js +236 -0
  55. package/lib/module/sdk/Bridge.js.map +1 -0
  56. package/lib/module/sdk/Event.js +160 -0
  57. package/lib/module/sdk/Event.js.map +1 -0
  58. package/lib/module/sdk/Lifecycle.js +331 -0
  59. package/lib/module/sdk/Lifecycle.js.map +1 -0
  60. package/lib/module/sdk/LiveVoiceSdk.js +365 -0
  61. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  62. package/lib/module/sdk/LiveVoiceState.js +234 -0
  63. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  64. package/lib/module/sdk/LogEntries.js +99 -0
  65. package/lib/module/sdk/LogEntries.js.map +1 -0
  66. package/lib/module/sdk/Models.js +2 -0
  67. package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
  68. package/lib/module/sdk/NativeSdkVersions.js +24 -0
  69. package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
  70. package/lib/module/sdk/Observables.js +391 -0
  71. package/lib/module/sdk/Observables.js.map +1 -0
  72. package/lib/module/sdk/Passwords.js +298 -0
  73. package/lib/module/sdk/Passwords.js.map +1 -0
  74. package/lib/module/sdk/Playback.js +35 -0
  75. package/lib/module/sdk/Playback.js.map +1 -0
  76. package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
  77. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  78. package/lib/module/util/Colors.js +14 -11
  79. package/lib/module/util/Colors.js.map +1 -1
  80. package/lib/module/util/Translations.js +46 -21
  81. package/lib/module/util/Translations.js.map +1 -1
  82. package/lib/module/util/freeze.js +26 -0
  83. package/lib/module/util/freeze.js.map +1 -0
  84. package/lib/module/util/logger.js +114 -0
  85. package/lib/module/util/logger.js.map +1 -0
  86. package/lib/typescript/src/components/BrandingView.d.ts +4 -0
  87. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  88. package/lib/typescript/src/components/ChannelView.d.ts +29 -3
  89. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  90. package/lib/typescript/src/components/ErrorView.d.ts +5 -3
  91. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  92. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
  93. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
  94. package/lib/typescript/src/components/LiveVoiceView.d.ts +85 -3
  95. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  96. package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
  97. package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
  98. package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
  99. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  100. package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
  101. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  102. package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
  103. package/lib/typescript/src/index.d.ts +15 -144
  104. package/lib/typescript/src/index.d.ts.map +1 -1
  105. package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
  106. package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/Event.d.ts +97 -0
  108. package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
  109. package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
  110. package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
  111. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +215 -0
  112. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  113. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +80 -0
  114. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  115. package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
  116. package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
  117. package/lib/typescript/src/sdk/Models.d.ts +114 -0
  118. package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
  119. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
  120. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
  121. package/lib/typescript/src/sdk/Observables.d.ts +123 -0
  122. package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
  123. package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
  124. package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
  125. package/lib/typescript/src/sdk/Playback.d.ts +9 -0
  126. package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
  127. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +35 -29
  128. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  129. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  130. package/lib/typescript/src/util/Translations.d.ts +30 -8
  131. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  132. package/lib/typescript/src/util/freeze.d.ts +6 -0
  133. package/lib/typescript/src/util/freeze.d.ts.map +1 -0
  134. package/lib/typescript/src/util/logger.d.ts +33 -0
  135. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  136. package/livevoice-sdk-react-native.podspec +41 -16
  137. package/package.json +26 -14
  138. package/src/components/BrandingView.tsx +55 -66
  139. package/src/components/ChannelView.tsx +342 -48
  140. package/src/components/ErrorView.tsx +21 -22
  141. package/src/components/LiveVoiceSpinner.tsx +87 -0
  142. package/src/components/LiveVoiceView.tsx +360 -151
  143. package/src/components/PasswordPrompt.tsx +144 -0
  144. package/src/components/PlayButtonView.tsx +177 -279
  145. package/src/components/ReconnectingView.tsx +40 -86
  146. package/src/components/WarningView.tsx +12 -10
  147. package/src/icons/branding-ios.png +0 -0
  148. package/src/icons/camera-off-android.png +0 -0
  149. package/src/icons/camera-off-android@2x.png +0 -0
  150. package/src/icons/camera-off-android@3x.png +0 -0
  151. package/src/icons/cpu-android.png +0 -0
  152. package/src/icons/cpu-android@2x.png +0 -0
  153. package/src/icons/cpu-android@3x.png +0 -0
  154. package/src/icons/cpu-ios.png +0 -0
  155. package/src/icons/cpu-ios@2x.png +0 -0
  156. package/src/icons/cpu-ios@3x.png +0 -0
  157. package/src/icons/lock-android.png +0 -0
  158. package/src/icons/lock-android@2x.png +0 -0
  159. package/src/icons/lock-android@3x.png +0 -0
  160. package/src/icons/lock-ios.png +0 -0
  161. package/src/icons/lock-ios@2x.png +0 -0
  162. package/src/icons/lock-ios@3x.png +0 -0
  163. package/src/icons/mic-off-android.png +0 -0
  164. package/src/icons/mic-off-android@2x.png +0 -0
  165. package/src/icons/mic-off-android@3x.png +0 -0
  166. package/src/icons/mic-slash-ios.png +0 -0
  167. package/src/icons/mic-slash-ios@2x.png +0 -0
  168. package/src/icons/mic-slash-ios@3x.png +0 -0
  169. package/src/icons/video-slash-ios.png +0 -0
  170. package/src/icons/video-slash-ios@2x.png +0 -0
  171. package/src/icons/video-slash-ios@3x.png +0 -0
  172. package/src/index.tsx +105 -252
  173. package/src/sdk/Bridge.ts +259 -0
  174. package/src/sdk/Event.ts +187 -0
  175. package/src/sdk/Lifecycle.ts +366 -0
  176. package/src/sdk/LiveVoiceSdk.ts +384 -0
  177. package/src/sdk/LiveVoiceState.ts +259 -0
  178. package/src/sdk/LogEntries.ts +88 -0
  179. package/src/sdk/Models.ts +129 -0
  180. package/src/sdk/NativeSdkVersions.ts +21 -0
  181. package/src/sdk/Observables.ts +414 -0
  182. package/src/sdk/Passwords.ts +286 -0
  183. package/src/sdk/Playback.ts +30 -0
  184. package/src/specs/NativeLiveVoiceSdk.ts +56 -46
  185. package/src/util/Colors.ts +14 -11
  186. package/src/util/Translations.ts +46 -22
  187. package/src/util/freeze.ts +23 -0
  188. package/src/util/logger.ts +119 -0
  189. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
  190. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  191. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  192. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
  193. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
  194. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
  195. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
  196. package/lib/module/components/AudioOutputSwitchView.js +0 -138
  197. package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
  198. package/lib/module/components/index.js +0 -22
  199. package/lib/module/components/index.js.map +0 -1
  200. package/lib/module/icons/mic.png +0 -0
  201. package/lib/module/util/ForegroundServiceConfig.js +0 -28
  202. package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
  203. package/lib/module/util/PlayingState.js +0 -21
  204. package/lib/module/util/PlayingState.js.map +0 -1
  205. package/lib/module/util/UIState.js +0 -4
  206. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
  207. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  208. package/lib/typescript/src/components/index.d.ts +0 -9
  209. package/lib/typescript/src/components/index.d.ts.map +0 -1
  210. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -12
  211. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  212. package/lib/typescript/src/util/PlayingState.d.ts +0 -7
  213. package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
  214. package/lib/typescript/src/util/UIState.d.ts +0 -66
  215. package/lib/typescript/src/util/UIState.d.ts.map +0 -1
  216. package/src/components/AudioOutputSwitchView.tsx +0 -146
  217. package/src/components/index.tsx +0 -19
  218. package/src/icons/mic.png +0 -0
  219. package/src/util/ForegroundServiceConfig.tsx +0 -32
  220. package/src/util/PlayingState.ts +0 -18
  221. package/src/util/UIState.ts +0 -89
@@ -1,22 +0,0 @@
1
- "use strict";
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
- */
13
-
14
- export * from "./AudioOutputSwitchView.js";
15
- export * from "./BrandingView.js";
16
- export * from "./ChannelView.js";
17
- export * from "./ErrorView.js";
18
- export * from "./LiveVoiceView.js";
19
- export * from "./PlayButtonView.js";
20
- export * from "./ReconnectingView.js";
21
- export * from "./WarningView.js";
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,4BAAyB;AACvC,cAAc,mBAAgB;AAC9B,cAAc,kBAAe;AAC7B,cAAc,gBAAa;AAC3B,cAAc,oBAAiB;AAC/B,cAAc,qBAAkB;AAChC,cAAc,uBAAoB;AAClC,cAAc,kBAAe","ignoreList":[]}
Binary file
@@ -1,28 +0,0 @@
1
- "use strict";
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
- */
13
-
14
- // Define the union type and interfaces
15
-
16
- // Named exports for the constants and function
17
- export const serviceDisabled = {
18
- type: 'Disabled'
19
- };
20
- export const serviceEnabledWithDefaultMessage = {
21
- type: 'Enabled',
22
- message: 'LV_NOTIFICATION_DEFAULT_MESSAGE'
23
- };
24
- export const serviceEnabledWithMessage = message => ({
25
- type: 'Enabled',
26
- message
27
- });
28
- //# sourceMappingURL=ForegroundServiceConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["serviceDisabled","type","serviceEnabledWithDefaultMessage","message","serviceEnabledWithMessage"],"sourceRoot":"../../../src","sources":["util/ForegroundServiceConfig.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAYA;AACA,OAAO,MAAMA,eAAyB,GAAG;EAAEC,IAAI,EAAE;AAAW,CAAC;AAE7D,OAAO,MAAMC,gCAAyC,GAAG;EAAED,IAAI,EAAE,SAAS;EAAEE,OAAO,EAAE;AAAkC,CAAC;AAExH,OAAO,MAAMC,yBAAyB,GAAID,OAAsB,KAAe;EAC7EF,IAAI,EAAE,SAAS;EACfE;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- "use strict";
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
- */
13
-
14
- export let PlayingState = /*#__PURE__*/function (PlayingState) {
15
- PlayingState["STOPPED"] = "STOPPED";
16
- PlayingState["TRANSITIONING"] = "TRANSITIONING";
17
- PlayingState["PLAYING"] = "PLAYING";
18
- return PlayingState;
19
- }({});
20
- ;
21
- //# sourceMappingURL=PlayingState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PlayingState"],"sourceRoot":"../../../src","sources":["util/PlayingState.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAIvB","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=UIState.js.map
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface AudioOutputSwitchProps {
3
- isDarkMode?: boolean;
4
- }
5
- export declare const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps>;
6
- //# sourceMappingURL=AudioOutputSwitchView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioOutputSwitchView.d.ts","sourceRoot":"","sources":["../../../../src/components/AudioOutputSwitchView.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAW5D,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6ElE,CAAC"}
@@ -1,9 +0,0 @@
1
- export * from './AudioOutputSwitchView';
2
- export * from './BrandingView';
3
- export * from './ChannelView';
4
- export * from './ErrorView';
5
- export * from './LiveVoiceView';
6
- export * from './PlayButtonView';
7
- export * from './ReconnectingView';
8
- export * from './WarningView';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.tsx"],"names":[],"mappings":"AAWA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -1,12 +0,0 @@
1
- export type ForegroundServiceConfig = Disabled | Enabled;
2
- export interface Disabled {
3
- type: 'Disabled';
4
- }
5
- export interface Enabled {
6
- type: 'Enabled';
7
- message: string | null;
8
- }
9
- export declare const serviceDisabled: Disabled;
10
- export declare const serviceEnabledWithDefaultMessage: Enabled;
11
- export declare const serviceEnabledWithMessage: (message: string | null) => Enabled;
12
- //# sourceMappingURL=ForegroundServiceConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAGD,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAyE,CAAC;AAEzH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAGjE,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare enum PlayingState {
2
- STOPPED = "STOPPED",
3
- TRANSITIONING = "TRANSITIONING",
4
- PLAYING = "PLAYING"
5
- }
6
- export type OutputMode = 'HEADPHONES' | 'SPEAKER';
7
- //# sourceMappingURL=PlayingState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlayingState.d.ts","sourceRoot":"","sources":["../../../../src/util/PlayingState.ts"],"names":[],"mappings":"AAWA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
@@ -1,66 +0,0 @@
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
- isHeadphonesOnly: boolean;
10
- outputMode: string;
11
- }
12
- export interface Loading {
13
- type: 'loading';
14
- }
15
- export interface ErrorState {
16
- type: 'error';
17
- message: string;
18
- canBeRetried: boolean;
19
- }
20
- export interface RetryInProgress {
21
- type: 'inProgress';
22
- }
23
- export interface AwaitingRetry {
24
- type: 'awaitingRetry';
25
- atTimestamp: number;
26
- }
27
- export type RetryState = RetryInProgress | AwaitingRetry;
28
- export interface Reconnecting {
29
- type: 'reconnecting';
30
- state: RetryState;
31
- }
32
- export type ErrorOrReconnecting = ErrorState | Reconnecting;
33
- /**
34
- * Other types
35
- */
36
- export interface Channel {
37
- type: 'channel';
38
- id: number;
39
- name: string;
40
- isOnline: boolean;
41
- hasAudio: boolean;
42
- hasSubtitles: boolean;
43
- isAudioMuted: boolean;
44
- aiTranslationInfo: AITranslationInfo | null;
45
- dependenChannels: [DependentChannel];
46
- playingState: PlayingState;
47
- }
48
- export interface AITranslationInfo {
49
- sourceID: number;
50
- targetLanguage: string;
51
- }
52
- export interface DependentChannel {
53
- id: number;
54
- name: string;
55
- sourceChannelID: number;
56
- language: string;
57
- hasSubtitles: boolean;
58
- hasAudio: boolean;
59
- }
60
- export interface AvailableSubtitle {
61
- id: number;
62
- name: string;
63
- language: string | null;
64
- parent: number | null;
65
- }
66
- //# sourceMappingURL=UIState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIState.d.ts","sourceRoot":"","sources":["../../../../src/util/UIState.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,aAAa,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
@@ -1,146 +0,0 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
11
-
12
- import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from 'livevoice-sdk-react-native';
13
- import React, { useState, useRef, useEffect, } from 'react';
14
- import {
15
- View,
16
- TouchableOpacity,
17
- StyleSheet,
18
- Animated,
19
- Easing,
20
- Image,
21
- useColorScheme
22
- } from 'react-native';
23
-
24
- export interface AudioOutputSwitchProps {
25
- isDarkMode?: boolean;
26
- }
27
-
28
- export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) => {
29
- const [isSpeaker, setIsSpeaker] = useState<Boolean>((() => (getCurrentAudioState())))
30
- useEffect(() => {
31
- let subscription: { remove(): void } | undefined = onAudioOutputChanged((value: boolean) => {
32
- console.log('State changed: ' + value);
33
- setIsSpeaker(value);
34
- });
35
- return () => {
36
- subscription?.remove();
37
- subscription = undefined;
38
- };
39
- }, []);
40
-
41
- const isDarkMode = props.isDarkMode != undefined ? props.isDarkMode : useColorScheme() === 'dark';
42
- const animation = useRef(new Animated.Value(isSpeaker ? 1 : 0)).current;
43
-
44
- useEffect(() => {
45
- Animated.timing(animation, {
46
- toValue: isSpeaker ? 1 : 0, //start with correct position depending on isSpeaker state
47
- duration: 100,
48
- easing: Easing.out(Easing.circle),
49
- useNativeDriver: false,
50
- }).start();
51
- }, [isSpeaker]);
52
-
53
- const togglePosition = animation.interpolate({
54
- inputRange: [0, 1],
55
- outputRange: [2, 60], // Adjust these values based on your design
56
- });
57
-
58
- const iconColor = isDarkMode ? '#fff' : '#191919';
59
-
60
- return (
61
- <TouchableOpacity
62
- activeOpacity={1}
63
- onPress={() => {
64
- console.log('Clicked: with current' + isSpeaker);
65
- setLiveVoiceUseSpeaker(!isSpeaker);
66
- }}
67
- style={[
68
- styles.container,
69
- isDarkMode ? styles.darkMode : styles.lightMode,
70
- ]}
71
- >
72
- <View style={styles.iconContainer}>
73
- <Image
74
- source={require('../icons/headphones.png')}
75
- style={{ tintColor: iconColor, width: 20, height: 20, resizeMode: 'contain' }}
76
- />
77
- <Image
78
- source={require('../icons/speaker.png')}
79
- style={{ tintColor: iconColor, width: 20, height: 20, resizeMode: 'contain' }}
80
- />
81
- </View>
82
-
83
- <Animated.View
84
- style={[
85
- styles.toggle,
86
- isDarkMode
87
- ? styles.toggleBackgroundDark
88
- : styles.toggleBackgroundLight,
89
- { transform: [{ translateX: togglePosition }] },
90
- ]}
91
- >
92
- {isSpeaker ?
93
- <Image
94
- source={require('../icons/speaker.png')}
95
- style={{ tintColor: iconColor, width: 20, height: 20, resizeMode: 'contain' }}
96
- /> :
97
- <Image
98
- source={require('../icons/headphones.png')}
99
- style={{ tintColor: iconColor, width: 20, height: 20, resizeMode: 'contain' }}
100
- />
101
- }
102
- </Animated.View>
103
- </TouchableOpacity>
104
- );
105
- };
106
-
107
- const styles = StyleSheet.create({
108
- container: {
109
- width: 120,
110
- height: 40,
111
- borderRadius: 20,
112
- flexDirection: 'row',
113
- alignItems: 'center',
114
- justifyContent: 'space-between',
115
- paddingHorizontal: 16,
116
- position: 'relative',
117
- },
118
- darkMode: {
119
- backgroundColor: '#393F45',
120
- },
121
- lightMode: {
122
- backgroundColor: '#E7E7E7',
123
- },
124
- iconContainer: {
125
- flexDirection: 'row',
126
- alignItems: 'center',
127
- justifyContent: 'space-between',
128
- width: '100%',
129
- paddingHorizontal: 7,
130
- },
131
- toggle: {
132
- width: 58,
133
- height: 36,
134
- borderRadius: 18,
135
- position: 'absolute',
136
- flex: 1,
137
- alignItems: 'center',
138
- justifyContent: 'center',
139
- },
140
- toggleBackgroundDark: {
141
- backgroundColor: '#212529',
142
- },
143
- toggleBackgroundLight: {
144
- backgroundColor: '#fff',
145
- },
146
- });
@@ -1,19 +0,0 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
11
-
12
- export * from './AudioOutputSwitchView';
13
- export * from './BrandingView';
14
- export * from './ChannelView';
15
- export * from './ErrorView';
16
- export * from './LiveVoiceView';
17
- export * from './PlayButtonView';
18
- export * from './ReconnectingView';
19
- export * from './WarningView';
package/src/icons/mic.png DELETED
Binary file
@@ -1,32 +0,0 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
11
-
12
- // Define the union type and interfaces
13
- export type ForegroundServiceConfig = Disabled | Enabled;
14
-
15
- export interface Disabled {
16
- type: 'Disabled';
17
- }
18
-
19
- export interface Enabled {
20
- type: 'Enabled';
21
- message: string | null;
22
- }
23
-
24
- // Named exports for the constants and function
25
- export const serviceDisabled: Disabled = { type: 'Disabled' };
26
-
27
- export const serviceEnabledWithDefaultMessage: Enabled = { type: 'Enabled', message: 'LV_NOTIFICATION_DEFAULT_MESSAGE' };
28
-
29
- export const serviceEnabledWithMessage = (message: string | null): Enabled => ({
30
- type: 'Enabled',
31
- message
32
- });
@@ -1,18 +0,0 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
11
-
12
- export enum PlayingState {
13
- STOPPED = 'STOPPED',
14
- TRANSITIONING = 'TRANSITIONING',
15
- PLAYING = 'PLAYING'
16
- };
17
-
18
- export type OutputMode = 'HEADPHONES' | 'SPEAKER';
@@ -1,89 +0,0 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
11
-
12
- import { type PlayingState } from './PlayingState';
13
-
14
- export type UiState = Ready | ErrorState | Loading | Reconnecting
15
-
16
- /**
17
- * UI state top-level types
18
- */
19
- export interface Ready {
20
- type: 'ready';
21
- channels: Channel[];
22
- isHeadphonesOnly: boolean;
23
- outputMode: string;
24
- }
25
-
26
- export interface Loading {
27
- type: 'loading';
28
- }
29
-
30
- export interface ErrorState {
31
- type: 'error';
32
- message: string;
33
- canBeRetried: boolean;
34
- }
35
-
36
- export interface RetryInProgress {
37
- type: 'inProgress';
38
- }
39
-
40
- export interface AwaitingRetry {
41
- type: 'awaitingRetry';
42
- atTimestamp: number;
43
- }
44
-
45
- export type RetryState = RetryInProgress | AwaitingRetry;
46
-
47
- export interface Reconnecting {
48
- type: 'reconnecting';
49
- state: RetryState;
50
- }
51
-
52
- export type ErrorOrReconnecting = ErrorState | Reconnecting;
53
-
54
- /**
55
- * Other types
56
- */
57
- export interface Channel {
58
- type: 'channel';
59
- id: number;
60
- name: string;
61
- isOnline: boolean;
62
- hasAudio: boolean;
63
- hasSubtitles: boolean;
64
- isAudioMuted: boolean;
65
- aiTranslationInfo: AITranslationInfo | null;
66
- dependenChannels: [DependentChannel];
67
- playingState: PlayingState;
68
- }
69
-
70
- export interface AITranslationInfo {
71
- sourceID: number;
72
- targetLanguage: string;
73
- }
74
-
75
- export interface DependentChannel {
76
- id: number;
77
- name: string;
78
- sourceChannelID: number;
79
- language: string;
80
- hasSubtitles: boolean;
81
- hasAudio: boolean;
82
- }
83
-
84
- export interface AvailableSubtitle {
85
- id: number;
86
- name: string;
87
- language: string | null;
88
- parent: number | null;
89
- }