0xced/XCDYouTubeKit

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

Kiu212 opened this issue · 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.

I followed 2 modifications from another closed issue to fix the live broadcast cannot be played problem. #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.

The method you provided is worked, thank you bro