WIP
This commit is contained in:
@@ -9,14 +9,14 @@ import SwiftUI
|
||||
import AVKit
|
||||
|
||||
struct ExerciseListView: View {
|
||||
@AppStorage("showNSFWVideos") private var showNSFWVideos = false
|
||||
@AppStorage("thotStyle") private var thotStyle: ThotStyle = .never
|
||||
@ObservedObject var bridgeModule = BridgeModule.shared
|
||||
var workout: Workout
|
||||
@State var avPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4")!)
|
||||
|
||||
@State var videoExercise: ExerciseExercise? {
|
||||
didSet {
|
||||
if let videoURL = self.videoExercise?.videoURL(nsfw: showNSFWVideos) {
|
||||
if let videoURL = self.videoExercise?.videoURL(thotStyle: thotStyle) {
|
||||
avPlayer = AVPlayer(url: videoURL)
|
||||
avPlayer.play()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user