-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
3,190 additions
and
1,082 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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 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 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 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 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 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 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
70 changes: 70 additions & 0 deletions
70
...rus/docs/Android/04-ui-components/05-participants/04-participants-spotlight.mdx
This file contains 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,70 @@ | ||
# ParticipantsSpotlight | ||
|
||
The `ParticipantsSpotlight` is a Composable component that allows you to highlight one participant and this one participant takes much of the screen, while the rest are rendered | ||
either as a horizontal or vertical list depending on orientation. | ||
|
||
Let's see how to use the `ParticipantsSpotlight`. | ||
|
||
## Usage | ||
|
||
To use the `ParticipantsSpotlight` component in your app you can use it direcyly as a component or you can configure the [ParticipantsLayout](02-participants-grid.mdx) to display the spotlight. | ||
|
||
### Use it directly | ||
```kotlin | ||
ParticipantsSpotlight(call = call) | ||
``` | ||
The only mandatory parameter is `call` which represents the call for which the participants are being displayed. | ||
|
||
### Use it via [ParticipantsLayout](02-participants-grid.mdx) | ||
|
||
If you are using the `ParticipantsLayout` you can use an enum value `LayoutType` with one of three options. | ||
|
||
Those are: | ||
```kotlin | ||
//Automatically choose between Grid and Spotlight based on pinned participants and dominant speaker. | ||
DYNAMIC | ||
|
||
//Force a spotlight view, showing the dominant speaker or the first speaker in the list. | ||
SPOTLIGHT | ||
|
||
//Always show a grid layout, regardless of pinned participants. | ||
GRID | ||
``` | ||
|
||
Here is how it looks in action: | ||
```kotlin | ||
ParticipantsLayout( | ||
layoutType = LayoutType.SPOTLIGHT, | ||
call = call | ||
) | ||
``` | ||
|
||
The [ParticipantsLayout](02-participants-grid.mdx) internally displays the `ParticipantSpotlight` in two cases. | ||
1. You have set the `layoutType` to `LayoutType.SPOTLIGHT` in which case a participant is always spotlighted. The participant shown in the spotlight is chosen based on the following order: | ||
1. is pinned | ||
2. is dominantSpeaker | ||
3. is first in the participants list | ||
2. You have set the `LayoutType` to `LayoutType.DYNAMIC` in which case if there is a "pinned" participant, the spotlight view will be chosen in favor of grid. | ||
|
||
*Note*: `ParticipantLayout` will always prioritize screensharing regardless of the `LayoutType` if there is a [screensharing session](../04-call/05-screen-share-content.mdx).s | ||
|
||
|
||
Using this component, you'll likely see something similar to the following UI: | ||
|
||
![Spotlight portrait](../../assets/spotlight_portrait.png) | ||
|
||
![Spotlight landscape](../../assets/spotlight_landscape.png) | ||
|
||
|
||
Let's see how to customize this component. | ||
|
||
## Customization | ||
|
||
This is a very simple component so it doesn't have replaceable slots, but it still offers ways to customize its appearance. | ||
|
||
- `modifier`: Modifier for styling. | ||
- `isZoomable`: Decide if this spotlight video renderer is zoomable or not. | ||
- `style`: Defined properties for styling a single video call track. | ||
- `videoRenderer`: A single video renderer renders each individual participant. | ||
|
||
If you're looking for guides on how to override and customize this UI, we have various [UI Cookbook](../../05-ui-cookbook/01-overview.mdx) recipes for you and we cover a portion of customization within the [Video Android SDK Tutorial](../../02-tutorials/01-video-calling.mdx). |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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 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
54 changes: 54 additions & 0 deletions
54
dogfooding/src/main/kotlin/io/getstream/video/android/data/dto/GetGoogleAccountsDto.kt
This file contains 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,54 @@ | ||
/* | ||
* Copyright (c) 2014-2023 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.data.dto | ||
|
||
import io.getstream.video.android.models.GoogleAccount | ||
import io.getstream.video.android.util.UserIdHelper | ||
import java.util.Locale | ||
|
||
data class GetGoogleAccountsResponseDto( | ||
val people: List<GoogleAccountDto>, | ||
) | ||
|
||
data class GoogleAccountDto( | ||
val photos: List<PhotoDto>?, | ||
val emailAddresses: List<EmailAddressDto>, | ||
) | ||
|
||
data class PhotoDto( | ||
val url: String, | ||
) | ||
|
||
data class EmailAddressDto( | ||
val value: String, | ||
) | ||
|
||
fun GoogleAccountDto.asDomainModel(): GoogleAccount { | ||
val email = emailAddresses.firstOrNull()?.value | ||
|
||
return GoogleAccount( | ||
email = email, | ||
id = email?.let { UserIdHelper.getUserIdFromEmail(it) }, | ||
name = email | ||
?.split("@") | ||
?.firstOrNull() | ||
?.split(".") | ||
?.firstOrNull() | ||
?.capitalize(Locale.ROOT) ?: email, | ||
photoUrl = photos?.firstOrNull()?.url, | ||
) | ||
} |
Oops, something went wrong.