XCDYouTubeKit icon indicating copy to clipboard operation
XCDYouTubeKit copied to clipboard

(iOS) XCDYouTubeVideoErrorDomain: -2 with empty User Info for upcoming live stream

Open Kiu212 opened this issue 3 years ago • 2 comments

Hello everyone, I used XCDYouTubeKit for my project and encounter a problem for upcoming live stream video in Youtube. XCDYouTubeKit used to return the remaining time before live stream. However, it is not working now.

Here is the result in Xcode. [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.) Domain: XCDYouTubeVideoErrorDomain Code: -2 User Info: { }

May I know there is anyone encounter the same problem? Is there any idea to fix this issue? Thanks.

Kiu212 avatar Jul 16 '21 07:07 Kiu212

I followed 2 modifications from another closed issue to fix the live broadcast cannot be played problem. https://github.com/0xced/XCDYouTubeKit/issues/538

  1. XCDYouTubeVideoOperation.m self.eventLabels = [[NSMutableArray alloc] initWithArray:@[ @"embedded", @"detailpage" ]]; --->> [Edit] self.eventLabels =[[NSMutableArray alloc] init];
  2. XCDYouTubeVideo.m NSString *httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); --->> [Edit] NSString *httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); if(httpLiveStream.length == 0){ httpLiveStream = info[@"streamingData"][@"hlsManifestUrl"]; }

It seems like the first modification makes the user info become empty. After I use the old code in XCDYouTubeVideoOperation.m, it is working very well.

Kiu212 avatar Jul 19 '21 02:07 Kiu212

The method you provided is worked, thank you bro

kosswong avatar Jul 22 '21 02:07 kosswong