-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: video crashes #70
Conversation
@@ -72,7 +72,11 @@ public class VideoPlayerViewModel: ObservableObject { | |||
|
|||
playerHolder.getTimePublisher() | |||
.sink {[weak self] time in | |||
self?.currentTime = time | |||
if time.isNaN { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to move that condition to PlayerHolder where publisher send time value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but what do you think about to add same check to 138 line inside addPeriodicTimeObserver
closure:
private func observe() {
....
timeObserver = player?.addPeriodicTimeObserver(forInterval: interval, queue: .main) {[weak self] time in
self?.timePublisher.send(time.seconds)
}
It's a PeriodicTimeObserver so it will only call when there is any change in the video playback and in that case the value shouldn't be nan. |
ok i just not sure that this closure will always have correct value. If you are sure then ok. |
Co-authored-by: Saeed Bashir <[email protected]>
App was crashing in two cases of videos, both the crashes can be tested on course
Project Management for Development
How it can be tested:
It can be tested on the first section,
Start here
->0.1 Welcome to the course
-> going to the videoSolution:
Mimic the behaviour from the old app.
2. When the LMS returns wrong data for transcripts, LSM is returning less time for endtime than the starttime of the transcript.
How it can be tested:
1. Go to Videos tab
2. Go to Module 1: Project Chapter
3. Go to 1.1.5 Video: Project Chapter (can be selected from the dropdown switcher)
4. Go to the video component