0xced / XCDYouTubeKit

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

iPhone x support #351

Closed kotromeo closed 4 years ago

kotromeo commented 6 years ago

Need padding from top of the screen iphone x - ios 11 0 2017-09-27 13-21-17

RYULs commented 6 years ago

I'm waiting for this issue to be a patch.

ConfusedVorlon commented 6 years ago

yup - would be great if you could sort this.

yoasha commented 6 years ago

Such fix would be greatly appreciated.

Valodya89 commented 5 years ago

Any fix?

sureshpatel-cnpl commented 5 years ago

Any update for the same?

StefaniOSApps commented 5 years ago

you can use the latest solution:

AVPlayerViewController *playerViewController = [AVPlayerViewController new];
[self presentViewController:playerViewController animated:YES completion:nil];

__weak AVPlayerViewController *weakPlayerViewController = playerViewController;
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:videoIdentifier completionHandler:^(XCDYouTubeVideo * _Nullable video, NSError * _Nullable error) {
    if (video)
    {
        NSDictionary *streamURLs = video.streamURLs;
        NSURL *streamURL = streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] ?: streamURLs[@(XCDYouTubeVideoQualityHD720)] ?: streamURLs[@(XCDYouTubeVideoQualityMedium360)] ?: streamURLs[@(XCDYouTubeVideoQualitySmall240)];
        weakPlayerViewController.player = [AVPlayer playerWithURL:streamURL];
        [weakPlayerViewController.player play];
    }
    else
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
}];
SoneeJohn commented 4 years ago

Closed in https://github.com/0xced/XCDYouTubeKit/commit/14b7f9bc05335db8b5eb025398828dc2a562fb58