Skip to content

Commit

Permalink
mirror only camera source
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Feb 12, 2022
1 parent ea3cdd9 commit 319f328
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Shared/ParticipantView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ struct ParticipantView: View {
let track = publication.track as? VideoTrack,
appCtx.videoViewVisible {
ZStack(alignment: .topLeading) {
let mirrored = track is LocalVideoTrack ? !appCtx.videoViewMirrored : appCtx.videoViewMirrored
let shouldMirror = track is LocalVideoTrack && track.source == .camera
SwiftUIVideoView(track,
mode: videoViewMode,
mirrored: mirrored,
mirrored: appCtx.videoViewMirrored ? !shouldMirror : shouldMirror,
dimensions: $dimensions,
preferMetal: appCtx.preferMetal)
.background(Color.black)
Expand All @@ -55,7 +55,7 @@ struct ParticipantView: View {
.padding(3)
.background(Color.black)
.cornerRadius(8)
Text("Mirrored: \(String(describing: mirrored))")
Text("Mirrored: \(String(describing: shouldMirror))")
.foregroundColor(Color.white)
.padding(3)
.background(Color.black)
Expand Down Expand Up @@ -84,10 +84,10 @@ struct ParticipantView: View {
VStack(alignment: .trailing, spacing: 0) {
// Show the sub-video view
if let subVideoTrack = participant.subVideoTrack {
let mirrored = subVideoTrack is LocalVideoTrack ? !appCtx.videoViewMirrored : appCtx.videoViewMirrored
let shouldMirror = subVideoTrack is LocalVideoTrack && subVideoTrack.source == .camera
SwiftUIVideoView(subVideoTrack,
mode: .fill,
mirrored: mirrored,
mirrored: appCtx.videoViewMirrored ? !shouldMirror : shouldMirror,
preferMetal: appCtx.preferMetal
)
.background(Color.black)
Expand Down
2 changes: 1 addition & 1 deletion Shared/RoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ struct RoomView: View {

Toggle("VideoView visible", isOn: $appCtx.videoViewVisible)
Toggle("VideoView preferMetal", isOn: $appCtx.preferMetal)
Toggle("VideoView mirrored", isOn: $appCtx.videoViewMirrored)
Toggle("VideoView flip", isOn: $appCtx.videoViewMirrored)

Divider()

Expand Down

0 comments on commit 319f328

Please sign in to comment.