0

I tried to put player.setPlaybackQuality('hd720'); in onReady and onStateChange but nothing of that works (iPad or iPhone always starts with medium quality and it can't be changed)

Even setting small quality doesn't change anything, these functions just doesn't work with iOS's UIWebView/WKWebView

I also tried to play with size of elements in html just for fun (set hardcoded size, like 1920x1080px) but it also didn't work:

<head>
    <style>
        * { margin: 0; padding: 0; }
        html, body { width: 1920px; height: 1080px; }
    </style>
</head>
<body>
    <div id="player" width="1920px" height="1080px"></div>

This answer is quite popular to similar questions on Stackoverflow but even this one doesn't work for iOS

I use this library to play YouTube video: https://github.com/gilesvangruisen/Swift-YouTube-Player

It's based on YouTube iframe API + iOS WebView

The official iOS YouTube helper library works the same way

p.s. html code: https://github.com/gilesvangruisen/Swift-YouTube-Player/blob/master/YouTubePlayer/YouTubePlayer/YTPlayer.html

WebView iOS implementation: https://github.com/gilesvangruisen/Swift-YouTube-Player/blob/master/YouTubePlayer/YouTubePlayer/YouTubePlayer.swift

Update

I also tried: player.loadVideoById({'videoId': 'bHQqvYy5KYo', 'suggestedQuality': 'hd720'}); but still no progress

user924
  • 8,146
  • 7
  • 57
  • 139
  • how are you connecting when you're testing this out? There's a setting in the YouTube app where users can specify to "Play HD on Wi-fi only" - so if your data is turned on, this will impact your results. Also, some phones/devices have video playback settings to this effect. Note: According to [this source](https://www.groovypost.com/tips/adjust-youtube-quality-ios/), every time you load a new video, the quality is reset to 'auto' by default.. – Rachel Gallen May 06 '19 at 01:06
  • @RachelGallen I use Xcode simulator – user924 May 06 '19 at 15:58
  • I wondered about the testing because you had the iPhone tag, was wondering if you actually tried it on an iPhone device (as well as the simulator). You read my comment about the resetting to auto even when you specify? (In the link..) Not sure how to overcome this. What browser are you working on? – Rachel Gallen May 06 '19 at 16:15
  • Safe to presume you're using a Mac ? – Rachel Gallen May 06 '19 at 16:16
  • @RachelGallen yes, I developer an iOS application in Xcode. I play YouTube video in my app using YouTube iframe API. There is also official helper library https://developers.google.com/youtube/v3/guides/ios_youtube_helper – user924 May 06 '19 at 16:25
  • have you seen [this workaround](https://stackoverflow.com/a/45388013/1675954) ? Also note that YT playback is also based upon internet connection speed and resolution of device.. – Rachel Gallen May 06 '19 at 20:14
  • Browser extensions [such as this one](https://chrome.google.com/webstore/detail/magic-enhancer-for-youtub/koiaokdomkpjdgniimnkhgbilbjgpeak) are available (I know it's not what you're after but no harm investigating anyway)? – Rachel Gallen May 06 '19 at 20:20
  • @RachelGallen in my question I mentioned resizing, it didn't work – user924 May 07 '19 at 18:22
  • @RachelGallen seems even in Safari videos are played maximum at 360p https://apple.stackexchange.com/questions/157871/how-to-play-videos-in-hd-on-youtube-com-in-safari-on-iphone-6 – user924 May 07 '19 at 19:36

0 Answers0