2

I am having a problem with quality for embedded YouTube videos in my app. I am using YTPlayerView to embed videos from YouTube. My app has 2 options: option 1 is the user can watch video with 360p quality and option 2 is 720p quality. Are these two options possible? If yes, can I customize the video playback quality of the YTPlayerView?

I tried to change the quality this way, but it does not appear to work:

 [self.playerView setPlaybackQuality:kYTPlaybackQualitySmall];
JAL
  • 41,701
  • 23
  • 172
  • 300
Duyklinsi
  • 49
  • 1
  • 6

1 Answers1

3

I assume you are using YouTube's youtube-ios-player-helper for iOS.

Unfortunately, due the to the nature of the iFrame API, it is not possible to force a quality playback with this library. The player will load the video in the closest resolution to your YTPlayerView's size. If you change the size of your YTPlayerView programmatically, the view will reload the video to fit your new frame.

See this GitHub issue on the project page. Unfortunately, this is the expected behavior of the class.

JAL
  • 41,701
  • 23
  • 172
  • 300
  • Thanks JAL. I think I have to find another library. :( – Duyklinsi Mar 25 '15 at 08:57
  • 3
    @Duyklinsi unfortunately the youtube-ios-player-helper library is the only way to play YouTube videos in your app without violating their terms of service. An alternate library is [XCDYouTubeKit](https://github.com/0xced/XCDYouTubeKit), but that violates YouTube's terms of service. – JAL Mar 25 '15 at 12:39