0xced / XCDYouTubeKit

YouTube video player for iOS, tvOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streamURL = nil for "LIVE NOW" videos(youtube).

devbest555 opened this issue · comments

Before 4 days, all of the videos are worked(load/play) fine
for now, common youtube videos work fine but "LIVE NOW" videos don't work anymore.
when I debug the code, streamURL = nil
who can help me? any good news?

This issue had been solved by @karimabees.

Need update lib to new requirement.
Screenshot 2021-06-23 at 13 20 00

@tkachV
Thank you for your information.
what should I change/add/update in the XCDYouTubeVideoKit?

@devbest555

Maybe it's not your case, but for me worked
XCDYouTubeVideoOperation.m, line 152 change to:

NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"c" : @"TVHTML5", @"cver" : @"6.20180913" };

added: [..., @"c" : @"TVHTML5", @"cver" : @"6.20180913"]

It's not tested for live-video.

@tkachV
I had added it in line 152 already but live-video doesn't work.
I wish you will test the live-videos(azl07ua79pa, hartiIFC1s4).
If live-videos works fine, then Perfect and please inform me it

@tkachV Thank you for your information, it works for me

@FvorY
can you show me your project or code for playing the "LIVE" video(ex : azl07ua79pa, hartiIFC1s4)?
Thank you in advance

@devbest555 it not tested for live-video, my problem is video failed to play.

@FvorY
I asked it about live-video.
any idea?

Can anyone fix this for Live video please. Thank you.

I've set up a fork with the changes, you should be able to use CocoaPods with it like this:
pod 'XCDYouTubeKit', :git => 'https://github.com/Candygoblen123/XCDYouTubeKit'

For both of Live-video and common-videos :

  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"];
    }

I added above code and then Worked fine.

not working for me

Hi, @AshokRadadiya
Please find your method and then comment here.

Hi, @AshokRadadiya
Please find your method and then comment here.

working sir, thank you!