Open omgitsraven opened 9 years ago
+1 I have the same problem. I've tried all the things you attempted, with the same results, except that iOS Safari app plays the same bad quality version as my app's.
Manually set the frame of the YTPlayerView to 1280x720 before loading the video: _ytPlayerView.frame = CGRectMake(0, 0, 1280, 720);
+1 Setting the playbackQuality
above kYTPlaybackQualityMedium
does not work in any way:
viewDidLoad
)-loadVideoById:startSeconds:suggestedQuality:
-playerViewDidBecomeReady:
-playerView:didChangeToQuality:
I think it might even be possible that YouTube disables higher playback quality in apps and reserves it for their webpage and the YouTube app.
BTW the hack by @nehloo with setting the player frame does work, but as soon as you resize the view to fit the screen, rotate the device or toggle fullscreen, the quality jumps back to medium.
I even tried to use a HD frame size and manipulating the transform
property, which does work, but only until you rotate the device or toggle fullscreen.
So for the moment, best way seems to be to directly use the JavaScript player instead of this outdated library.
@rpitting well I don't use this library but still I have the same problem when using UIWebView + YouTube iframe API
The YTPlayerView in my project is 1024x728 units, which should be plenty of room for a 4:3 720p video, let alone a 480p one. However, no matter what I do, the YTPlayerView always only shows the 360p 'medium' copy, which is unacceptably low-res (I'm showing footage of my app's interface, as a help video, and the text is unreadably blurry).
When I call 'setPlaybackQuality', there is no change. When I call 'loadVideoById:startSeconds:suggestedQuality', the video does not even start. When I call 'availableQualities', it returns an array consisting only of '8' (which I think maps to 'unknown', which isn't supposed to be used?)
Using 4:3 videos or 16:9 videos doesn't seem to make any difference. Using 30fps or 60fps videos doesn't seem to make any difference.
I'm attempting this over wifi on an iPad, so bandwidth shouldn't be an issue. Especially since the 720p version plays fine in the YouTube App, and even in iOS Safari app—just not in this YTPlayerView!
I've read on here that the quality-change options are being quietly disabled—so be it, but why then is the default option so uselessly low-res, even on a retina screen? I really need at least 480p, and there's no reason why 720p wouldn't fit in the space I'm providing, even on a non-retina screen.
I'm using Swift, but the obj-c example project behaves the exact same way (even after I expanded the YTPlayerView to be taller than 720 units high).
Has no-one else encountered this?