XCDYouTubeKit
XCDYouTubeKit copied to clipboard
XCDYouTubeVideo should always be returned if possible
Even in case of an error, the XCDYouTubeVideo should always be returned, as it contains the
thumbnail and title, which can be used by the UI to display
pls marge https://github.com/0xced/XCDYouTubeKit/pull/201
@peterpaulis I believe that could create some confusion. For example, if you try to fetch a private video or a video that was deleted then how would you get the thumbnail and the title?
Below is an example of the how a XCDYouTubeVideo
would be initialized with a private video. Note the NSDictionary
keys and values.
Instead, what I believe should happen is that in the event that it fetches a video in which it cannot get any additional streams then it should return the aforementioned values (if they exists) in the userInfo
of the NSError
object.
in the change i propose the error video is returned within the userInfo of the error... so it would not conflict anything or existing versions...
@peterpaulis That's a good idea. However, have come across a video that had no streams but still had the title and thumbnail values? I've been looking at the various unit tests and I haven't been able to produce something similar to that behavior.
I understand that this could be a good fallback option I just haven't come across a video in which that would work. i.e. (Not have a nil
XCDYouTubeVideo
)
Yes, this can happen fairly often, like with the Vevo content
@peterpaulis I will admit I haven't tested that 🙂