private func validateAsset(asset : AVURLAsset) {
var e : NSError?
asset.statusOfValueForKey("duration", error: &e)
if let error = e {
var message = "\n\n***** Jukebox fatal error*****\n\n"
if error.code == -1022 {
message += "It looks like you're using Xcode 7 and due to an App Transport Security issue (absence of SSL-based HTTP) the asset cannot be loaded from the specified URL: \"\(self.URL)\".\nTo fix this issue, append the following to your .plist file:\n\n<key>NSAppTransportSecurity</key>\n<dict>\n\t<key>NSAllowsArbitraryLoads</key>\n\t<true/>\n</dict>\n\n"
fatalError(message)
} else {
fatalError("\(message)\(error.description)\n\n")
}
}
}
Is the error is a 404 - a fatalError, which crashes a device, shouldn't be thrown. A log message would make more sense.
Is the error is a 404 - a fatalError, which crashes a device, shouldn't be thrown. A log message would make more sense.
Do you agree? If so, I'll submit a PR.