Skip to content

Commit

Permalink
Merge pull request #211 from dolbyio-samples/bugfix/preferred-video-q…
Browse files Browse the repository at this point in the history
…uality-on-primary-tile

SDK update and bugfixes
  • Loading branch information
aravind-raveendran authored Aug 22, 2024
2 parents 6e89487 + fab7018 commit 71a3a9e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
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

0 comments on commit 71a3a9e

Please sign in to comment.