-
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
34 changed files
with
1,000 additions
and
314 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Screenshots | ||
description: How to take screenshots of VideoFrames | ||
--- | ||
|
||
## Screenshots | ||
|
||
You can take a picture of a `VideoTrack` at highest possible resolution by using `Call.takeScreenshot(videoTrack): Bitmap`. This can be useful for example if you want to take a screenshot of a screenshare at full resolution. | ||
|
||
You need to get the right `VideoTrack` to take the screenshot first - the selection depends on your use case. Let's for example take the first participant in the list of participants in a Call: | ||
|
||
```kotlin | ||
val participant = call.state.participants.value[0] | ||
val participantVideoTrack = participant.videoTrack.value | ||
if (participantVideoTrack != null) { | ||
val bitmap = call.takeScreenshot(participantVideoTrack) | ||
// display, save or share the bitmap | ||
} | ||
``` | ||
|
||
:::note | ||
A `VideoTrack` can be null when the current participant video is not visible on the screen. Video is only streamed from participants that are currently visible. | ||
::: | ||
|
||
Or for example if you specifically want to take a screenshot of a screenshare session: | ||
|
||
```kotlin | ||
val screenshareSession = call.state.screenSharingSession.value | ||
val screenShareTrack = screenshareSession?.participant?.screenSharingTrack?.value | ||
if (screenShareTrack != null) { | ||
val bitmap = call.takeScreenshot(screenShareTrack) | ||
// display, save or share the bitmap | ||
} | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.