livevoice-sdk-react-native 2.0.1 → 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 (207) hide show
  1. package/README.md +105 -66
  2. package/android/build.gradle +5 -4
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +122 -188
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +2 -2
  5. package/ios/LiveVoiceRNBridge.swift +362 -0
  6. package/ios/LiveVoiceSdkReactNative.mm +187 -158
  7. package/ios/__SDK.h +1 -1
  8. package/ios/livevoice_spm_backport.rb +202 -0
  9. package/lib/module/components/BrandingView.js +58 -39
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +355 -44
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +5 -6
  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 +311 -133
  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 +180 -244
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +31 -53
  24. package/lib/module/components/ReconnectingView.js.map +1 -1
  25. package/lib/module/icons/branding-ios.png +0 -0
  26. package/lib/module/icons/camera-off-android.png +0 -0
  27. package/lib/module/icons/camera-off-android@2x.png +0 -0
  28. package/lib/module/icons/camera-off-android@3x.png +0 -0
  29. package/lib/module/icons/cpu-android.png +0 -0
  30. package/lib/module/icons/cpu-android@2x.png +0 -0
  31. package/lib/module/icons/cpu-android@3x.png +0 -0
  32. package/lib/module/icons/cpu-ios.png +0 -0
  33. package/lib/module/icons/cpu-ios@2x.png +0 -0
  34. package/lib/module/icons/cpu-ios@3x.png +0 -0
  35. package/lib/module/icons/lock-android.png +0 -0
  36. package/lib/module/icons/lock-android@2x.png +0 -0
  37. package/lib/module/icons/lock-android@3x.png +0 -0
  38. package/lib/module/icons/lock-ios.png +0 -0
  39. package/lib/module/icons/lock-ios@2x.png +0 -0
  40. package/lib/module/icons/lock-ios@3x.png +0 -0
  41. package/lib/module/icons/mic-off-android.png +0 -0
  42. package/lib/module/icons/mic-off-android@2x.png +0 -0
  43. package/lib/module/icons/mic-off-android@3x.png +0 -0
  44. package/lib/module/icons/mic-slash-ios.png +0 -0
  45. package/lib/module/icons/mic-slash-ios@2x.png +0 -0
  46. package/lib/module/icons/mic-slash-ios@3x.png +0 -0
  47. package/lib/module/icons/video-slash-ios.png +0 -0
  48. package/lib/module/icons/video-slash-ios@2x.png +0 -0
  49. package/lib/module/icons/video-slash-ios@3x.png +0 -0
  50. package/lib/module/index.js +11 -6
  51. package/lib/module/index.js.map +1 -1
  52. package/lib/module/sdk/Bridge.js +236 -0
  53. package/lib/module/sdk/Bridge.js.map +1 -0
  54. package/lib/module/sdk/Event.js +160 -0
  55. package/lib/module/sdk/Event.js.map +1 -0
  56. package/lib/module/sdk/Lifecycle.js +331 -0
  57. package/lib/module/sdk/Lifecycle.js.map +1 -0
  58. package/lib/module/sdk/LiveVoiceSdk.js +262 -268
  59. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -1
  60. package/lib/module/sdk/LiveVoiceState.js +208 -40
  61. package/lib/module/sdk/LiveVoiceState.js.map +1 -1
  62. package/lib/module/sdk/LogEntries.js +99 -0
  63. package/lib/module/sdk/LogEntries.js.map +1 -0
  64. package/lib/module/sdk/Models.js +2 -0
  65. package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
  66. package/lib/module/{util/PlayingState.js → sdk/NativeSdkVersions.js} +9 -8
  67. package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
  68. package/lib/module/sdk/Observables.js +391 -0
  69. package/lib/module/sdk/Observables.js.map +1 -0
  70. package/lib/module/sdk/Passwords.js +298 -0
  71. package/lib/module/sdk/Passwords.js.map +1 -0
  72. package/lib/module/sdk/Playback.js +35 -0
  73. package/lib/module/sdk/Playback.js.map +1 -0
  74. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  75. package/lib/module/util/Colors.js +2 -1
  76. package/lib/module/util/Colors.js.map +1 -1
  77. package/lib/module/util/Translations.js +34 -11
  78. package/lib/module/util/Translations.js.map +1 -1
  79. package/lib/module/util/freeze.js +26 -0
  80. package/lib/module/util/freeze.js.map +1 -0
  81. package/lib/module/util/logger.js +79 -41
  82. package/lib/module/util/logger.js.map +1 -1
  83. package/lib/typescript/src/components/BrandingView.d.ts +4 -0
  84. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  85. package/lib/typescript/src/components/ChannelView.d.ts +29 -3
  86. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  87. package/lib/typescript/src/components/ErrorView.d.ts +5 -3
  88. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  89. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
  90. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
  91. package/lib/typescript/src/components/LiveVoiceView.d.ts +81 -21
  92. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  93. package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
  94. package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
  95. package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
  96. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  97. package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
  98. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  99. package/lib/typescript/src/index.d.ts +15 -6
  100. package/lib/typescript/src/index.d.ts.map +1 -1
  101. package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
  102. package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
  103. package/lib/typescript/src/sdk/Event.d.ts +97 -0
  104. package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
  105. package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
  106. package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +195 -190
  108. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -1
  109. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +77 -9
  110. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -1
  111. package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
  112. package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
  113. package/lib/typescript/src/sdk/Models.d.ts +114 -0
  114. package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
  115. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
  116. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
  117. package/lib/typescript/src/sdk/Observables.d.ts +123 -0
  118. package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
  119. package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
  120. package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
  121. package/lib/typescript/src/sdk/Playback.d.ts +9 -0
  122. package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
  123. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +34 -31
  124. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  125. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  126. package/lib/typescript/src/util/Translations.d.ts +30 -8
  127. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  128. package/lib/typescript/src/util/freeze.d.ts +6 -0
  129. package/lib/typescript/src/util/freeze.d.ts.map +1 -0
  130. package/lib/typescript/src/util/logger.d.ts +17 -7
  131. package/lib/typescript/src/util/logger.d.ts.map +1 -1
  132. package/livevoice-sdk-react-native.podspec +29 -4
  133. package/package.json +12 -9
  134. package/src/components/BrandingView.tsx +42 -55
  135. package/src/components/ChannelView.tsx +329 -38
  136. package/src/components/ErrorView.tsx +9 -12
  137. package/src/components/LiveVoiceSpinner.tsx +87 -0
  138. package/src/components/LiveVoiceView.tsx +319 -201
  139. package/src/components/PasswordPrompt.tsx +144 -0
  140. package/src/components/PlayButtonView.tsx +165 -269
  141. package/src/components/ReconnectingView.tsx +28 -81
  142. package/src/icons/branding-ios.png +0 -0
  143. package/src/icons/camera-off-android.png +0 -0
  144. package/src/icons/camera-off-android@2x.png +0 -0
  145. package/src/icons/camera-off-android@3x.png +0 -0
  146. package/src/icons/cpu-android.png +0 -0
  147. package/src/icons/cpu-android@2x.png +0 -0
  148. package/src/icons/cpu-android@3x.png +0 -0
  149. package/src/icons/cpu-ios.png +0 -0
  150. package/src/icons/cpu-ios@2x.png +0 -0
  151. package/src/icons/cpu-ios@3x.png +0 -0
  152. package/src/icons/lock-android.png +0 -0
  153. package/src/icons/lock-android@2x.png +0 -0
  154. package/src/icons/lock-android@3x.png +0 -0
  155. package/src/icons/lock-ios.png +0 -0
  156. package/src/icons/lock-ios@2x.png +0 -0
  157. package/src/icons/lock-ios@3x.png +0 -0
  158. package/src/icons/mic-off-android.png +0 -0
  159. package/src/icons/mic-off-android@2x.png +0 -0
  160. package/src/icons/mic-off-android@3x.png +0 -0
  161. package/src/icons/mic-slash-ios.png +0 -0
  162. package/src/icons/mic-slash-ios@2x.png +0 -0
  163. package/src/icons/mic-slash-ios@3x.png +0 -0
  164. package/src/icons/video-slash-ios.png +0 -0
  165. package/src/icons/video-slash-ios@2x.png +0 -0
  166. package/src/icons/video-slash-ios@3x.png +0 -0
  167. package/src/index.tsx +92 -6
  168. package/src/sdk/Bridge.ts +259 -0
  169. package/src/sdk/Event.ts +187 -0
  170. package/src/sdk/Lifecycle.ts +366 -0
  171. package/src/sdk/LiveVoiceSdk.ts +285 -309
  172. package/src/sdk/LiveVoiceState.ts +230 -60
  173. package/src/sdk/LogEntries.ts +88 -0
  174. package/src/sdk/Models.ts +129 -0
  175. package/src/{util/PlayingState.ts → sdk/NativeSdkVersions.ts} +7 -6
  176. package/src/sdk/Observables.ts +414 -0
  177. package/src/sdk/Passwords.ts +286 -0
  178. package/src/sdk/Playback.ts +30 -0
  179. package/src/specs/NativeLiveVoiceSdk.ts +42 -38
  180. package/src/util/Colors.ts +2 -1
  181. package/src/util/Translations.ts +34 -12
  182. package/src/util/freeze.ts +23 -0
  183. package/src/util/logger.ts +79 -52
  184. package/lib/module/components/AudioOutputSwitchView.js +0 -138
  185. package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
  186. package/lib/module/components/index.js +0 -24
  187. package/lib/module/components/index.js.map +0 -1
  188. package/lib/module/icons/mic.png +0 -0
  189. package/lib/module/util/ForegroundServiceConfig.js +0 -38
  190. package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
  191. package/lib/module/util/PlayingState.js.map +0 -1
  192. package/lib/module/util/UIState.js +0 -4
  193. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
  194. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  195. package/lib/typescript/src/components/index.d.ts +0 -9
  196. package/lib/typescript/src/components/index.d.ts.map +0 -1
  197. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -19
  198. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  199. package/lib/typescript/src/util/PlayingState.d.ts +0 -7
  200. package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
  201. package/lib/typescript/src/util/UIState.d.ts +0 -86
  202. package/lib/typescript/src/util/UIState.d.ts.map +0 -1
  203. package/src/components/AudioOutputSwitchView.tsx +0 -146
  204. package/src/components/index.tsx +0 -21
  205. package/src/icons/mic.png +0 -0
  206. package/src/util/ForegroundServiceConfig.tsx +0 -42
  207. package/src/util/UIState.ts +0 -106
@@ -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":"AAaA,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,19 +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
- /**
10
- * Sentinel sent to the native module to request the SDK's built-in default notification
11
- * message. The Android native module recognizes this exact string (see
12
- * `DEFAULT_MESSAGE_SENTINEL` in `LiveVoiceModule.kt`) and substitutes the real default — the
13
- * two must stay in sync. iOS ignores the foreground-service config entirely.
14
- */
15
- export declare const DEFAULT_MESSAGE_SENTINEL = "LV_NOTIFICATION_DEFAULT_MESSAGE";
16
- export declare const serviceDisabled: Disabled;
17
- export declare const serviceEnabledWithDefaultMessage: Enabled;
18
- export declare const serviceEnabledWithMessage: (message: string | null) => Enabled;
19
- //# sourceMappingURL=ForegroundServiceConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AAG1E,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAgE,CAAC;AAEhH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAGjE,CAAC"}
@@ -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":"AAaA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
@@ -1,86 +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
- outputMode: string;
10
- }
11
- export interface Loading {
12
- type: 'loading';
13
- }
14
- export interface ErrorState {
15
- type: 'error';
16
- message: string;
17
- canBeRetried: boolean;
18
- }
19
- export interface RetryInProgress {
20
- type: 'inProgress';
21
- }
22
- export interface AwaitingRetry {
23
- type: 'awaitingRetry';
24
- retryAt: Date;
25
- /**
26
- * @deprecated Use retryAt instead. This is a Unix timestamp in seconds.
27
- */
28
- atTimestamp: number;
29
- }
30
- export type RetryState = RetryInProgress | AwaitingRetry;
31
- export interface Reconnecting {
32
- type: 'reconnecting';
33
- state: RetryState;
34
- }
35
- export type ErrorOrReconnecting = ErrorState | Reconnecting;
36
- /**
37
- * Other types
38
- */
39
- export interface Channel {
40
- type: 'channel';
41
- id: number;
42
- name: string;
43
- isOnline: boolean;
44
- hasAudio: boolean;
45
- hasSubtitles: boolean;
46
- isAudioMuted: boolean;
47
- aiTranslationInfo: AITranslationInfo | null;
48
- dependentChannels: DependentChannel[];
49
- playingState: PlayingState;
50
- }
51
- export interface AITranslationInfo {
52
- sourceID: number;
53
- targetLanguage: string;
54
- }
55
- export interface DependentChannel {
56
- id: number;
57
- name: string;
58
- sourceChannelID: number;
59
- language: string;
60
- hasSubtitles: boolean;
61
- hasAudio: boolean;
62
- }
63
- export interface AvailableSubtitle {
64
- id: number;
65
- name: string;
66
- language: string | null;
67
- parent: number | null;
68
- }
69
- /**
70
- * The current subtitle state.
71
- *
72
- * - `disabled`: no subtitles are being received.
73
- * - `automatic`: subtitles follow the currently playing channel.
74
- * - `specific`: subtitles for an explicitly chosen channel.
75
- */
76
- export type SubtitleState = {
77
- type: 'disabled';
78
- } | {
79
- type: 'automatic';
80
- fragments: string[];
81
- } | {
82
- type: 'specific';
83
- channelId: number;
84
- fragments: string[];
85
- };
86
- //# sourceMappingURL=UIState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIState.d.ts","sourceRoot":"","sources":["../../../../src/util/UIState.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,aAAa,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
@@ -1,146 +0,0 @@
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 { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from '../sdk/LiveVoiceSdk';
15
- import React, { useState, useRef, useEffect, } from 'react';
16
- import {
17
- View,
18
- TouchableOpacity,
19
- StyleSheet,
20
- Animated,
21
- Easing,
22
- Image,
23
- useColorScheme
24
- } from 'react-native';
25
-
26
- export interface AudioOutputSwitchProps {
27
- isDarkMode?: boolean;
28
- }
29
-
30
- export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) => {
31
- const [isSpeaker, setIsSpeaker] = useState<Boolean>((() => (getCurrentAudioState())))
32
- useEffect(() => {
33
- let subscription: { remove(): void } | undefined = onAudioOutputChanged((value: boolean) => {
34
- setIsSpeaker(value);
35
- });
36
- return () => {
37
- subscription?.remove();
38
- subscription = undefined;
39
- };
40
- }, []);
41
-
42
- const isDarkMode = props.isDarkMode != undefined ? props.isDarkMode : useColorScheme() === 'dark';
43
- const animation = useRef(new Animated.Value(isSpeaker ? 1 : 0)).current;
44
-
45
- useEffect(() => {
46
- Animated.timing(animation, {
47
- toValue: isSpeaker ? 1 : 0, //start with correct position depending on isSpeaker state
48
- duration: 100,
49
- easing: Easing.out(Easing.circle),
50
- useNativeDriver: false,
51
- }).start();
52
- }, [isSpeaker]);
53
-
54
- const togglePosition = animation.interpolate({
55
- inputRange: [0, 1],
56
- outputRange: [2, 60], // Adjust these values based on your design
57
- });
58
-
59
- const iconColor = isDarkMode ? '#fff' : '#191919';
60
-
61
- return (
62
- <TouchableOpacity
63
- activeOpacity={1}
64
- onPress={() => {
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,21 +0,0 @@
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
- export * from './AudioOutputSwitchView';
15
- export * from './BrandingView';
16
- export * from './ChannelView';
17
- export * from './ErrorView';
18
- export * from './LiveVoiceView';
19
- export * from './PlayButtonView';
20
- export * from './ReconnectingView';
21
- export * from './WarningView';
package/src/icons/mic.png DELETED
Binary file
@@ -1,42 +0,0 @@
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
- // Define the union type and interfaces
15
- export type ForegroundServiceConfig = Disabled | Enabled;
16
-
17
- export interface Disabled {
18
- type: 'Disabled';
19
- }
20
-
21
- export interface Enabled {
22
- type: 'Enabled';
23
- message: string | null;
24
- }
25
-
26
- /**
27
- * Sentinel sent to the native module to request the SDK's built-in default notification
28
- * message. The Android native module recognizes this exact string (see
29
- * `DEFAULT_MESSAGE_SENTINEL` in `LiveVoiceModule.kt`) and substitutes the real default — the
30
- * two must stay in sync. iOS ignores the foreground-service config entirely.
31
- */
32
- export const DEFAULT_MESSAGE_SENTINEL = 'LV_NOTIFICATION_DEFAULT_MESSAGE';
33
-
34
- // Named exports for the constants and function
35
- export const serviceDisabled: Disabled = { type: 'Disabled' };
36
-
37
- export const serviceEnabledWithDefaultMessage: Enabled = { type: 'Enabled', message: DEFAULT_MESSAGE_SENTINEL };
38
-
39
- export const serviceEnabledWithMessage = (message: string | null): Enabled => ({
40
- type: 'Enabled',
41
- message
42
- });
@@ -1,106 +0,0 @@
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 { type PlayingState } from './PlayingState';
15
-
16
- export type UiState = Ready | ErrorState | Loading | Reconnecting
17
-
18
- /**
19
- * UI state top-level types
20
- */
21
- export interface Ready {
22
- type: 'ready';
23
- channels: Channel[];
24
- outputMode: string;
25
- }
26
-
27
- export interface Loading {
28
- type: 'loading';
29
- }
30
-
31
- export interface ErrorState {
32
- type: 'error';
33
- message: string;
34
- canBeRetried: boolean;
35
- }
36
-
37
- export interface RetryInProgress {
38
- type: 'inProgress';
39
- }
40
-
41
- export interface AwaitingRetry {
42
- type: 'awaitingRetry';
43
- retryAt: Date;
44
- /**
45
- * @deprecated Use retryAt instead. This is a Unix timestamp in seconds.
46
- */
47
- atTimestamp: number;
48
- }
49
-
50
- export type RetryState = RetryInProgress | AwaitingRetry;
51
-
52
- export interface Reconnecting {
53
- type: 'reconnecting';
54
- state: RetryState;
55
- }
56
-
57
- export type ErrorOrReconnecting = ErrorState | Reconnecting;
58
-
59
- /**
60
- * Other types
61
- */
62
- export interface Channel {
63
- type: 'channel';
64
- id: number;
65
- name: string;
66
- isOnline: boolean;
67
- hasAudio: boolean;
68
- hasSubtitles: boolean;
69
- isAudioMuted: boolean;
70
- aiTranslationInfo: AITranslationInfo | null;
71
- dependentChannels: DependentChannel[];
72
- playingState: PlayingState;
73
- }
74
-
75
- export interface AITranslationInfo {
76
- sourceID: number;
77
- targetLanguage: string;
78
- }
79
-
80
- export interface DependentChannel {
81
- id: number;
82
- name: string;
83
- sourceChannelID: number;
84
- language: string;
85
- hasSubtitles: boolean;
86
- hasAudio: boolean;
87
- }
88
-
89
- export interface AvailableSubtitle {
90
- id: number;
91
- name: string;
92
- language: string | null;
93
- parent: number | null;
94
- }
95
-
96
- /**
97
- * The current subtitle state.
98
- *
99
- * - `disabled`: no subtitles are being received.
100
- * - `automatic`: subtitles follow the currently playing channel.
101
- * - `specific`: subtitles for an explicitly chosen channel.
102
- */
103
- export type SubtitleState =
104
- | { type: 'disabled' }
105
- | { type: 'automatic'; fragments: string[] }
106
- | { type: 'specific'; channelId: number; fragments: string[] };