嵌入式Youtube:如何在iOS 7 ipad上获得高品质 [英] Embedded Youtube: How to get high quality on iOS 7 ipad

查看:103
本文介绍了嵌入式Youtube:如何在iOS 7 ipad上获得高品质的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上有一个嵌入式YouTube视频。在桌面上它工作正常。但是,在ipad(运行iOS7)上,视频质量相当差,可能是480p。在iframe里面它看起来很好,但是当你制作全屏视频时它非常引人注目。我已尝试在查询字符串中使用 hd = 1& vq = hd720 并使用建议质量为hd720的cueVideoById,但两者均无效。当嵌入式YouTube视频全屏显示时,是否有任何工作可以在ipad上获得更高的分辨率,或者为ipad上的嵌入式YouTube视频强制更高的分辨率?

I have an embedded youtube video on a web page. On the desktop it works fine. However, on an ipad (running iOS7) the video quality is rather poor, probably 480p. Inside the iframe it looks fine, but when you make the video full screen it is very noticeable. I have tried using hd=1&vq=hd720 in the querystring and using cueVideoById with a suggested quality of 'hd720' but neither worked. Are there any work arounds either to get higher resolution on the ipad when embedded youtube videos are made fullscreen, or to force higher resolution for embedded youtube videos on the ipad?

推荐答案

我找到了一个有效的解决方法,虽然它不优雅。

I found a workaround that works, although it is hardly elegant.

基本上,我创建的iframe的尺寸足够大,可以获得720p的质量。 (比如制作iframe 720x440像素。)然后,我使用CSS变换将iframe缩小到我想要的大小。 CSS看起来像:

Basically, I create the iframe with a dimensions large enough to get 720p quality. (Such as making the iframe 720x440 pixels.) And then, I use CSS transforms to scale the iframe back down to the size I want. The CSS looks something like:

-webkit-transform-origin: left top;
-webkit-transform: scale(0.5);

其中0.5可以用任何比例替换,你必须增加iframe的大小。

Where 0.5 could be replaced with whatever scale you had to increase the size of the iframe by.

从用户的角度来看,主要的缺点是视频控制按比例缩小。但是,在全屏模式下,控件是正常尺寸,用户可以全屏缩小,因此对于我的团队来说,至少在提高视频质量方面的权衡是值得的。

The main downside to this from the user's perspective is that the video controls are scaled down. However, in full screen mode the controls are the normal size, and the user can pinch out to full screen, so for my team at least the trade-off in increased video quality was worth it.

这篇关于嵌入式Youtube:如何在iOS 7 ipad上获得高品质的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆