2
votes

I'm using YTPlayerView to play videos from Youtube in an iOS app. (See Youtube Helper Library)

And I'm facing a little issue that I would like to solve: video previews have low quality when using the following method:

- (void) cueVideoById:(NSString *)videoId startSeconds:(float)startSeconds suggestedQuality:(YTPlaybackQuality)suggestedQuality , which is recommended to use when loading another video into web view.

If I use - (BOOL) loadWithVideoId:(NSString *)videoId playerVars:(NSDictionary *)playerVars , then preview quality is fine, but this will reload the web view, not recommended. See sample screenshots:

enter image description hereenter image description here

As suggested quality I use kYTPlaybackQualityAuto, also I tried the best ones without success.

How could I solve this and get a better preview quality without reloading videos every time?

1
possible duplicate of Change Playback Quality of YTPlayerViewJAL

1 Answers

1
votes

Just call this method after initialising the player.

[youtubePlayer setPlaybackQuality:kYTPlaybackQualityHD720];

Following are the possible values-

typedef NS_ENUM(NSInteger, YTPlaybackQuality) {
    kYTPlaybackQualitySmall,
    kYTPlaybackQualityMedium,
    kYTPlaybackQualityLarge,
    kYTPlaybackQualityHD720,
    kYTPlaybackQualityHD1080,
    kYTPlaybackQualityHighRes,
    kYTPlaybackQualityAuto, /** Addition for YouTube Live Events. */
    kYTPlaybackQualityDefault,
    kYTPlaybackQualityUnknown /** This should never be returned. It is here for future proofing. */
};