-
Notifications
You must be signed in to change notification settings - Fork 56
Add functionality to enable /disable transcriptions in demo app #1235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aleksandar-apostolov
merged 17 commits into
develop
from
feature/rahullohra/enable_transcriptions_in_demo_app
Dec 26, 2024
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3ca9188
Expose Transcription APIs to Call Class
rahul-lohra 3a8e837
Enable transcription in demo app checkpoint 1
rahul-lohra 769f98a
Expose Transcription APIs to Call Class
rahul-lohra 7944e1d
Update public apis
rahul-lohra fb778cd
Merge branch 'refs/heads/develop' into feature/rahullohra/enable_tran…
rahul-lohra 0408fe7
Fix variable name mistake
rahul-lohra b53deeb
Merge branch 'refs/heads/feature/rahullohra/enable_transcription_apis…
rahul-lohra 4a05030
Add functionality in call menu options to start/stop transcriptions
rahul-lohra b21e788
Merge branch 'develop' into feature/rahullohra/enable_transcriptions_…
rahul-lohra e82d637
Resolve merge conflict
rahul-lohra 6a65116
1. Fix auto start/stop transcription
rahul-lohra c8234aa
Merge branch 'refs/heads/develop' into feature/rahullohra/enable_tran…
rahul-lohra bdb405d
Remove unused comments
rahul-lohra e38252a
Merge branch 'develop' into feature/rahullohra/enable_transcriptions_…
aleksandar-apostolov b7ec855
Merge branch 'develop' into feature/rahullohra/enable_transcriptions_…
aleksandar-apostolov 4b88a67
Merge branch 'refs/heads/develop' into feature/rahullohra/enable_tran…
aleksandar-apostolov 61625ef
Spotless & ApiDump
aleksandar-apostolov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
demo-app/src/main/kotlin/io/getstream/video/android/ui/menu/TranscriptionUiState.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. | ||
| * | ||
| * Licensed under the Stream License; | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package io.getstream.video.android.ui.menu | ||
|
|
||
| import androidx.compose.material.icons.Icons | ||
| import androidx.compose.material.icons.filled.Description | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
|
|
||
| sealed class TranscriptionUiState( | ||
| val text: String, | ||
| val icon: ImageVector, // Assuming it's a drawable resource ID | ||
| val highlight: Boolean, | ||
| ) | ||
|
|
||
| /** | ||
| * Stop Transcription | ||
| * Start Transcription | ||
| * Transcription is disabled | ||
| * Transcription failed | ||
| */ | ||
|
|
||
| data object TranscriptionAvailableUiState : TranscriptionUiState( | ||
| text = "Transcribe the call", | ||
| icon = Icons.Default.Description, | ||
| highlight = false, | ||
| ) | ||
|
|
||
| data object TranscriptionStoppedUiState : TranscriptionUiState( | ||
| text = "Stop Transcription", | ||
| icon = Icons.Default.Description, | ||
| highlight = true, | ||
| ) | ||
|
|
||
| data object TranscriptionDisabledUiState : TranscriptionUiState( | ||
| text = "Transcription not available", | ||
| icon = Icons.Default.Description, | ||
| highlight = false, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...n/kotlin/io/getstream/video/android/ui/menu/transcriptions/TranscriptionUiStateManager.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. | ||
| * | ||
| * Licensed under the Stream License; | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package io.getstream.video.android.ui.menu.transcriptions | ||
|
|
||
| import io.getstream.video.android.ui.menu.TranscriptionAvailableUiState | ||
| import io.getstream.video.android.ui.menu.TranscriptionDisabledUiState | ||
| import io.getstream.video.android.ui.menu.TranscriptionStoppedUiState | ||
| import io.getstream.video.android.ui.menu.TranscriptionUiState | ||
| import org.openapitools.client.models.CallSettingsResponse | ||
| import org.openapitools.client.models.TranscriptionSettingsResponse | ||
|
|
||
| class TranscriptionUiStateManager( | ||
| private val isTranscribing: Boolean, | ||
| private val settings: CallSettingsResponse?, | ||
| ) { | ||
|
|
||
| fun getUiState(): TranscriptionUiState { | ||
| return if (settings != null) { | ||
| val mode = settings.transcription.mode | ||
| when (mode) { | ||
| TranscriptionSettingsResponse.Mode.Available, TranscriptionSettingsResponse.Mode.AutoOn -> { | ||
| if (isTranscribing) { | ||
| TranscriptionStoppedUiState | ||
| } else { | ||
| TranscriptionAvailableUiState | ||
| } | ||
| } | ||
| else -> { | ||
| TranscriptionDisabledUiState | ||
| } | ||
| } | ||
| } else { | ||
| TranscriptionDisabledUiState | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.