Giter Site home page Giter Site logo

Comments (2)

ssimonov avatar ssimonov commented on August 14, 2024 1

Actually no, workaround:

- (void)initializateYTPlayerViewInView:(UIView *)view {
    NSDictionary *playerVars = @{@"controls" : @1,
                                 @"playsinline" : @1,
                                 @"autohide" : @1,
                                 @"modestbranding" : @1,
                                 @"iv_load_policy" : @3,
                                 @"rel" : @0};

    self.YTPlayerView = [YTPlayerView new];
    self.YTPlayerView.frame = view.bounds;
    self.YTPlayerView.delegate = self;
    [view addSubview:self.YTPlayerView];

    [self.YTPlayerView loadWithVideoId:@"OG2eGVt6v2o" playerVars:playerVars];  // Initialize player
}

- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView {
    [self.YTPlayerView loadVideoById:@"OG2eGVt6v2o" startSeconds:0.0f suggestedQuality:kYTPlaybackQualitySmall];  // Force awful quality at start
}

- (IBAction)changeQualityAction:(id)anObject {
    [self.YTPlayerView loadVideoById:@"OG2eGVt6v2o" startSeconds:self.YTPlayerView.currentTime suggestedQuality:kYTPlaybackQualityHD720];  // Force HD Quality
}

Edited: oh yeah, they can force Medium quality, if your view doesn't fit HD quality size. But this workaround can help, if you gonna use lower qualities @ fullscreen.

from youtube-ios-player-helper.

Kowaio avatar Kowaio commented on August 14, 2024

Hello @chiakie

I did a lot of research and tests too regarding this matter since I'd like to play a video in hd720 quality in portrait mode (with width = 375 height = 210 in my case) in order for it to not reload when rotating my device and so playing the video in the new width = 667 height = 375 (iPhone6).

However, I didn't find anything that works. The YT iframe API seems to force the reload as soon as the resolution changes, so I'm hitting a wall too here.

Another member told me that it is the correct behavior on iPhone to avoid playing a kickass quality for 3G/LTE network. However I think that forcing a reload when the user rotates its device (since we're resizing the view) is also intrusive and not smooth imho.

I hope this will be fixed soon or that a solution will present itself.

Feel free to comment our posts if anyone's got an input about that.

Thanks again,

Best regards,

K

from youtube-ios-player-helper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.