0xced / XCDYouTubeKit

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

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

Closed devbest555 closed 3 years ago

devbest555 commented 3 years ago

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.

tkachV commented 3 years ago

Need update lib to new requirement.

Screenshot 2021-06-23 at 13 20 00
devbest555 commented 3 years ago

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

tkachV commented 3 years ago

@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.

devbest555 commented 3 years ago

@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

FvorY commented 3 years ago

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

devbest555 commented 3 years ago

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

FvorY commented 3 years ago

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

devbest555 commented 3 years ago

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

tester89 commented 3 years ago

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

devbest555 commented 3 years ago

Great news, Let me follow you and test the app. After test, let me email you instantly. Thank you in advance

On Sun, Jun 27, 2021 at 6:08 PM karimabees @.***> wrote:

@devbest555 https://github.com/devbest555 @tester89 https://github.com/tester89

I just checked that it works.

XCDYouTubeVideoOperation.m > [startWatchPageRequest] function works fine. (*Looks better than using [get_video_info].)

  • Modify to force [startWatchPageRequest] to be called.

XCDYouTubeVideoOperation.m (line 442) (Temporarily delete [eventLabels] so that [startWatchPageRequest] is executed)

self.eventLabels = [[NSMutableArray alloc] initWithArray:@[ @"embedded", @"detailpage" ]]; --->> [Edit] self.eventLabels =[[NSMutableArray alloc] init];

XCDYouTubeVideo.m

NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); --->> [Edit] NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); if(httpLiveStream.length == 0){ httpLiveStream = info[@"streamingData"][@"hlsManifestUrl"]; }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/0xced/XCDYouTubeKit/issues/538#issuecomment-869178413, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDPFF7HXSVEAH7JSSUJE3DTU45FXANCNFSM47A6E34Q .

devbest555 commented 3 years ago

Hi, karimabees Many thank you. I tested the app with your code and it does work fine. Wonderful !!! Thank you again.

On Sun, Jun 27, 2021 at 8:31 PM martin benka @.***> wrote:

Great news, Let me follow you and test the app. After test, let me email you instantly. Thank you in advance

On Sun, Jun 27, 2021 at 6:08 PM karimabees @.***> wrote:

@devbest555 https://github.com/devbest555 @tester89 https://github.com/tester89

I just checked that it works.

XCDYouTubeVideoOperation.m > [startWatchPageRequest] function works fine. (*Looks better than using [get_video_info].)

  • Modify to force [startWatchPageRequest] to be called.

XCDYouTubeVideoOperation.m (line 442) (Temporarily delete [eventLabels] so that [startWatchPageRequest] is executed)

self.eventLabels = [[NSMutableArray alloc] initWithArray:@[ @"embedded", @"detailpage" ]]; --->> [Edit] self.eventLabels =[[NSMutableArray alloc] init];

XCDYouTubeVideo.m

NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); --->> [Edit] NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); if(httpLiveStream.length == 0){ httpLiveStream = info[@"streamingData"][@"hlsManifestUrl"]; }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/0xced/XCDYouTubeKit/issues/538#issuecomment-869178413, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDPFF7HXSVEAH7JSSUJE3DTU45FXANCNFSM47A6E34Q .

Candygoblen123 commented 3 years ago

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'

devbest555 commented 3 years ago

Thank you. I already fixed the error based on karimabees suggestion. Thank you again.

On Mon, Jun 28, 2021 at 4:11 PM Andrew Glaze @.***> wrote:

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'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/0xced/XCDYouTubeKit/issues/538#issuecomment-869672127, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDPFF4SU4TULFDNTO67ESLTVBYJ5ANCNFSM47A6E34Q .

AshokRadadiya commented 3 years ago

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

devbest555 commented 3 years ago

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

AshokRadadiya commented 3 years ago

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

working sir, thank you!