livevoice-sdk-react-native 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -7
- package/android/build.gradle +14 -3
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +89 -123
- package/android/src/main/java/io/livevoice/react/__SDK.kt +16 -2
- package/ios/LiveVoiceSdkReactNative.mm +110 -37
- package/ios/__SDK.h +16 -2
- package/lib/module/components/AudioOutputSwitchView.js +13 -13
- package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
- package/lib/module/components/BrandingView.js +13 -11
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +14 -11
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +12 -10
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceView.js +141 -72
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PlayButtonView.js +12 -10
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +16 -13
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/components/WarningView.js +12 -10
- package/lib/module/components/WarningView.js.map +1 -1
- package/lib/module/components/index.js +12 -10
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +14 -220
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/LiveVoiceSdk.js +371 -0
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
- package/lib/module/sdk/LiveVoiceState.js +66 -0
- package/lib/module/sdk/LiveVoiceState.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +12 -10
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/ForegroundServiceConfig.js +21 -11
- package/lib/module/util/ForegroundServiceConfig.js.map +1 -1
- package/lib/module/util/PlayingState.js +12 -10
- package/lib/module/util/PlayingState.js.map +1 -1
- package/lib/module/util/Translations.js +12 -10
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/logger.js +76 -0
- package/lib/module/util/logger.js.map +1 -0
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +1 -1
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
- package/lib/typescript/src/components/LiveVoiceView.d.ts +22 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
- package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -144
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +210 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +12 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +3 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -1
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +7 -0
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +1 -1
- package/lib/typescript/src/util/PlayingState.d.ts.map +1 -1
- package/lib/typescript/src/util/Translations.d.ts.map +1 -1
- package/lib/typescript/src/util/UIState.d.ts +22 -2
- package/lib/typescript/src/util/UIState.d.ts.map +1 -1
- package/lib/typescript/src/util/logger.d.ts +23 -0
- package/lib/typescript/src/util/logger.d.ts.map +1 -0
- package/livevoice-sdk-react-native.podspec +14 -14
- package/package.json +16 -7
- package/src/components/AudioOutputSwitchView.tsx +13 -13
- package/src/components/BrandingView.tsx +13 -11
- package/src/components/ChannelView.tsx +14 -11
- package/src/components/ErrorView.tsx +12 -10
- package/src/components/LiveVoiceView.tsx +183 -92
- package/src/components/PlayButtonView.tsx +12 -10
- package/src/components/ReconnectingView.tsx +20 -13
- package/src/components/WarningView.tsx +12 -10
- package/src/components/index.tsx +12 -10
- package/src/index.tsx +19 -252
- package/src/sdk/LiveVoiceSdk.ts +408 -0
- package/src/sdk/LiveVoiceState.ts +89 -0
- package/src/specs/NativeLiveVoiceSdk.ts +16 -10
- package/src/util/Colors.ts +12 -10
- package/src/util/ForegroundServiceConfig.tsx +21 -11
- package/src/util/PlayingState.ts +12 -10
- package/src/util/Translations.ts +12 -10
- package/src/util/UIState.ts +30 -13
- package/src/util/logger.ts +92 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
- package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
- package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
- package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
|
@@ -1,85 +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
|
-
package io.livevoice.react
|
|
15
|
-
|
|
16
|
-
import io.livevoice.sdk.android.publicApi.core.model.channel.LiveVoicePlayingState
|
|
17
|
-
import io.livevoice.sdk.android.publicApi.core.model.SdkRetryState
|
|
18
|
-
import io.livevoice.sdk.android.publicApi.core.model.SdkUiState
|
|
19
|
-
import io.livevoice.sdk.android.publicApi.core.model.subtitle.AvailableSubtitle
|
|
20
|
-
import kotlinx.serialization.Serializable
|
|
21
|
-
import kotlinx.serialization.SerialName
|
|
22
|
-
|
|
23
|
-
@Serializable
|
|
24
|
-
sealed interface NativeAvailableSubtitle {
|
|
25
|
-
@Serializable
|
|
26
|
-
@SerialName("Transcript")
|
|
27
|
-
data class Transcript(
|
|
28
|
-
val channelId: Long,
|
|
29
|
-
val name: String,
|
|
30
|
-
val language: String? = null,
|
|
31
|
-
val parentChannelId: Long? = null
|
|
32
|
-
) : NativeAvailableSubtitle
|
|
33
|
-
|
|
34
|
-
@Serializable
|
|
35
|
-
@SerialName("Translated")
|
|
36
|
-
data class Translated(
|
|
37
|
-
val channelId: Long,
|
|
38
|
-
val name: String,
|
|
39
|
-
val language: String,
|
|
40
|
-
val parentChannelId: Long
|
|
41
|
-
) : NativeAvailableSubtitle
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
fun AvailableSubtitle.mapToNative(): NativeAvailableSubtitle = when (this) {
|
|
45
|
-
is AvailableSubtitle.Transcript -> NativeAvailableSubtitle.Transcript(channelId, name)
|
|
46
|
-
is AvailableSubtitle.Translated -> NativeAvailableSubtitle.Translated(channelId, name, language, parentChannelId)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
fun SdkUiState.mapToTransferable(): NativeUiState = when (this) {
|
|
50
|
-
SdkUiState.Loading -> NativeLoading
|
|
51
|
-
is SdkUiState.Ready -> NativeReady(
|
|
52
|
-
channels = channels.map {
|
|
53
|
-
NativeChannel(
|
|
54
|
-
id = it.id,
|
|
55
|
-
name = it.name,
|
|
56
|
-
isOnline = it.isOnline,
|
|
57
|
-
isAudioMuted = it.isAudioMuted,
|
|
58
|
-
isAiSpeaker = it.isAiSpeaker,
|
|
59
|
-
playingState = it.playingState.mapToNative(),
|
|
60
|
-
hasSubtitles = it.hasSubtitles,
|
|
61
|
-
hasAudio = it.hasAudio,
|
|
62
|
-
)
|
|
63
|
-
},
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
is SdkUiState.Error -> NativeError(
|
|
67
|
-
message = message,
|
|
68
|
-
canBeRetried = onRetry != null
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
is SdkUiState.Reconnecting -> {
|
|
72
|
-
val retryState = when (val state = this.retryState) {
|
|
73
|
-
is SdkRetryState.AwaitingNextReconnectAttempt -> NativeRetryState.AwaitRetry(state.retryTimestampSeconds)
|
|
74
|
-
SdkRetryState.RetryInProgress -> NativeRetryState.InProgress
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
NativeReconnecting(state = retryState)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
private fun LiveVoicePlayingState.mapToNative() = when (this) {
|
|
82
|
-
LiveVoicePlayingState.Stopped -> NativePlayingState.STOPPED
|
|
83
|
-
LiveVoicePlayingState.Playing -> NativePlayingState.PLAYING
|
|
84
|
-
LiveVoicePlayingState.Connecting, LiveVoicePlayingState.Stopping -> NativePlayingState.TRANSITIONING
|
|
85
|
-
}
|
|
@@ -1,79 +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
|
-
package io.livevoice.react
|
|
15
|
-
|
|
16
|
-
import kotlinx.serialization.SerialName
|
|
17
|
-
import kotlinx.serialization.Serializable
|
|
18
|
-
|
|
19
|
-
@Serializable
|
|
20
|
-
@SerialName("channel")
|
|
21
|
-
data class NativeChannel(
|
|
22
|
-
val id: Long,
|
|
23
|
-
val name: String,
|
|
24
|
-
val isOnline: Boolean,
|
|
25
|
-
val isAudioMuted: Boolean,
|
|
26
|
-
val isAiSpeaker: Boolean,
|
|
27
|
-
/** State of the channel reflecting the local playback */
|
|
28
|
-
val playingState: NativePlayingState,
|
|
29
|
-
val hasSubtitles: Boolean,
|
|
30
|
-
val hasAudio: Boolean,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
@Serializable
|
|
34
|
-
data class NativeClaims(
|
|
35
|
-
val hideBranding: Boolean,
|
|
36
|
-
val allowCustomUi: Boolean,
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
@Serializable
|
|
40
|
-
@SerialName("playingState")
|
|
41
|
-
enum class NativePlayingState {
|
|
42
|
-
STOPPED, TRANSITIONING, PLAYING;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Serializable
|
|
46
|
-
@SerialName("ready")
|
|
47
|
-
data class NativeReady(
|
|
48
|
-
val channels: List<NativeChannel>,
|
|
49
|
-
) : NativeUiState
|
|
50
|
-
|
|
51
|
-
@Serializable
|
|
52
|
-
@SerialName("nativeUiState")
|
|
53
|
-
sealed interface NativeUiState
|
|
54
|
-
|
|
55
|
-
@Serializable
|
|
56
|
-
@SerialName("loading")
|
|
57
|
-
data object NativeLoading : NativeUiState
|
|
58
|
-
|
|
59
|
-
@Serializable
|
|
60
|
-
@SerialName("error")
|
|
61
|
-
data class NativeError(
|
|
62
|
-
val message: String,
|
|
63
|
-
val canBeRetried: Boolean,
|
|
64
|
-
) : NativeUiState
|
|
65
|
-
|
|
66
|
-
@Serializable
|
|
67
|
-
@SerialName("reconnecting")
|
|
68
|
-
data class NativeReconnecting(val state: NativeRetryState) : NativeUiState
|
|
69
|
-
|
|
70
|
-
@Serializable
|
|
71
|
-
sealed interface NativeRetryState {
|
|
72
|
-
@Serializable
|
|
73
|
-
@SerialName("inProgress")
|
|
74
|
-
data object InProgress : NativeRetryState
|
|
75
|
-
|
|
76
|
-
@Serializable
|
|
77
|
-
@SerialName("awaitingRetry")
|
|
78
|
-
data class AwaitRetry(val atTimestamp: Long) : NativeRetryState
|
|
79
|
-
}
|