Video orientation after launched from UIWebView

此生再无相见时 提交于 2019-12-24 12:08:15

问题


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.

How can I achieve this?


回答1:


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.



来源:https://stackoverflow.com/questions/5718908/video-orientation-after-launched-from-uiwebview

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