Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions commet/lib/client/components/voip/voip_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ enum VoipState {

abstract class ScreenCaptureSource {}

class WebrtcBrowserScreenCaptureSource implements ScreenCaptureSource {}

abstract class VoipSession {
Client get client;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ class MatrixLivekitVoipSession implements VoipSession {
return;
}

final src = (source as WebrtcScreencaptureSource).source;
final srcid = source is WebrtcBrowserScreenCaptureSource
? ''
: (source as WebrtcScreencaptureSource).source.id;

var bitrate = (preferences.streamBitrate.value * 1_000_000).toInt();
var framerate = preferences.streamFramerate.value;
Expand All @@ -273,7 +275,7 @@ class MatrixLivekitVoipSession implements VoipSession {

var track = await lk.LocalVideoTrack.createScreenShareTrack(
lk.ScreenShareCaptureOptions(
sourceId: src.id,
sourceId: srcid,
maxFrameRate: framerate,
params: lk.VideoParameters(
dimensions: lk.VideoDimensionsPresets.h720_169,
Expand Down Expand Up @@ -348,6 +350,9 @@ class MatrixLivekitVoipSession implements VoipSession {
if (PlatformUtils.isAndroid) {
return WebrtcAndroidScreencaptureSource.getCaptureSource(context);
}
if (PlatformUtils.isWeb) {
return WebrtcBrowserScreenCaptureSource();
}
return WebrtcScreencaptureSource.showSelectSourcePrompt(context);
}

Expand Down
Loading