react-native-video/ios/Video/DataStructures/Chapter.swift

25 lines
620 B
Swift
Raw Normal View History

struct Chapter {
let title: String
2023-08-13 16:16:41 -06:00
let uri: String?
let startTime: Double
let endTime: Double
let json: NSDictionary?
init(_ json: NSDictionary!) {
guard json != nil else {
self.json = nil
self.title = ""
2023-08-13 16:16:41 -06:00
self.uri = nil
self.startTime = 0
self.endTime = 0
return
}
self.json = json
self.title = json["title"] as? String ?? ""
2023-08-13 16:16:41 -06:00
self.uri = json["uri"] as? String
self.startTime = json["startTime"] as? Double ?? 0
self.endTime = json["endTime"] as? Double ?? 0
}
}