0xced / XCDYouTubeKit

YouTube video player for iOS, tvOS and macOS
MIT License
2.92k stars 626 forks source link

should have default lastError in XCDYouTubeVideoOperation #484

Closed Beny2305 closed 3 years ago

Beny2305 commented 4 years ago

[XCDYouTubeKit] Video operation finished with error: (null) Domain: (null) Code: 0 User Info: (null) [7769:55767764] Assertion failure in -[XCDYouTubeClient getVideoWithIdentifier:cookies:customPatterns:completionHandler:], /Pods/XCDYouTubeKit/XCDYouTubeKit/XCDYouTubeClient.m:69 [7769:55767764] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Both video and error can not be nil if the operation was not canceled.

when all requests passed, no errors happened, Assert make app crash. I think should add a default lastError, Can make this happen? thanks

tungdangplus commented 3 years ago

I sometimes get this issue too, then I try way:

XCDYouTubeClient.default().getVideoWithIdentifier(videoTrack.Id) { (xcdVideo, xcdError) in DispatchQueue.main.async { if (xcdVideo != nil) { XCDYouTubeClient.default().queryVideo(xcdVideo!, cookies: nil) { (streamURLs: [AnyHashable: Any]?, streamError: Error?, streamErrors: [AnyHashable: Error]?) in if (streamURLs != nil) { let url1: URL? = streamURLs?[XCDYouTubeVideoQuality.HD720.rawValue] as? URL } else { print(streamError) print(streamErrors) } } else { print(xcdError!.localizedDescription) } } }

So far I don't get that crash again

fightveryexplosion commented 3 years ago

I get this same error in the latest 2.14.1. It seems to be happening randomly, but it seems to happen quite often in my case. A default error or something like it seems like a good idea! At the moment the app just crashes..

euroboy commented 3 years ago

Happens quite often to me too lately

phuocmobytelab commented 3 years ago

any fix for this issue?

fragm commented 3 years ago

This error occurs and the app crashes. VideoIdentifier = VEI4TYQp9Is

palsantosh commented 3 years ago

app crash. Any fix?? VideoIdentifier = xilDDRctnjw

SoneeJohn commented 3 years ago

app crash. Any fix?? VideoIdentifier = xilDDRctnjw

What version of the library are you using?

palsantosh commented 3 years ago

app crash. Any fix?? VideoIdentifier = xilDDRctnjw

What version of the library are you using?

I'm using version (2.14.1)

SoneeJohn commented 3 years ago

Please update to the latest version 2.15.0

palsantosh commented 3 years ago

Please update to the latest version 2.15.0

Now its working!! Now I can play video successfully. Thanks!!