@kaleyra/video-react-native-module 1.6.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 +17 -47
- package/android/build.gradle +24 -32
- package/android/gradle.properties +3 -3
- package/android/settings.gradle +0 -5
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/assets/kaleyra_video_wrapper_info.txt +1 -1
- package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeModule.kt +0 -9
- package/index.ts +0 -2
- package/ios/PluginInfo/_KaleyraVideoHybridVersionInfo.swift +1 -1
- package/ios/VideoNativeModule.m +0 -6
- package/ios/VideoNativeModule.swift +1 -20
- package/lib/commonjs/src/KaleyraVideo.js +0 -34
- package/lib/module/src/KaleyraVideo.js +0 -34
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/native-bridge/TypeScript/types/UserDetails.d.ts +3 -15
- package/lib/typescript/src/KaleyraVideo.d.ts +1 -16
- package/native-bridge/TypeScript/types/UserDetails.ts +3 -18
- package/native-bridge/android/bridge.gradle +71 -0
- package/native-bridge/android/build.gradle +5 -61
- package/native-bridge/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/native-bridge/android/settings.gradle +8 -0
- package/native-bridge/android/src/main/AndroidManifest.xml +1 -1
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/DTOs.kt +6 -40
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/SDKAccessTokenProviderProxy.kt +9 -7
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoHybridBridge.kt +0 -2
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoSDKHybridBridge.kt +13 -23
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/VideoSDKConfigurator.kt +32 -24
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/VideoSDKCachedUserConnector.kt +7 -5
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CallEventsReporter.kt +27 -35
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ChatEventsReporter.kt +34 -24
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CrossPlatformModuleStatus.kt +14 -15
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ModuleEventsReporter.kt +40 -18
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/SDKEventsReporter.kt +6 -6
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallDisplayExtension.kt +4 -3
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallTypeExtensions.kt +12 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ConfigurationExtension.kt +17 -23
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/EnvironmentExtension.kt +3 -3
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RecordingTypeExtension.kt +5 -7
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RegionExtension.kt +4 -4
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ScreenShareToolConfigurationExtension.kt +5 -6
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ToolsExtension.kt +49 -81
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/UserExtensions.kt +24 -17
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationService.kt +1 -2
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsDao.kt +1 -1
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsEntity.kt +2 -6
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/VideoHybridBridgeRepository.kt +1 -1
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/SDKUserInterfacePresenter.kt +22 -20
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetails.kt +0 -3
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/SDKCachedUserDetails.kt +22 -30
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.pbxproj +84 -132
- package/native-bridge/iOS/Podfile +2 -2
- package/native-bridge/iOS/Podfile.lock +9 -9
- package/native-bridge/iOS/Source/Abstractions/CallWindowProtocol.swift +3 -6
- package/native-bridge/iOS/Source/Abstractions/KaleyraVideoSDKProtocol.swift +20 -0
- package/native-bridge/iOS/Source/AccessToken/AccessTokenRequester.swift +0 -1
- package/native-bridge/iOS/Source/AccessToken/TokenProvider.swift +1 -2
- package/native-bridge/iOS/Source/Broadcast/BroadcastConfigurationPlistReader.swift +0 -1
- package/native-bridge/iOS/Source/Concurrency/DispatchQueue+isMain.swift +0 -1
- package/native-bridge/iOS/Source/Concurrency/MainQueueDispatcher.swift +0 -1
- package/native-bridge/iOS/Source/Concurrency/MainQueueRelay.swift +0 -1
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Equatable.swift +0 -1
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+KaleyraVideoSDK.swift +13 -0
- package/native-bridge/iOS/Source/DTOs/{AudioCallType+Bandyer.swift → AudioCallType+KaleyraVideoSDK.swift} +2 -3
- package/native-bridge/iOS/Source/DTOs/CallOptions+Equatable.swift +0 -1
- package/native-bridge/iOS/Source/DTOs/CallOptions+KaleyraVideoSDK.swift +12 -0
- package/native-bridge/iOS/Source/DTOs/{CallType+Bandyer.swift → CallType+KaleyraVideoSDK.swift} +2 -3
- package/native-bridge/iOS/Source/DTOs/CreateCallOptions+KaleyraVideoSDK.swift +12 -0
- package/native-bridge/iOS/Source/DTOs/DTOs.swift +3 -25
- package/native-bridge/iOS/Source/DTOs/{Environment+Bandyer.swift → Environment+KaleyraVideoSDK.swift} +2 -3
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+KaleyraVideoSDK.swift +113 -0
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+UserInterfacePresenterConfiguration.swift +0 -1
- package/native-bridge/iOS/Source/DTOs/RecordingType+KaleyraVideoSDK.swift +19 -0
- package/native-bridge/iOS/Source/DTOs/{Region+Bandyer.swift → Region+KaleyraVideoSDK.swift} +2 -3
- package/native-bridge/iOS/Source/DTOs/UserDetails+Decodable.swift +4 -10
- package/native-bridge/iOS/Source/DTOs/UserDetails+KaleyraVideoSDK.swift +15 -0
- package/native-bridge/iOS/Source/Events/Reporters/CallClientEventsReporter.swift +41 -16
- package/native-bridge/iOS/Source/Events/Reporters/ChatClientEventsReporter.swift +22 -17
- package/native-bridge/iOS/Source/Events/Reporters/ClientState.swift +14 -42
- package/native-bridge/iOS/Source/Events/Reporters/EventsReporter.swift +17 -13
- package/native-bridge/iOS/Source/Extensions/URL+FromString.swift +0 -2
- package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridge.swift +14 -43
- package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridgeError.swift +0 -1
- package/native-bridge/iOS/Source/UI/KaleyraVideoSDKUserInterfacePresenter.swift +68 -100
- package/native-bridge/iOS/Source/UI/Presenters/PresentingViewControllerViewControllerPresenter.swift +0 -1
- package/native-bridge/iOS/Source/UI/Presenters/ViewControllerPresenter.swift +0 -1
- package/native-bridge/iOS/Source/UI/Presenters/WindowViewControllerPresenter.swift +0 -1
- package/native-bridge/iOS/Source/UI/UserInterfacePresenter+MainQueueRelay.swift +0 -1
- package/native-bridge/iOS/Source/UI/UserInterfacePresenter.swift +0 -1
- package/native-bridge/iOS/Source/User Details/Cache/UsersDetailsCache.swift +6 -7
- package/native-bridge/iOS/Source/User Details/Providers/UsersDetailsProvider.swift +6 -19
- package/package.json +12 -11
- package/src/KaleyraVideo.ts +0 -42
- package/video-react-native-module.podspec +4 -4
- package/lib/commonjs/native-bridge/TypeScript/UserDetailsFormatValidator.js +0 -32
- package/lib/commonjs/native-bridge/TypeScript/types/UserDetailsFormat.js +0 -4
- package/lib/module/native-bridge/TypeScript/UserDetailsFormatValidator.js +0 -28
- package/lib/module/native-bridge/TypeScript/types/UserDetailsFormat.js +0 -3
- package/lib/typescript/native-bridge/TypeScript/UserDetailsFormatValidator.d.ts +0 -4
- package/lib/typescript/native-bridge/TypeScript/types/UserDetailsFormat.d.ts +0 -19
- package/native-bridge/TypeScript/UserDetailsFormatValidator.ts +0 -35
- package/native-bridge/TypeScript/types/UserDetailsFormat.ts +0 -23
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetailsFormatter.kt +0 -59
- package/native-bridge/iOS/Source/Abstractions/BandyerSDKProtocol.swift +0 -25
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Bandyer.swift +0 -14
- package/native-bridge/iOS/Source/DTOs/CallOptions+Bandyer.swift +0 -14
- package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Intent.swift +0 -17
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Bandyer.swift +0 -158
- package/native-bridge/iOS/Source/DTOs/RecordingType+Bandyer.swift +0 -33
- package/native-bridge/iOS/Source/DTOs/UserDetails+Bandyer.swift +0 -18
- package/native-bridge/iOS/Source/DTOs/UserDetailsFormat+Decodable.swift +0 -19
- package/native-bridge/iOS/Source/Events/Reporters/PushTokenEventsReporter.swift +0 -34
- package/native-bridge/iOS/Source/User Details/Formatter/FormatterProxy.swift +0 -16
- package/native-bridge/iOS/Source/User Details/Formatter/UserDetailsFormatter.swift +0 -83
|
@@ -3,32 +3,54 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.events.reporter
|
|
5
5
|
|
|
6
|
-
import com.
|
|
7
|
-
import com.
|
|
8
|
-
import com.bandyer.android_sdk.client.BandyerSDKInstance
|
|
9
|
-
import com.bandyer.android_sdk.module.BandyerModule
|
|
10
|
-
import com.bandyer.android_sdk.module.BandyerModuleObserver
|
|
11
|
-
import com.bandyer.android_sdk.module.BandyerModuleStatus
|
|
6
|
+
import com.kaleyra.video.State
|
|
7
|
+
import com.kaleyra.video_common_ui.KaleyraVideo
|
|
12
8
|
import com.kaleyra.video_hybrid_native_bridge.events.Events.CallModuleStatusChanged
|
|
13
9
|
import com.kaleyra.video_hybrid_native_bridge.events.Events.ChatModuleStatusChanged
|
|
14
10
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsEmitter
|
|
15
11
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsReporter
|
|
12
|
+
import kotlinx.coroutines.CoroutineScope
|
|
13
|
+
import kotlinx.coroutines.Job
|
|
14
|
+
import kotlinx.coroutines.flow.launchIn
|
|
15
|
+
import kotlinx.coroutines.flow.mapNotNull
|
|
16
|
+
import kotlinx.coroutines.flow.onEach
|
|
16
17
|
|
|
17
18
|
class ModuleEventsReporter(
|
|
18
|
-
val sdk:
|
|
19
|
-
val eventsEmitter: EventsEmitter
|
|
20
|
-
|
|
19
|
+
val sdk: KaleyraVideo,
|
|
20
|
+
val eventsEmitter: EventsEmitter,
|
|
21
|
+
val coroutineScope: CoroutineScope
|
|
22
|
+
) : EventsReporter {
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
override fun stop() = sdk.removeModuleObserver(this)
|
|
24
|
+
private var jobs: MutableSet<Job> = mutableSetOf()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
private var previousCallState: State? = null
|
|
27
|
+
|
|
28
|
+
private var previousChatState: State? = null
|
|
29
|
+
|
|
30
|
+
override fun start() {
|
|
31
|
+
stop()
|
|
32
|
+
jobs += sdk.conference.state
|
|
33
|
+
.mapNotNull { state ->
|
|
34
|
+
state.toCrossPlatformModuleStatus(previousCallState).also {
|
|
35
|
+
previousCallState = state
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.onEach { state -> eventsEmitter.sendEvent(CallModuleStatusChanged, state) }
|
|
39
|
+
.launchIn(coroutineScope)
|
|
40
|
+
jobs += sdk.conversation.state
|
|
41
|
+
.mapNotNull { state ->
|
|
42
|
+
state.toCrossPlatformModuleStatus(previousChatState).also {
|
|
43
|
+
previousChatState = state
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.onEach { state -> eventsEmitter.sendEvent(ChatModuleStatusChanged, state) }
|
|
47
|
+
.launchIn(coroutineScope)
|
|
29
48
|
}
|
|
30
49
|
|
|
31
|
-
override fun
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
override fun stop() {
|
|
51
|
+
previousCallState = null
|
|
52
|
+
previousChatState = null
|
|
53
|
+
jobs.forEach { it.cancel() }
|
|
54
|
+
jobs.clear()
|
|
55
|
+
}
|
|
34
56
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.events.reporter
|
|
5
5
|
|
|
6
|
-
import com.
|
|
6
|
+
import com.kaleyra.video_common_ui.KaleyraVideo
|
|
7
7
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsEmitter
|
|
8
8
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsReporter
|
|
9
9
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -21,20 +21,20 @@ class SDKEventsReporter internal constructor(
|
|
|
21
21
|
private var instance: SDKEventsReporter? = null
|
|
22
22
|
|
|
23
23
|
fun create(
|
|
24
|
-
sdk:
|
|
24
|
+
sdk: KaleyraVideo,
|
|
25
25
|
eventsEmitter: EventsEmitter,
|
|
26
26
|
scope: CoroutineScope
|
|
27
27
|
): SDKEventsReporter = instance.takeIf { it?.isRunning == true } ?: SDKEventsReporter(sdk, eventsEmitter, scope).apply { instance = this }
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
private constructor(
|
|
31
|
-
sdk:
|
|
31
|
+
sdk: KaleyraVideo,
|
|
32
32
|
eventsEmitter: EventsEmitter,
|
|
33
33
|
scope: CoroutineScope
|
|
34
34
|
) : this(
|
|
35
|
-
ModuleEventsReporter(sdk, eventsEmitter),
|
|
36
|
-
CallEventsReporter(sdk, eventsEmitter),
|
|
37
|
-
ChatEventsReporter(sdk, eventsEmitter),
|
|
35
|
+
ModuleEventsReporter(sdk, eventsEmitter, scope),
|
|
36
|
+
CallEventsReporter(sdk, eventsEmitter, scope),
|
|
37
|
+
ChatEventsReporter(sdk, eventsEmitter, scope),
|
|
38
38
|
scope
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
+
import com.kaleyra.video_common_ui.CallUI
|
|
6
7
|
import com.kaleyra.video_hybrid_native_bridge.CallDisplayMode
|
|
7
8
|
import com.kaleyra.video_hybrid_native_bridge.CallDisplayMode.Background
|
|
8
9
|
import com.kaleyra.video_hybrid_native_bridge.CallDisplayMode.Foreground
|
|
9
10
|
import com.kaleyra.video_hybrid_native_bridge.CallDisplayMode.ForegroundPictureInPicture
|
|
10
11
|
|
|
11
12
|
internal fun CallDisplayMode.toSDK() = when (this) {
|
|
12
|
-
Background ->
|
|
13
|
-
Foreground ->
|
|
14
|
-
ForegroundPictureInPicture ->
|
|
13
|
+
Background -> CallUI.DisplayMode.Background
|
|
14
|
+
Foreground -> CallUI.DisplayMode.Foreground
|
|
15
|
+
ForegroundPictureInPicture -> CallUI.DisplayMode.PictureInPicture
|
|
15
16
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
2
|
+
|
|
3
|
+
import com.kaleyra.video.conference.Call
|
|
4
|
+
import com.kaleyra.video_hybrid_native_bridge.CallType
|
|
5
|
+
|
|
6
|
+
internal fun CallType.toSDK(): Call.PreferredType {
|
|
7
|
+
return when(this) {
|
|
8
|
+
CallType.Audio -> Call.PreferredType.audioOnly()
|
|
9
|
+
CallType.AudioUpgradable -> Call.PreferredType.audioUpgradable()
|
|
10
|
+
CallType.AudioVideo -> Call.PreferredType.audioVideo()
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
-
import com.
|
|
6
|
+
import com.kaleyra.video.configuration.Configuration
|
|
7
7
|
import com.kaleyra.video_hybrid_native_bridge.KaleyraVideoConfiguration
|
|
8
|
-
import com.kaleyra.video_hybrid_native_bridge.CreateCallOptionsProxy
|
|
9
8
|
import com.kaleyra.video_hybrid_native_bridge.utils.TLSSocketFactoryCompat
|
|
10
|
-
import com.kaleyra.
|
|
11
|
-
import com.kaleyra.
|
|
9
|
+
import com.kaleyra.video_utils.logging.BaseLogger
|
|
10
|
+
import com.kaleyra.video_utils.logging.androidPrioryLogger
|
|
12
11
|
import okhttp3.OkHttpClient
|
|
13
12
|
import java.security.cert.X509Certificate
|
|
14
13
|
import javax.net.ssl.X509TrustManager
|
|
@@ -17,23 +16,18 @@ import javax.net.ssl.X509TrustManager
|
|
|
17
16
|
*
|
|
18
17
|
* @author kristiyan
|
|
19
18
|
*/
|
|
20
|
-
internal fun KaleyraVideoConfiguration.toSDK(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
if (logEnabled == true) enableLogger()
|
|
30
|
-
httpStack(trustedHttpClient())
|
|
31
|
-
}.build()
|
|
19
|
+
internal fun KaleyraVideoConfiguration.toSDK() =
|
|
20
|
+
Configuration(
|
|
21
|
+
appId = appID,
|
|
22
|
+
environment = environment.toSDK(),
|
|
23
|
+
region = region.toSDK(),
|
|
24
|
+
httpStack = trustedHttpClient(),
|
|
25
|
+
logger = if (logEnabled == true) androidPrioryLogger(BaseLogger.VERBOSE, -1) else null
|
|
26
|
+
)
|
|
32
27
|
|
|
33
|
-
private fun
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}).build()
|
|
28
|
+
private fun trustedHttpClient() =
|
|
29
|
+
OkHttpClient.Builder().sslSocketFactory(TLSSocketFactoryCompat(), object : X509TrustManager {
|
|
30
|
+
override fun getAcceptedIssuers(): Array<X509Certificate> = arrayOf()
|
|
31
|
+
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) = Unit
|
|
32
|
+
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) = Unit
|
|
33
|
+
}).build()
|
|
@@ -6,7 +6,7 @@ package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
|
6
6
|
import com.kaleyra.video_hybrid_native_bridge.Environment
|
|
7
7
|
|
|
8
8
|
internal fun Environment.toSDK() = when (name.lowercase()) {
|
|
9
|
-
"sandbox" -> com.kaleyra.
|
|
10
|
-
"production" -> com.kaleyra.
|
|
11
|
-
else -> com.kaleyra.
|
|
9
|
+
"sandbox" -> com.kaleyra.video.configuration.Environment.Sandbox
|
|
10
|
+
"production" -> com.kaleyra.video.configuration.Environment.Production
|
|
11
|
+
else -> com.kaleyra.video.configuration.Environment.create(name)
|
|
12
12
|
}
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
-
import com.
|
|
7
|
-
import com.bandyer.android_sdk.intent.call.CallRecordingType.AUTOMATIC
|
|
8
|
-
import com.bandyer.android_sdk.intent.call.CallRecordingType.MANUAL
|
|
6
|
+
import com.kaleyra.video.conference.Call
|
|
9
7
|
import com.kaleyra.video_hybrid_native_bridge.RecordingType
|
|
10
8
|
|
|
11
|
-
internal fun RecordingType?.toSDK()
|
|
12
|
-
RecordingType.Manual ->
|
|
13
|
-
RecordingType.Automatic ->
|
|
14
|
-
else ->
|
|
9
|
+
internal fun RecordingType?.toSDK() = when (this) {
|
|
10
|
+
RecordingType.Manual -> Call.Recording.manual()
|
|
11
|
+
RecordingType.Automatic -> Call.Recording.automatic()
|
|
12
|
+
else -> Call.Recording.disabled()
|
|
15
13
|
}
|
|
@@ -6,8 +6,8 @@ package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
|
6
6
|
import com.kaleyra.video_hybrid_native_bridge.Region
|
|
7
7
|
|
|
8
8
|
internal fun Region.toSDK() = when (name.lowercase()) {
|
|
9
|
-
"europe" -> com.kaleyra.
|
|
10
|
-
"india" -> com.kaleyra.
|
|
11
|
-
"us" -> com.kaleyra.
|
|
12
|
-
else -> com.kaleyra.
|
|
9
|
+
"europe" -> com.kaleyra.video.configuration.Region.Europe
|
|
10
|
+
"india" -> com.kaleyra.video.configuration.Region.India
|
|
11
|
+
"us" -> com.kaleyra.video.configuration.Region.US
|
|
12
|
+
else -> com.kaleyra.video.configuration.Region.create(name)
|
|
13
13
|
}
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
-
import com.
|
|
7
|
-
import com.bandyer.android_sdk.tool_configuration.screen_share.ScreenShareOptionSet
|
|
6
|
+
import com.kaleyra.video_common_ui.CallUI
|
|
8
7
|
import com.kaleyra.video_hybrid_native_bridge.ScreenShareToolConfiguration
|
|
9
8
|
|
|
10
|
-
internal fun ScreenShareToolConfiguration?.toSDK():
|
|
11
|
-
this?.inApp == true && this.wholeDevice == true ->
|
|
12
|
-
this?.inApp == true ->
|
|
13
|
-
this?.wholeDevice == true ->
|
|
9
|
+
internal fun ScreenShareToolConfiguration?.toSDK(): CallUI.Action.ScreenShare? = when {
|
|
10
|
+
this?.inApp == true && this.wholeDevice == true -> CallUI.Action.ScreenShare.UserChoice
|
|
11
|
+
this?.inApp == true -> CallUI.Action.ScreenShare.App
|
|
12
|
+
this?.wholeDevice == true -> CallUI.Action.ScreenShare.WholeDevice
|
|
14
13
|
else -> null
|
|
15
14
|
}
|
|
@@ -3,93 +3,61 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
-
import com.
|
|
7
|
-
import com.
|
|
8
|
-
import com.
|
|
9
|
-
import com.
|
|
10
|
-
import com.bandyer.android_sdk.tool_configuration.file_share.CustomFileShareConfiguration
|
|
11
|
-
import com.bandyer.android_sdk.tool_configuration.file_share.FileShareConfiguration
|
|
12
|
-
import com.bandyer.android_sdk.tool_configuration.screen_share.CustomScreenShareConfiguration
|
|
13
|
-
import com.bandyer.android_sdk.tool_configuration.screen_share.ScreenShareConfiguration
|
|
14
|
-
import com.bandyer.android_sdk.tool_configuration.whiteboard.CustomWhiteboardConfiguration
|
|
15
|
-
import com.bandyer.android_sdk.tool_configuration.whiteboard.WhiteboardConfiguration
|
|
6
|
+
import com.kaleyra.video.conference.Call
|
|
7
|
+
import com.kaleyra.video_common_ui.CallUI
|
|
8
|
+
import com.kaleyra.video_common_ui.ChatUI
|
|
9
|
+
import com.kaleyra.video_common_ui.ChatUI.Action.CreateCall
|
|
16
10
|
import com.kaleyra.video_hybrid_native_bridge.AudioCallType.Audio
|
|
17
11
|
import com.kaleyra.video_hybrid_native_bridge.AudioCallType.AudioUpgradable
|
|
18
|
-
import com.kaleyra.video_hybrid_native_bridge.CreateCallOptionsProxy
|
|
19
|
-
import com.kaleyra.video_hybrid_native_bridge.RecordingType
|
|
20
12
|
import com.kaleyra.video_hybrid_native_bridge.Tools
|
|
21
13
|
|
|
22
|
-
internal fun Tools.
|
|
23
|
-
val
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
internal fun Tools.toCallActions(): Set<CallUI.Action> {
|
|
15
|
+
val callActions = CallUI.Action.default.toMutableSet()
|
|
16
|
+
if (this.whiteboard == true) {
|
|
17
|
+
callActions.add(CallUI.Action.OpenWhiteboard.Full)
|
|
18
|
+
}
|
|
19
|
+
if (this.fileShare == true) {
|
|
20
|
+
callActions.add(CallUI.Action.FileShare)
|
|
21
|
+
}
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
fileShareConfiguration,
|
|
32
|
-
screenShareConfiguration,
|
|
33
|
-
whiteboardConfiguration
|
|
34
|
-
),
|
|
35
|
-
optionSet = callOptions(feedback, createCallOptionsProxy.createCallOptions.recordingType)
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
internal fun Tools.toChatConfiguration(): CustomChatConfiguration? {
|
|
40
|
-
this.chat ?: return null
|
|
41
|
-
val fileShareConfiguration = CustomFileShareConfiguration().takeIf { fileShare == true }
|
|
42
|
-
val screenShareConfiguration = screenShare(this)
|
|
43
|
-
val whiteboardConfiguration = CustomWhiteboardConfiguration().takeIf { whiteboard == true }
|
|
44
|
-
val feedback = feedback == true
|
|
45
|
-
|
|
46
|
-
val audioChatCallConfiguration = chatCallConfiguration(
|
|
47
|
-
fileShareConfiguration,
|
|
48
|
-
screenShareConfiguration,
|
|
49
|
-
whiteboardConfiguration,
|
|
50
|
-
feedback,
|
|
51
|
-
chat.audioCallOption?.recordingType
|
|
52
|
-
)
|
|
23
|
+
screenShare.toSDK()?.let {
|
|
24
|
+
callActions.add(it)
|
|
25
|
+
}
|
|
53
26
|
|
|
54
|
-
|
|
55
|
-
fileShareConfiguration,
|
|
56
|
-
screenShareConfiguration,
|
|
57
|
-
whiteboardConfiguration,
|
|
58
|
-
feedback,
|
|
59
|
-
chat.videoCallOption?.recordingType
|
|
60
|
-
)
|
|
61
|
-
return CustomChatConfiguration(CustomCapabilitySet(
|
|
62
|
-
audioCallConfiguration = audioChatCallConfiguration.takeIf { chat.audioCallOption?.type == Audio },
|
|
63
|
-
audioUpgradableCallConfiguration = audioChatCallConfiguration.takeIf { chat.audioCallOption?.type == AudioUpgradable },
|
|
64
|
-
audioVideoCallConfiguration = audioVideoChatCallConfiguration.takeIf { chat.videoCallOption != null }
|
|
65
|
-
))
|
|
27
|
+
return callActions
|
|
66
28
|
}
|
|
67
29
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
val
|
|
71
|
-
|
|
30
|
+
internal fun Tools.toChatActions(): Set<ChatUI.Action> {
|
|
31
|
+
chat ?: return emptySet()
|
|
32
|
+
val chatActions = mutableSetOf<ChatUI.Action>()
|
|
33
|
+
when (chat.audioCallOption?.type) {
|
|
34
|
+
Audio -> {
|
|
35
|
+
chatActions.add(
|
|
36
|
+
CreateCall(
|
|
37
|
+
preferredType = Call.PreferredType.audioOnly(),
|
|
38
|
+
recordingType = chat.audioCallOption.recordingType.toSDK()
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
AudioUpgradable -> {
|
|
44
|
+
chatActions.add(
|
|
45
|
+
CreateCall(
|
|
46
|
+
preferredType = Call.PreferredType.audioUpgradable(),
|
|
47
|
+
recordingType = chat.audioCallOption.recordingType.toSDK()
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
else -> Unit
|
|
53
|
+
}
|
|
54
|
+
if (chat.videoCallOption != null) {
|
|
55
|
+
chatActions.add(
|
|
56
|
+
CreateCall(
|
|
57
|
+
preferredType = Call.PreferredType.audioVideo(),
|
|
58
|
+
recordingType = chat.videoCallOption.recordingType.toSDK()
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
return chatActions
|
|
72
63
|
}
|
|
73
|
-
|
|
74
|
-
private fun callOptions(feedback: Boolean, recordingType: RecordingType?) = CallOptions(feedbackEnabled = feedback, callRecordingType = recordingType.toSDK())
|
|
75
|
-
|
|
76
|
-
private fun chatCallCapabilitySet(
|
|
77
|
-
fileShareConfiguration: FileShareConfiguration?,
|
|
78
|
-
screenShareConfiguration: ScreenShareConfiguration?,
|
|
79
|
-
whiteboardConfiguration: WhiteboardConfiguration?
|
|
80
|
-
) = CustomCapabilitySet.CustomCallConfiguration.CustomCapabilitySet(
|
|
81
|
-
fileShareConfiguration,
|
|
82
|
-
screenShareConfiguration,
|
|
83
|
-
whiteboardConfiguration
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
private fun chatCallConfiguration(
|
|
87
|
-
fileShareConfiguration: CustomFileShareConfiguration?,
|
|
88
|
-
screenShareConfiguration: CustomScreenShareConfiguration?,
|
|
89
|
-
whiteboardConfiguration: CustomWhiteboardConfiguration?,
|
|
90
|
-
feedback: Boolean,
|
|
91
|
-
recordingType: RecordingType?
|
|
92
|
-
) = CustomCapabilitySet.CustomCallConfiguration(
|
|
93
|
-
capabilitySet = chatCallCapabilitySet(fileShareConfiguration, screenShareConfiguration, whiteboardConfiguration),
|
|
94
|
-
optionSet = callOptions(feedback, recordingType)
|
|
95
|
-
)
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.extensions
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import android.net.Uri
|
|
7
|
+
import com.kaleyra.video_common_ui.model.UserDetails
|
|
7
8
|
import com.kaleyra.video_hybrid_native_bridge.repository.UserDetailsEntity
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -11,25 +12,31 @@ import com.kaleyra.video_hybrid_native_bridge.repository.UserDetailsEntity
|
|
|
11
12
|
* @author kristiyan
|
|
12
13
|
*/
|
|
13
14
|
internal fun UserDetailsEntity.toSDK(): UserDetails {
|
|
14
|
-
return UserDetails
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
return UserDetails(
|
|
16
|
+
userId = userID,
|
|
17
|
+
name = name ?: userID,
|
|
18
|
+
image = imageUrl?.let { Uri.parse(it) } ?: Uri.EMPTY
|
|
19
|
+
)
|
|
20
|
+
}
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
internal fun com.kaleyra.video_hybrid_native_bridge.UserDetails.toSDK(): UserDetails {
|
|
23
|
+
return UserDetails(
|
|
24
|
+
userId = userID,
|
|
25
|
+
name = name ?: userID,
|
|
26
|
+
image = imageURL?.let { Uri.parse(it) } ?: Uri.EMPTY
|
|
27
|
+
)
|
|
28
|
+
}
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
internal fun com.kaleyra.video_hybrid_native_bridge.UserDetails.toDatabaseEntity(): UserDetailsEntity {
|
|
31
|
+
return UserDetailsEntity(
|
|
32
|
+
userID = userID,
|
|
33
|
+
name = name,
|
|
34
|
+
imageUrl = imageURL
|
|
35
|
+
)
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
internal fun UserDetailsEntity.toUserDetails(): com.kaleyra.video_hybrid_native_bridge.UserDetails = com.kaleyra.video_hybrid_native_bridge.UserDetails(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
lastName = this.lastName,
|
|
31
|
-
nickName = this.nickName,
|
|
32
|
-
profileImageURL = this.imageUrl
|
|
39
|
+
userID = this.userID,
|
|
40
|
+
name = this.name,
|
|
41
|
+
imageURL = this.imageUrl
|
|
33
42
|
)
|
|
34
|
-
|
|
35
|
-
internal fun UserDetails.toUserDetailsEntity(): UserDetailsEntity = UserDetailsEntity(userAlias, firstName, lastName, nickName, email, imageUrl)
|
|
@@ -8,9 +8,9 @@ import android.content.Context
|
|
|
8
8
|
import android.content.Intent
|
|
9
9
|
import android.util.Log
|
|
10
10
|
import androidx.core.app.JobIntentService
|
|
11
|
-
import com.kaleyra.video_hybrid_native_bridge.VideoSDKHybridBridge
|
|
12
11
|
import com.kaleyra.video_hybrid_native_bridge.ContextContainer
|
|
13
12
|
import com.kaleyra.video_hybrid_native_bridge.CrossPlatformAccessTokenProvider
|
|
13
|
+
import com.kaleyra.video_hybrid_native_bridge.VideoSDKHybridBridge
|
|
14
14
|
import com.kaleyra.video_hybrid_native_bridge.events.Events
|
|
15
15
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsEmitter
|
|
16
16
|
import com.kaleyra.video_hybrid_native_bridge.events.EventsReporter
|
|
@@ -59,7 +59,6 @@ class KaleyraVideoNotificationService : JobIntentService() {
|
|
|
59
59
|
plugin.addUsersDetails(plugin.cachedUserDetails.toTypedArray())
|
|
60
60
|
plugin.configureBridge(savedConfiguration)
|
|
61
61
|
plugin.connect(savedUsed)
|
|
62
|
-
plugin.handlePushNotificationPayload(webHookPayload)
|
|
63
62
|
}
|
|
64
63
|
} catch (exception: Throwable) {
|
|
65
64
|
Log.e("KaleyraNotService", "" + exception.message)
|
|
@@ -10,7 +10,7 @@ interface UserDetailsDao {
|
|
|
10
10
|
@get:Query("SELECT * FROM userdetailsentity")
|
|
11
11
|
val all: List<UserDetailsEntity>
|
|
12
12
|
|
|
13
|
-
@Query("SELECT * FROM userdetailsentity WHERE
|
|
13
|
+
@Query("SELECT * FROM userdetailsentity WHERE userID = :userAlias LIMIT 1")
|
|
14
14
|
fun getUserDetailsEntity(userAlias: String): UserDetailsEntity?
|
|
15
15
|
|
|
16
16
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
@@ -6,17 +6,13 @@ package com.kaleyra.video_hybrid_native_bridge.repository
|
|
|
6
6
|
import androidx.room.Entity
|
|
7
7
|
import androidx.room.PrimaryKey
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
/**
|
|
11
10
|
* @suppress
|
|
12
11
|
* @author kristiyan
|
|
13
12
|
*/
|
|
14
13
|
@Entity
|
|
15
14
|
data class UserDetailsEntity(
|
|
16
|
-
@PrimaryKey val
|
|
17
|
-
var
|
|
18
|
-
var lastName: String? = null,
|
|
19
|
-
var nickName: String? = null,
|
|
20
|
-
var email: String? = null,
|
|
15
|
+
@PrimaryKey val userID: String,
|
|
16
|
+
var name: String? = null,
|
|
21
17
|
var imageUrl: String? = null
|
|
22
18
|
)
|
|
@@ -14,7 +14,7 @@ import androidx.room.TypeConverters
|
|
|
14
14
|
*
|
|
15
15
|
* @author kristiyan
|
|
16
16
|
*/
|
|
17
|
-
@Database(entities = [UserDetailsEntity::class, ConfigurationEntity::class, ConnectedUserEntity::class], version =
|
|
17
|
+
@Database(entities = [UserDetailsEntity::class, ConfigurationEntity::class, ConnectedUserEntity::class], version = 3, exportSchema = false)
|
|
18
18
|
@TypeConverters(Converters::class)
|
|
19
19
|
abstract class VideoHybridBridgeRepository : RoomDatabase() {
|
|
20
20
|
|
|
@@ -3,47 +3,49 @@
|
|
|
3
3
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.ui
|
|
5
5
|
|
|
6
|
-
import com.
|
|
7
|
-
import com.bandyer.android_sdk.intent.BandyerIntent
|
|
6
|
+
import com.kaleyra.video_common_ui.KaleyraVideo
|
|
8
7
|
import com.kaleyra.video_hybrid_native_bridge.CallDisplayMode
|
|
9
|
-
import com.kaleyra.video_hybrid_native_bridge.CallType.Audio
|
|
10
|
-
import com.kaleyra.video_hybrid_native_bridge.CallType.AudioUpgradable
|
|
11
|
-
import com.kaleyra.video_hybrid_native_bridge.CallType.AudioVideo
|
|
12
8
|
import com.kaleyra.video_hybrid_native_bridge.ContextContainer
|
|
13
9
|
import com.kaleyra.video_hybrid_native_bridge.CreateCallOptions
|
|
10
|
+
import com.kaleyra.video_hybrid_native_bridge.configurator.CachedSDKConfigurator
|
|
14
11
|
import com.kaleyra.video_hybrid_native_bridge.extensions.toSDK
|
|
12
|
+
import com.kaleyra.video.State
|
|
15
13
|
|
|
16
14
|
internal class SDKUserInterfacePresenter(
|
|
17
|
-
private val sdk:
|
|
18
|
-
private val contextContainer: ContextContainer
|
|
15
|
+
private val sdk: KaleyraVideo,
|
|
16
|
+
private val contextContainer: ContextContainer,
|
|
17
|
+
private val configurator: CachedSDKConfigurator
|
|
19
18
|
) : UserInterfacePresenter {
|
|
20
19
|
|
|
21
20
|
private val context
|
|
22
21
|
get() = contextContainer.context
|
|
23
22
|
|
|
24
23
|
override fun startCall(callOptions: CreateCallOptions) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
24
|
+
sdk.conference.call(
|
|
25
|
+
userIDs = callOptions.callees,
|
|
26
|
+
options = {
|
|
27
|
+
recordingType = callOptions.recordingType.toSDK()
|
|
28
|
+
preferredType = callOptions.callType.toSDK()
|
|
29
|
+
}
|
|
30
|
+
).onSuccess {
|
|
31
|
+
val withFeedback = configurator.lastConfiguration?.tools?.feedback == true
|
|
32
|
+
it.withFeedback = withFeedback
|
|
31
33
|
}
|
|
32
|
-
context.startActivity(bandyerCallIntent)
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
override fun startCallUrl(url: String) {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
if (sdk.state.value == State.Disconnected) {
|
|
38
|
+
sdk.connect(url)
|
|
39
|
+
}
|
|
40
|
+
sdk.conference.joinUrl(url)
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
override fun startChat(userId: String) {
|
|
41
|
-
|
|
42
|
-
context.startActivity(bandyerCallIntent)
|
|
44
|
+
sdk.conversation.chat(context, userId)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
override fun setDisplayModeForCurrentCall(mode: CallDisplayMode) {
|
|
46
|
-
val ongoingCall = sdk.
|
|
47
|
-
|
|
48
|
+
val ongoingCall = sdk.conference.call.replayCache.firstOrNull() ?: return
|
|
49
|
+
ongoingCall.setDisplayMode(mode.toSDK())
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -4,14 +4,11 @@
|
|
|
4
4
|
package com.kaleyra.video_hybrid_native_bridge.user_details
|
|
5
5
|
|
|
6
6
|
import com.kaleyra.video_hybrid_native_bridge.UserDetails
|
|
7
|
-
import com.kaleyra.video_hybrid_native_bridge.UserDetailsFormat
|
|
8
7
|
|
|
9
8
|
interface CachedUserDetails {
|
|
10
9
|
|
|
11
10
|
val cachedUserDetails: androidx.collection.ArraySet<UserDetails>
|
|
12
11
|
|
|
13
|
-
fun setUserDetailsFormat(format: UserDetailsFormat)
|
|
14
|
-
|
|
15
12
|
fun addUsersDetails(userDetails: Array<UserDetails>)
|
|
16
13
|
|
|
17
14
|
fun removeUserDetails()
|