This message was deleted.
# helpdesk
s
This message was deleted.
🙏 1
b
Code that enables screen share:
Copy code
void _activateScreenShareDesktop(BuildContext context) async {
    try {
      if (participant == null) return;

      <http://_log.info|_log.info>('_activateScreenShareDesktop()');
      DesktopCapturerSource? source = await showDialog<DesktopCapturerSource>(
        context: context,
        builder: (context) => ScreenSelectDialog(),
      );
      if (source == null) {
        _log.warning('_enableScreenShare(): cancelled screenshare. No Source selected.');
      } else {
        <http://_log.info|_log.info>('_enableScreenShare(): DesktopCapturerSource: ${source.id}');
        var options = room.roomOptions.defaultScreenShareCaptureOptions.copyWith(
          sourceId: source.id,
        );
        var track = await LocalVideoTrack.createScreenShareTrack(options);

        await participant!.publishVideoTrack(track);
      }
    } catch (e) {
      _log.severe('_activateScreenShareDesktop(): ${e.toString}', e);
      rethrow;
    }
  }
In the two images you see the actual full window and then what's visible in-app in the screen share.
a
cc @freezing-lifeguard-43174
d
@boundless-salesclerk-13461 Do you think the issue is on the capturing side or could it be rendering? I wonder if it's doing an aspect-fill instead of aspect-fit. (which still could be an SDK bug). are you able to see what it shows with the JS sample?
b
@dry-elephant-14928 am investigating and comparing with example app
Found the setting that effects this in participant.dart:145 (in _ParticipantWidgetState)
Copy code
VideoTrackRenderer(
   activeVideoTrack!,
   fit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
)
RTCVideoViewObjectFitContain
vs.
RTCVideoViewObjectFitCover
Thus its a non-issue 🙏
Also, for anyone who comes across this, consider:
Copy code
fit: widget.isScreenShare
   ? RTCVideoViewObjectFit.RTCVideoViewObjectFitContain
   : RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
d
thanks for confirming TPF! I think we should really just make this the default here! If the user isn't setting anything, we shouldn't crop screenshare
Oh I see, the default is contain.. so cover is effectively an override then.