Skip to content

Commit

Permalink
Add experimental preferCurrentTab screen share capture option (#1070)
Browse files Browse the repository at this point in the history
* Add experimental preferCurrentTab screen share capture option

* Create rich-worms-leave.md
  • Loading branch information
lukasIO authored Mar 13, 2024
1 parent 282eff7 commit 19396e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rich-worms-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Add experimental preferCurrentTab screen share capture option
7 changes: 7 additions & 0 deletions src/room/track/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ export interface ScreenShareCaptureOptions {
* local speakers when the tab is captured.
*/
suppressLocalAudioPlayback?: boolean;

/**
* Experimental option to instruct the browser to offer the current tab as the most prominent capture source
* @experimental
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#prefercurrenttab
*/
preferCurrentTab?: boolean;
}

export interface AudioCaptureOptions {
Expand Down
1 change: 1 addition & 0 deletions src/room/track/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export function screenCaptureToDisplayMediaStreamOptions(
selfBrowserSurface: options.selfBrowserSurface,
surfaceSwitching: options.surfaceSwitching,
systemAudio: options.systemAudio,
preferCurrentTab: options.preferCurrentTab,
};
}

Expand Down

0 comments on commit 19396e1

Please sign in to comment.