mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-05-25 15:51:33 +00:00
Merge pull request #56 from isair/fix/playable-duration-edge-cases
Fix 'Invalid number value (NaN) in JSON write' crash
This commit is contained in:
+5
-2
@@ -96,9 +96,12 @@ static NSString *const statusKeyPath = @"status";
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
return [NSNumber numberWithFloat:CMTimeGetSeconds(CMTimeRangeGetEnd(effectiveTimeRange))];
|
||||
Float64 playableDuration = CMTimeGetSeconds(CMTimeRangeGetEnd(effectiveTimeRange));
|
||||
if (playableDuration > 0) {
|
||||
return [NSNumber numberWithFloat:playableDuration];
|
||||
}
|
||||
}
|
||||
return [NSNumber numberWithFloat:CMTimeGetSeconds(kCMTimeInvalid)];
|
||||
return [NSNumber numberWithInteger:0];
|
||||
}
|
||||
|
||||
- (void)stopProgressTimer
|
||||
|
||||
Reference in New Issue
Block a user