Cannot change YouTube video quality at all (always starts with “medium”) with iOS's WebView

廉价感情. 提交于 2019-12-13 05:42:12

问题


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

来源:https://stackoverflow.com/questions/55994629/cannot-change-youtube-video-quality-at-all-always-starts-with-medium-with-io

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