ios full screen
This commit is contained in:
@@ -9,6 +9,29 @@ struct FullscreenPlayerView: View {
|
||||
@State private var explanationSentence: SentenceBoundary?
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { proxy in
|
||||
let fakeLandscape = proxy.size.height > proxy.size.width
|
||||
playerChrome
|
||||
.frame(
|
||||
width: fakeLandscape ? proxy.size.height : proxy.size.width,
|
||||
height: fakeLandscape ? proxy.size.width : proxy.size.height
|
||||
)
|
||||
.rotationEffect(.degrees(fakeLandscape ? -90 : 0))
|
||||
.frame(width: proxy.size.width, height: proxy.size.height)
|
||||
}
|
||||
.background(Color.black)
|
||||
.ignoresSafeArea()
|
||||
.statusBarHidden(true)
|
||||
.sheet(item: $explanationSentence) { sentence in
|
||||
SentenceExplanationSheet(
|
||||
mediaId: controller.currentItem?.id ?? "",
|
||||
courseTitle: controller.currentItem?.title ?? "口语训练课程",
|
||||
sentence: sentence
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private var playerChrome: some View {
|
||||
ZStack {
|
||||
Color.black.ignoresSafeArea()
|
||||
PlayerSurfaceView(controller: controller) { isSwipeUp in
|
||||
@@ -95,13 +118,6 @@ struct FullscreenPlayerView: View {
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
.sheet(item: $explanationSentence) { sentence in
|
||||
SentenceExplanationSheet(
|
||||
mediaId: controller.currentItem?.id ?? "",
|
||||
courseTitle: controller.currentItem?.title ?? "口语训练课程",
|
||||
sentence: sentence
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@State private var progressDragging = false
|
||||
|
||||
Reference in New Issue
Block a user