diff --git a/Course/Course/Presentation/Video/EncodedVideoPlayer.swift b/Course/Course/Presentation/Video/EncodedVideoPlayer.swift index 233469250..a2c40e113 100644 --- a/Course/Course/Presentation/Video/EncodedVideoPlayer.swift +++ b/Course/Course/Presentation/Video/EncodedVideoPlayer.swift @@ -91,6 +91,7 @@ public struct EncodedVideoPlayer: View { preferredTimescale: 10000 ) ) + viewModel.controller.player?.play() pauseScrolling() currentTime = (date.secondsSinceMidnight() + 1) }) @@ -108,6 +109,7 @@ public struct EncodedVideoPlayer: View { preferredTimescale: 10000 ) ) + viewModel.controller.player?.play() pauseScrolling() currentTime = (date.secondsSinceMidnight() + 1) }) diff --git a/Course/Course/Presentation/Video/YouTubeVideoPlayer.swift b/Course/Course/Presentation/Video/YouTubeVideoPlayer.swift index 9d12b3183..4380d0ef2 100644 --- a/Course/Course/Presentation/Video/YouTubeVideoPlayer.swift +++ b/Course/Course/Presentation/Video/YouTubeVideoPlayer.swift @@ -55,20 +55,24 @@ public struct YouTubeVideoPlayer: View { Spacer() } } - SubtittlesView( - languages: viewModel.languages, - currentTime: $viewModel.currentTime, - viewModel: viewModel, scrollTo: { date in - viewModel.youtubePlayer.seek(to: date.secondsSinceMidnight(), allowSeekAhead: true) - viewModel.pauseScrolling() - viewModel.currentTime = date.secondsSinceMidnight() + 1 + ZStack { + SubtittlesView( + languages: viewModel.languages, + currentTime: $viewModel.currentTime, + viewModel: viewModel, scrollTo: { date in + viewModel.youtubePlayer.seek(to: date.secondsSinceMidnight(), allowSeekAhead: true) + viewModel.youtubePlayer.play() + viewModel.pauseScrolling() + viewModel.currentTime = date.secondsSinceMidnight() + 1 + } + ) + if viewModel.isLoading { + ProgressBar(size: 40, lineWidth: 8) } - ) + } } } - if viewModel.isLoading { - ProgressBar(size: 40, lineWidth: 8) - } + } } }