From 2e7b2cf14575e91b157900ae524f385f86318696 Mon Sep 17 00:00:00 2001 From: Trey t Date: Mon, 26 Jun 2023 18:44:32 -0500 Subject: [PATCH] WIP --- .../treyt.xcuserdatad/xcschemes/xcschememanagement.plist | 4 ++-- Werkout_ios/Network/Network.swift | 7 ++++++- .../Views/CreateWorkout/CreateExerciseActionsView.swift | 3 +++ Werkout_ios/Views/ExternalWorkoutDetailView.swift | 7 +++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Werkout_ios.xcodeproj/xcuserdata/treyt.xcuserdatad/xcschemes/xcschememanagement.plist b/Werkout_ios.xcodeproj/xcuserdata/treyt.xcuserdatad/xcschemes/xcschememanagement.plist index 2076216..e5584d3 100644 --- a/Werkout_ios.xcodeproj/xcuserdata/treyt.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Werkout_ios.xcodeproj/xcuserdata/treyt.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ Werkout_ios.xcscheme_^#shared#^_ orderHint - 0 + 1 Werkout_watch Watch App.xcscheme_^#shared#^_ orderHint - 1 + 0 diff --git a/Werkout_ios/Network/Network.swift b/Werkout_ios/Network/Network.swift index 0a85554..f0f8ae2 100644 --- a/Werkout_ios/Network/Network.swift +++ b/Werkout_ios/Network/Network.swift @@ -7,6 +7,11 @@ import Foundation +enum BaseURLs: String { + case local = "http://127.0.0.1:8000/" + case dev = "https://dev.werkout.fitness" +} + enum FetchableError: Error { case apiError(Error) case noData @@ -32,7 +37,7 @@ protocol Postable: Fetchable { extension Fetchable { var baseURL: String { - "http://127.0.0.1:8000/" + BaseURLs.local.rawValue } var attachToken: Bool { diff --git a/Werkout_ios/Views/CreateWorkout/CreateExerciseActionsView.swift b/Werkout_ios/Views/CreateWorkout/CreateExerciseActionsView.swift index a1025be..3871e2c 100644 --- a/Werkout_ios/Views/CreateWorkout/CreateExerciseActionsView.swift +++ b/Werkout_ios/Views/CreateWorkout/CreateExerciseActionsView.swift @@ -68,6 +68,7 @@ struct CreateExerciseActionsView: View { .foregroundColor(.white) .background(.blue) .cornerRadius(10) + .buttonStyle(BorderlessButtonStyle()) Spacer() @@ -85,6 +86,8 @@ struct CreateExerciseActionsView: View { .foregroundColor(.white) .background(.red) .cornerRadius(10) + .buttonStyle(BorderlessButtonStyle()) + Spacer() } diff --git a/Werkout_ios/Views/ExternalWorkoutDetailView.swift b/Werkout_ios/Views/ExternalWorkoutDetailView.swift index 7b6274e..49c5358 100644 --- a/Werkout_ios/Views/ExternalWorkoutDetailView.swift +++ b/Werkout_ios/Views/ExternalWorkoutDetailView.swift @@ -130,9 +130,12 @@ struct VideoPlayerView: View { var body: some View { VideoPlayer(player: player) .onAppear{ - player = AVPlayer(url: Bundle.main.url(forResource: "Straight_Leg_Sit_Up", withExtension: "mp4")!) + let url = URL(string: BaseURLs.dev.rawValue + currentExercise.videoURL)! + player = AVPlayer(url: url) + } + .onAppear{ player.play() - + NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: nil, queue: .main) { _ in player.seek(to: .zero) player.play()