diff --git a/build.gradle.kts b/build.gradle.kts index 08f5ebcf6c..0b0cf59d4f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,9 +63,15 @@ apply(from = "${rootDir}/scripts/publish-root.gradle") //} afterEvaluate { - println("Running Add Pre Commit Git Hook Script on Build") - exec { - commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks") - } - println("Added pre-push Git Hook Script.") + println("Running Add Pre Commit Git Hook Script on Build") + exec { + if (System.getProperty("os.name").toLowerCase().contains("win")) { + // Windows-specific command + commandLine("cmd", "/c", "copy", ".\\scripts\\git-hooks\\pre-push", ".\\.git\\hooks") + } else { + // Unix-based systems + commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks") + } + } + println("Added pre-push Git Hook Script.") } \ No newline at end of file diff --git a/stream-video-android-core/api/stream-video-android-core.api b/stream-video-android-core/api/stream-video-android-core.api index 5af75d495d..a3a4726aaa 100644 --- a/stream-video-android-core/api/stream-video-android-core.api +++ b/stream-video-android-core/api/stream-video-android-core.api @@ -43,6 +43,7 @@ public final class io/getstream/video/android/core/Call { public final fun leave ()V public final fun listRecordings (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun listRecordings$default (Lio/getstream/video/android/core/Call;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun listTranscription (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun migrate (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun muteAllUsers (ZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun muteAllUsers$default (Lio/getstream/video/android/core/Call;ZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; @@ -73,10 +74,12 @@ public final class io/getstream/video/android/core/Call { public final fun startHLS (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun startRecording (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun startScreenSharing (Landroid/content/Intent;)V + public final fun startTranscription (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun stopHLS (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun stopLive (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun stopRecording (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun stopScreenSharing ()V + public final fun stopTranscription (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun subscribe (Lio/getstream/video/android/core/events/VideoEventListener;)Lio/getstream/video/android/core/EventSubscription; public final fun subscribeFor ([Ljava/lang/Class;Lio/getstream/video/android/core/events/VideoEventListener;)Lio/getstream/video/android/core/EventSubscription; public final fun takeScreenshot (Lio/getstream/video/android/core/model/VideoTrack;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt index 5e432fdc32..aa7c6f2137 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt @@ -66,6 +66,7 @@ import org.openapitools.client.models.GetOrCreateCallResponse import org.openapitools.client.models.GoLiveResponse import org.openapitools.client.models.JoinCallResponse import org.openapitools.client.models.ListRecordingsResponse +import org.openapitools.client.models.ListTranscriptionsResponse import org.openapitools.client.models.MemberRequest import org.openapitools.client.models.MuteUsersResponse import org.openapitools.client.models.OwnCapability @@ -73,7 +74,9 @@ import org.openapitools.client.models.PinResponse import org.openapitools.client.models.RejectCallResponse import org.openapitools.client.models.SendCallEventResponse import org.openapitools.client.models.SendReactionResponse +import org.openapitools.client.models.StartTranscriptionResponse import org.openapitools.client.models.StopLiveResponse +import org.openapitools.client.models.StopTranscriptionResponse import org.openapitools.client.models.UnpinResponse import org.openapitools.client.models.UpdateCallMembersRequest import org.openapitools.client.models.UpdateCallMembersResponse @@ -1264,6 +1267,18 @@ public class Call( return clientImpl.toggleAudioProcessing() } + suspend fun startTranscription(): Result { + return clientImpl.startTranscription(type, id) + } + + suspend fun stopTranscription(): Result { + return clientImpl.stopTranscription(type, id) + } + + suspend fun listTranscription(): Result { + return clientImpl.listTranscription(type, id) + } + @InternalStreamVideoApi public val debug = Debug(this) diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/CallState.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/CallState.kt index 1adac85b87..b3a62edf7c 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/CallState.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/CallState.kt @@ -94,6 +94,9 @@ import org.openapitools.client.models.CallSessionResponse import org.openapitools.client.models.CallSessionStartedEvent import org.openapitools.client.models.CallSettingsResponse import org.openapitools.client.models.CallStateResponseFields +import org.openapitools.client.models.CallTranscriptionFailedEvent +import org.openapitools.client.models.CallTranscriptionStartedEvent +import org.openapitools.client.models.CallTranscriptionStoppedEvent import org.openapitools.client.models.CallUpdatedEvent import org.openapitools.client.models.ConnectedEvent import org.openapitools.client.models.CustomVideoEvent @@ -932,6 +935,16 @@ public class CallState( updateParticipantCounts(session = session.value) updateRingingState() } + + is CallTranscriptionStartedEvent -> { + _transcribing.value = true + } + is CallTranscriptionStoppedEvent -> { + _transcribing.value = false + } + is CallTranscriptionFailedEvent -> { + _transcribing.value = false + } } } diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt index 719097d1c8..8c0e66eae5 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt @@ -100,6 +100,7 @@ import org.openapitools.client.models.GoLiveResponse import org.openapitools.client.models.JoinCallRequest import org.openapitools.client.models.JoinCallResponse import org.openapitools.client.models.ListRecordingsResponse +import org.openapitools.client.models.ListTranscriptionsResponse import org.openapitools.client.models.MemberRequest import org.openapitools.client.models.MuteUsersResponse import org.openapitools.client.models.PinRequest @@ -115,7 +116,10 @@ import org.openapitools.client.models.SendReactionRequest import org.openapitools.client.models.SendReactionResponse import org.openapitools.client.models.StartHLSBroadcastingResponse import org.openapitools.client.models.StartRecordingRequest +import org.openapitools.client.models.StartTranscriptionRequest +import org.openapitools.client.models.StartTranscriptionResponse import org.openapitools.client.models.StopLiveResponse +import org.openapitools.client.models.StopTranscriptionResponse import org.openapitools.client.models.UnblockUserRequest import org.openapitools.client.models.UnpinRequest import org.openapitools.client.models.UpdateCallMembersRequest @@ -1092,6 +1096,25 @@ internal class StreamVideoClient internal constructor( internal fun toggleAudioProcessing(): Boolean { return peerConnectionFactory.toggleAudioProcessing() } + + suspend fun startTranscription(type: String, id: String, externalStorage: String? = null): Result { + return apiCall { + val startTranscriptionRequest = StartTranscriptionRequest(externalStorage) + coordinatorConnectionModule.api.startTranscription(type, id, startTranscriptionRequest) + } + } + + suspend fun stopTranscription(type: String, id: String): Result { + return apiCall { + coordinatorConnectionModule.api.stopTranscription(type, id) + } + } + + suspend fun listTranscription(type: String, id: String): Result { + return apiCall { + coordinatorConnectionModule.api.listTranscriptions(type, id) + } + } } /** Extension function that makes it easy to use on kotlin, but keeps Java usable as well */