fix(ios): fix startPosition, cropStart and cropEnd to handle float values correctly (#3589)

* refactor(ios): refactor setPlaybackRange function

* fix(ios): fix props to handle float values correctly

- fix startPosition, cropStart, cropEnd

* refactor(ios): apply lint
This commit is contained in:
YangJH
2024-03-22 21:43:46 +09:00
committed by GitHub
parent bfb76e6d15
commit 36bd2e2d71
2 changed files with 11 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ struct VideoSource {
let isAsset: Bool
let shouldCache: Bool
let requestHeaders: [String: Any]?
let startPosition: Int64?
let startPosition: Float64?
let cropStart: Int64?
let cropEnd: Int64?
// Custom Metadata
@@ -51,9 +51,9 @@ struct VideoSource {
} else {
self.requestHeaders = nil
}
self.startPosition = json["startPosition"] as? Int64
self.cropStart = json["cropStart"] as? Int64
self.cropEnd = json["cropEnd"] as? Int64
self.startPosition = json["startPosition"] as? Float64
self.cropStart = (json["cropStart"] as? Float64).flatMap { Int64(round($0)) }
self.cropEnd = (json["cropEnd"] as? Float64).flatMap { Int64(round($0)) }
self.title = json["title"] as? String
self.subtitle = json["subtitle"] as? String
self.description = json["description"] as? String