mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 16:42:01 +00:00
added close button
This commit is contained in:
parent
5ccbbf1c1b
commit
71d243dba5
5 changed files with 187 additions and 170 deletions
Binary file not shown.
|
|
@ -5,6 +5,7 @@
|
|||
// Created by Pratik on 08/01/23.
|
||||
//
|
||||
// Thanks to pratikg29 for this code inside his open source project "https://github.com/pratikg29/Custom-Slider-Control?ref=iosexample.com"
|
||||
// I did edit just a little bit the code for my liking
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ struct CustomMediaPlayer: View {
|
|||
@State private var duration: Double = 0.0
|
||||
@State private var showControls = false
|
||||
@State private var inactivityTimer: Timer?
|
||||
@Environment(\.presentationMode) var presentationMode
|
||||
|
||||
init(urlString: String) {
|
||||
guard let url = URL(string: urlString) else {
|
||||
|
|
@ -50,6 +51,7 @@ struct CustomMediaPlayer: View {
|
|||
}
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
VStack {
|
||||
ZStack {
|
||||
CustomVideoPlayer(player: player)
|
||||
|
|
@ -223,6 +225,23 @@ struct CustomMediaPlayer: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
VStack {
|
||||
if showControls {
|
||||
HStack {
|
||||
Button(action: {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}) {
|
||||
Image(systemName: "xmark")
|
||||
.foregroundColor(.white)
|
||||
.font(.system(size: 20))
|
||||
}
|
||||
.padding()
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func startUpdatingCurrentTime() {
|
||||
|
|
|
|||
|
|
@ -35,12 +35,9 @@ struct SettingsView: View {
|
|||
Text("Minor Interface Settings")
|
||||
}
|
||||
NavigationLink(destination: SettingsPlayerView()) {
|
||||
HStack {
|
||||
Image(systemName: "play.fill")
|
||||
Text("Player")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Section(header: Text("External Features")) {
|
||||
NavigationLink(destination: SettingsModuleView()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue