WIP
This commit is contained in:
@@ -19,8 +19,11 @@ struct ExternalWorkoutDetailView: View {
|
||||
GeometryReader { metrics in
|
||||
VStack {
|
||||
HStack {
|
||||
VideoPlayerView(avPlayer: $avPlayer, showDoneButton: false)
|
||||
PlayerView(player: $avPlayer)
|
||||
.frame(width: metrics.size.width * 0.6, height: metrics.size.height * 0.8)
|
||||
.onAppear{
|
||||
avPlayer.play()
|
||||
}
|
||||
|
||||
ExtExerciseList(workout: workout,
|
||||
currentExerciseIdx: bridgeModule.currentExerciseIdx)
|
||||
@@ -39,17 +42,22 @@ struct ExternalWorkoutDetailView: View {
|
||||
}
|
||||
}
|
||||
.onChange(of: bridgeModule.currentExercise, perform: { newValue in
|
||||
var _url: URL?
|
||||
if showNSFWVideos {
|
||||
if let viddd = newValue?.exercise.nsfwVideoURL,
|
||||
let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
avPlayer = AVPlayer(url: url)
|
||||
_url = url
|
||||
}
|
||||
} else {
|
||||
if let viddd = newValue?.exercise.videoURL,
|
||||
let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
avPlayer = AVPlayer(url: url)
|
||||
_url = url
|
||||
}
|
||||
}
|
||||
if let __url = _url {
|
||||
avPlayer = AVPlayer(url: __url)
|
||||
avPlayer.play()
|
||||
}
|
||||
})
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(.background)
|
||||
|
||||
Reference in New Issue
Block a user