Skip to content

Commit 9f00bf8

Browse files
authored
fix: more robust mirror rendering detection (#624)
use settings (see also flutter-webrtc/flutter-webrtc#1695) to detect front/back facing camera
1 parent 3a9540a commit 9f00bf8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/widgets/video_track_renderer.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ class _VideoTrackRendererState extends State<VideoTrackRenderer> {
212212
if (widget.mirrorMode == VideoViewMirrorMode.auto) {
213213
final track = widget.track;
214214
if (track is LocalVideoTrack) {
215+
final settings = track.mediaStreamTrack.getSettings();
216+
final facingMode = settings['facingMode'];
217+
if (facingMode != null) {
218+
return facingMode == 'user';
219+
}
215220
final options = track.currentOptions;
216221
if (options is CameraCaptureOptions) {
217222
// mirror if front camera

0 commit comments

Comments
 (0)