This commit is contained in:
Trey t
2023-07-13 22:39:44 -05:00
parent 59dc0bbc4c
commit 93b8d674b4
13 changed files with 205 additions and 103 deletions

View File

@@ -14,7 +14,7 @@ struct WorkoutDetailView: View {
@StateObject var bridgeModule = BridgeModule.shared
@Environment(\.dismiss) var dismiss
@AppStorage("showNSFWVideos") private var showNSFWVideos = false
@AppStorage("thotStyle") private var thotStyle: ThotStyle = .never
enum Sheet: Identifiable {
case completedWorkout([String: Any])
@@ -80,13 +80,13 @@ struct WorkoutDetailView: View {
}
}
.onChange(of: bridgeModule.currentExercise, perform: { newValue in
if let videoURL = newValue?.videoURL(nsfw: showNSFWVideos) {
if let videoURL = newValue?.videoURL(thotStyle: thotStyle) {
avPlayer = AVPlayer(url: videoURL)
avPlayer.play()
}
})
.onAppear{
if let videoURL = bridgeModule.currentExercise?.videoURL(nsfw: showNSFWVideos) {
if let videoURL = bridgeModule.currentExercise?.videoURL(thotStyle: thotStyle) {
avPlayer = AVPlayer(url: videoURL)
avPlayer.play()
}