从UIWebView启动后的视频方向 [英] Video orientation after launched from UIWebView

查看:79
本文介绍了从UIWebView启动后的视频方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIWebView,它有一个youtube的嵌入代码(iframe)。我想为视频播放器启用纵向和横向,但仅为UIWebView本身启用纵向模式。

I have an UIWebView that has an youtube's embed code (iframe). I'd like to enable both portrait and horizontal orientation for the video player, but portrait mode only for the UIWebView itself.

如何实现此目的?

推荐答案

UIWebView按其方向显示其内容。没有(简单)方法有条件地改变UIWebView基于其内容允许的方向。我可以想象这个工作的唯一方法是解析网页视图的HTML并根据其内容,允许或不允许某些方向。

The UIWebView displays its content by its orientation. There is no (easy) way to conditionally change which orientations the UIWebView allows based on its content. The only way I can imagine this working is by parsing the HTML of the web view and based on its content, allowing or disallowing certain orientations.

无论如何,我建议既允许两者的肖像和风景,或只允许肖像。如果您有时只允许使用横向广告,这会让用户感到困惑。

Regardless of all this, I would suggest either allowing both portrait and landscape for both, or only allowing portrait. This would be confusing to users if you only sometimes allowed landscape.

这篇关于从UIWebView启动后的视频方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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