Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK update and bugfixes #211

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand All @@ -39,7 +51,9 @@ struct StatsInfoView: View {
var body: some View {
ScrollView {
VStack {
pullDownIndicatorView
if deviceOrientation.isPortrait {
pullDownIndicatorView
}

titleView

Expand All @@ -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())
Expand All @@ -66,6 +85,11 @@ struct StatsInfoView: View {
Image(systemName: "doc.on.doc")
}
}
.onRotate { newOrientation in
if !newOrientation.isFlat && newOrientation.isValidInterfaceOrientation {
deviceOrientation = newOrientation
}
}
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down
Loading