开发者

Video orientation after launched from UIWebView

开发者 https://www.devze.com 2023-02-27 06:07 出处:网络
I have an UIWebView that has an youtube\'s embed code (ifr开发者_如何学Pythoname). I\'d like to enable both portrait and horizontal orientation for the video player, but portrait mode only for the UIW

I have an UIWebView that has an youtube's embed code (ifr开发者_如何学Pythoname). I'd like to enable both portrait and horizontal orientation for the video player, but portrait mode only for the UIWebView itself.

How can I achieve this?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消