From d519e8944adc7a8546abb3230a340e9e2da93c90 Mon Sep 17 00:00:00 2001 From: Selvin Naz Date: Mon, 29 Mar 2021 08:56:22 -0600 Subject: [PATCH] Validations of the values to assign in the seekbar were added due to the fact that in iOS 10 there was a crash due to NaN values. --- .../Source/VersaPlayerControls/VersaPlayerControls.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VersaPlayer/Classes/Source/VersaPlayerControls/VersaPlayerControls.swift b/VersaPlayer/Classes/Source/VersaPlayerControls/VersaPlayerControls.swift index 4ce19bf..2f9d270 100755 --- a/VersaPlayer/Classes/Source/VersaPlayerControls/VersaPlayerControls.swift +++ b/VersaPlayer/Classes/Source/VersaPlayerControls/VersaPlayerControls.swift @@ -135,6 +135,10 @@ open class VersaPlayerControls: View { } public func setSeekbarSlider(start startValue: Double, end endValue: Double, at time: Double) { + let time = time.isNaN ? 0 : time + let startValue = startValue.isNaN ? 0 : startValue + let endValue = endValue.isNaN ? 0 : endValue + #if os(macOS) seekbarSlider?.minValue = startValue seekbarSlider?.maxValue = endValue