Change Playback Quality of YTPlayerView

你说的曾经没有我的故事 提交于 2019-12-11 03:45:30

问题


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];

回答1:


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.



来源:https://stackoverflow.com/questions/29237984/change-playback-quality-of-ytplayerview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!