diff --git a/interactive-player/Interactive Viewer/Views/ListView/ListView.swift b/interactive-player/Interactive Viewer/Views/ListView/ListView.swift index 7fd27b0a..5a9bda7c 100644 --- a/interactive-player/Interactive Viewer/Views/ListView/ListView.swift +++ b/interactive-player/Interactive Viewer/Views/ListView/ListView.swift @@ -56,7 +56,7 @@ struct ListView: View { let selectedVideoSource = viewModel.selectedVideoSource let tileWidth = deviceOrientation.isPortrait ? screenSize.width - Constants.tileSpacing : screenSize.width * 0.75 - Constants.tileSpacing let displayLabel = selectedVideoSource.sourceId.displayLabel - let preferredVideoQuality: VideoQuality = selectedVideoSource == viewModel.selectedVideoSource ? .auto : .low + let preferredVideoQuality: VideoQuality = viewModel.mainTilePreferredVideoQuality let isSelectedVideoSource = true let isSelectedAudioSource = selectedVideoSource == viewModel.selectedAudioSource let viewId = deviceOrientation.isPortrait ? "\(ListView.self).Primary.Portrait.\(displayLabel)" : "\(ListView.self).Primary.Landscape.\(displayLabel)" diff --git a/interactive-player/Interactive Viewer/Views/StatsInfo/StatsInfoView.swift b/interactive-player/Interactive Viewer/Views/StatsInfo/StatsInfoView.swift index 9edbf44e..2795d339 100644 --- a/interactive-player/Interactive Viewer/Views/StatsInfo/StatsInfoView.swift +++ b/interactive-player/Interactive Viewer/Views/StatsInfo/StatsInfoView.swift @@ -15,6 +15,9 @@ struct StatsInfoView: View { private let fontTableValue = Font.custom("AvenirNext-DemiBold", size: FontSize.body) private let fontTitle = Font.custom("AvenirNext-Bold", size: FontSize.title2) + @Environment(\.presentationMode) private var presentationMode + @State private var deviceOrientation: UIDeviceOrientation = UIDeviceOrientation.portrait + init(statsInfoViewModel: StatsInfoViewModel) { self.viewModel = statsInfoViewModel } @@ -30,6 +33,15 @@ struct StatsInfoView: View { .padding([.top], Layout.spacing0_5x) } + private var closeButton: some View { + IconButton(iconAsset: .close) { + presentationMode.wrappedValue.dismiss() + } + .background(Color(uiColor: theme.neutral400)) + .clipShape(Circle().inset(by: Layout.spacing0_5x)) + .padding(.top) + } + private var titleView: some View { Text("stream.media-stats.label", font: fontTitle) .frame(maxWidth: .infinity, alignment: .center) @@ -39,7 +51,9 @@ struct StatsInfoView: View { var body: some View { ScrollView { VStack { - pullDownIndicatorView + if deviceOrientation.isPortrait { + pullDownIndicatorView + } titleView @@ -58,6 +72,11 @@ struct StatsInfoView: View { .padding([.leading, .trailing], Layout.spacing2x) .padding(.bottom, Layout.spacing3x) } + .overlay(alignment: .topTrailing, content: { + if deviceOrientation.isLandscape { + closeButton + } + }) .contextMenu { Button(action: { copyToPasteboard(text: formattedStatisticsText()) @@ -66,6 +85,11 @@ struct StatsInfoView: View { Image(systemName: "doc.on.doc") } } + .onRotate { newOrientation in + if !newOrientation.isFlat && newOrientation.isValidInterfaceOrientation { + deviceOrientation = newOrientation + } + } } @ViewBuilder diff --git a/interactive-player/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/interactive-player/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3cbe83d7..da5410c9 100644 --- a/interactive-player/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/interactive-player/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/millicast/millicast-sdk-swift-package", "state" : { - "revision" : "d20cb45ff24acbc16191d4df6a0e4be9daa26e24", - "version" : "2.0.0-beta.7" + "revision" : "a36748fd8b8d8fe8d94608f42972e5002d2dd9f5", + "version" : "2.0.0" } } ], diff --git a/rts-viewer-tvos/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/rts-viewer-tvos/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c9be3839..da5410c9 100644 --- a/rts-viewer-tvos/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/rts-viewer-tvos/RTSViewer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/millicast/millicast-sdk-swift-package", "state" : { - "revision" : "320331b070210fd41818e2e9459c2631991b6c16", - "version" : "2.0.0-beta.5" + "revision" : "a36748fd8b8d8fe8d94608f42972e5002d2dd9f5", + "version" : "2.0.0" } } ],