WIP
This commit is contained in:
@@ -10,22 +10,22 @@ import AVKit
|
||||
|
||||
struct ExternalWorkoutDetailView: View {
|
||||
@StateObject var bridgeModule = BridgeModule.shared
|
||||
|
||||
let videoPlayer = VideoPlayerView(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/Isometric_Bear_Crawl_with_Shoulder_Taps.mp4")!)
|
||||
var body: some View {
|
||||
ZStack {
|
||||
if let workout = bridgeModule.currentWorkout {
|
||||
GeometryReader { metrics in
|
||||
VStack {
|
||||
HStack {
|
||||
if let currentExercise = bridgeModule.currentExercise,
|
||||
let url = URL(string: BaseURLs.dev.rawValue + currentExercise.exercise.videoURL) {
|
||||
VideoPlayerView(url: url)
|
||||
if let currentExercise = bridgeModule.currentExercise {
|
||||
videoPlayer
|
||||
.frame(width: metrics.size.width * 0.6, height: metrics.size.height * 0.8)
|
||||
}
|
||||
|
||||
ExtExerciseList(workout: workout,
|
||||
currentExerciseIdx: bridgeModule.currentExerciseIdx)
|
||||
.frame(width: metrics.size.width * 0.4, height: metrics.size.height * 0.8)
|
||||
|
||||
}
|
||||
|
||||
ExtCountdownView()
|
||||
@@ -38,6 +38,12 @@ struct ExternalWorkoutDetailView: View {
|
||||
Text("nothing here bro")
|
||||
}
|
||||
}
|
||||
.onChange(of: bridgeModule.currentExercise, perform: { newValue in
|
||||
if let newValue = newValue,
|
||||
let _videoURL = URL(string: BaseURLs.dev.rawValue + newValue.exercise.videoURL) {
|
||||
videoPlayer.updateVideoURL(url: _videoURL)
|
||||
}
|
||||
})
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(.background)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user