show next up video

This commit is contained in:
Trey t
2024-06-13 19:07:33 -05:00
parent 619cee69f2
commit 460bd16347
5 changed files with 43 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ struct AccountView: View {
@State var showCompletedWorkouts: Bool = false
@AppStorage(Constants.phoneThotStyle) private var phoneThotStyle: ThotStyle = .never
@AppStorage(Constants.extThotStyle) private var extThotStyle: ThotStyle = .never
@AppStorage(Constants.extShowBothVideos) private var extShowBothVideos: Bool = false
@AppStorage(Constants.extShowNextVideo) private var extShowNextVideo: Bool = false
@AppStorage(Constants.thotGenderOption) private var thotGenderOption: String = "female"
var body: some View {
@@ -105,8 +105,8 @@ struct AccountView: View {
Group {
Divider()
Toggle(isOn: $extShowBothVideos, label: {
Text("Show both videos on external")
Toggle(isOn: $extShowNextVideo, label: {
Text("Show next up video")
})
}

View File

@@ -13,7 +13,7 @@ struct ExternalWorkoutDetailView: View {
@State var avPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4")!)
@State var smallAVPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4")!)
@AppStorage(Constants.extThotStyle) private var extThotStyle: ThotStyle = .never
@AppStorage(Constants.extShowBothVideos) private var extShowBothVideos: Bool = false
@AppStorage(Constants.extShowNextVideo) private var extShowNextVideo: Bool = false
@AppStorage(Constants.thotGenderOption) private var thotGenderOption: String = "female"
var body: some View {
@@ -47,7 +47,7 @@ struct ExternalWorkoutDetailView: View {
}
HStack {
if extShowBothVideos && extThotStyle != .off {
if extShowNextVideo && extThotStyle != .off {
ExtCountdownView()
.frame(width: metrics.size.width * 0.8, height: metrics.size.height * 0.2)
.padding(.leading, 50)
@@ -85,7 +85,7 @@ struct ExternalWorkoutDetailView: View {
avPlayer = AVPlayer(url: videoURL)
avPlayer.play()
if extShowBothVideos {
if extShowNextVideo {
if let smallVideoURL = VideoURLCreator.videoURL(
thotStyle: VideoURLCreator.otherVideoType(forVideoURL: videoURL),
gender: thotGenderOption,
@@ -110,12 +110,12 @@ struct ExternalWorkoutDetailView: View {
avPlayer = AVPlayer(url: videoURL)
avPlayer.play()
if extShowBothVideos {
if extShowNextVideo {
if let smallVideoURL = VideoURLCreator.videoURL(
thotStyle: VideoURLCreator.otherVideoType(forVideoURL: videoURL),
thotStyle: .never,
gender: thotGenderOption,
defaultVideoURLStr: currentExtercise.exercise.videoURL,
exerciseName: currentExtercise.exercise.name,
defaultVideoURLStr: BridgeModule.shared.currentExerciseInfo.nextExerciseInfo?.exercise.videoURL,
exerciseName: BridgeModule.shared.currentExerciseInfo.nextExerciseInfo?.exercise.name,
workout: bridgeModule.currentExerciseInfo.workout) {
smallAVPlayer = AVPlayer(url: smallVideoURL)
smallAVPlayer.play()