WIP
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import Combine
|
||||
import AVKit
|
||||
|
||||
struct AddExerciseView: View {
|
||||
enum CreateWorkoutItemPickerViewType {
|
||||
@@ -25,7 +26,15 @@ struct AddExerciseView: View {
|
||||
@State var createWorkoutItemPickerViewModel: CreateWorkoutItemPickerViewModel?
|
||||
@State var createWorkoutItemPickerViewType: CreateWorkoutItemPickerViewType?
|
||||
@State var searchString: String = ""
|
||||
@State var videoExercise: ExerciseExercise?
|
||||
@State var videoExercise: ExerciseExercise? {
|
||||
didSet {
|
||||
if let viddd = self.videoExercise?.videoURL,
|
||||
let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
self.avPlayer = AVPlayer(url: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
@State var avPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4")!)
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@@ -63,9 +72,7 @@ struct AddExerciseView: View {
|
||||
filteredExercises = exercises
|
||||
}
|
||||
.sheet(item: $videoExercise) { exercise in
|
||||
if let url = URL(string: BaseURLs.dev.rawValue + exercise.videoURL) {
|
||||
VideoPlayerView(url: url)
|
||||
}
|
||||
VideoPlayerView(avPlayer: $avPlayer)
|
||||
}
|
||||
.sheet(item: $createWorkoutItemPickerViewModel) { item in
|
||||
CreateWorkoutItemPickerView(viewModel: item, completed: { selectedids in
|
||||
|
||||
Reference in New Issue
Block a user