From 6e6219657fc6cb4f4bed72905269d3acd9b9e27f Mon Sep 17 00:00:00 2001 From: Pawan Dixit <103245157+pawan-100ms@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:55:40 +0400 Subject: [PATCH 1/5] Update captions.mdx --- .../set-up-video-conferencing/captions.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx index a9e19be88..5fdec7567 100644 --- a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx +++ b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx @@ -53,3 +53,26 @@ Here is an example implemenation: } } ``` + +## How to toggle Live Transcriptions on/off +You can toggle live transcriptions on/off at runtime that can help save costs. Use startTranscription() method to start the transcription and stopTranscription() method to stop transcription like below: +```swift + // Start Real Time Transcription + sdk.startTranscription() { success, error in + if let error = error { + // handle error + } else { + // success + } + } + + // Stop Real Time Transcription + sdk.stopTranscription() { success, error in + if let error = error { + // handle error + } else { + // success + } + } +``` + From 88b29c338cac0dccb642ae8ab3065d97d9c6808c Mon Sep 17 00:00:00 2001 From: Pawan Dixit <103245157+pawan-100ms@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:21:13 +0400 Subject: [PATCH 2/5] Update captions.mdx --- .../how-to-guides/set-up-video-conferencing/captions.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx index 5fdec7567..a2550c5f6 100644 --- a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx +++ b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx @@ -10,6 +10,15 @@ The SDK provides a callback with the transcript for each peer when they speak. - Minimum 100ms SDK version required is 1.9.0 +## How to check if captions are started in a room? + +To check if live captions are enabled in a room, check if transcriptionState of type caption is in started state in HMSRoom object like below: + +```swift + let captionsEnabled = hmsSDK.room?.transcriptionStates?.first { $0.state == HMSTranscriptionStatus.started } != nil +} +``` + ## How to implement closed captioning? Implement `on(transcripts: HMSTranscripts)` from `HMSUpdateListener` callback like below: From 8e3d9c97779f5884eae22351c7ec0ffd1df5a354 Mon Sep 17 00:00:00 2001 From: Pawan Dixit <103245157+pawan-100ms@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:48:24 +0400 Subject: [PATCH 3/5] Update captions.mdx --- .../v2/how-to-guides/set-up-video-conferencing/captions.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx index a2550c5f6..31c333573 100644 --- a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx +++ b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx @@ -15,8 +15,7 @@ The SDK provides a callback with the transcript for each peer when they speak. To check if live captions are enabled in a room, check if transcriptionState of type caption is in started state in HMSRoom object like below: ```swift - let captionsEnabled = hmsSDK.room?.transcriptionStates?.first { $0.state == HMSTranscriptionStatus.started } != nil -} + let captionsEnabled = hmsSDK.room?.transcriptionStates?.first { $0.state == HMSTranscriptionStatus.started } != nil } ``` ## How to implement closed captioning? From ae40b22ba811d4f394c0e2c56f8c793e8d9fda2f Mon Sep 17 00:00:00 2001 From: Pawan Dixit <103245157+pawan-100ms@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:49:53 +0400 Subject: [PATCH 4/5] Update captions.mdx --- .../ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx index 31c333573..328c12c69 100644 --- a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx +++ b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx @@ -8,7 +8,7 @@ The SDK provides a callback with the transcript for each peer when they speak. ## Minimum Requirements -- Minimum 100ms SDK version required is 1.9.0 +- Minimum 100ms SDK version required is 1.12.0 ## How to check if captions are started in a room? From 9d8487788cce7710e34ed833fb533317c6aaa36f Mon Sep 17 00:00:00 2001 From: Pawan Dixit <103245157+pawan-100ms@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:33:36 +0400 Subject: [PATCH 5/5] Update captions.mdx --- .../set-up-video-conferencing/captions.mdx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx index 328c12c69..6543dbdd6 100644 --- a/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx +++ b/docs/ios/v2/how-to-guides/set-up-video-conferencing/captions.mdx @@ -15,7 +15,7 @@ The SDK provides a callback with the transcript for each peer when they speak. To check if live captions are enabled in a room, check if transcriptionState of type caption is in started state in HMSRoom object like below: ```swift - let captionsEnabled = hmsSDK.room?.transcriptionStates?.first { $0.state == HMSTranscriptionStatus.started } != nil } +let captionsEnabled = hmsSDK.room?.transcriptionStates?.first { $0.state == HMSTranscriptionStatus.started } != nil } ``` ## How to implement closed captioning? @@ -23,10 +23,9 @@ To check if live captions are enabled in a room, check if transcriptionState of Implement `on(transcripts: HMSTranscripts)` from `HMSUpdateListener` callback like below: ```swift - public func on(transcripts: HMSTranscripts) { - transcripts.transcripts.forEach { transcript in - // handle transcript - } +public func on(transcripts: HMSTranscripts) { + transcripts.transcripts.forEach { transcript in + // handle transcript } } ``` @@ -59,7 +58,6 @@ Here is an example implemenation: lastTranscript = transcript } } -} ``` ## How to toggle Live Transcriptions on/off