查看YTPlayer的大小 [英] View Size for YTPlayer
问题描述
我正在使用iOS YouTube播放器助手( https://developers.google。 com / youtube / v3 / guides / ios_youtube_helper )它工作正常,但预览图像不是我的视图大小,我无法弄清楚如何更改它所以它适合我的UIView创建。如何填充视图?
I am using the iOS YouTube Player helper (https://developers.google.com/youtube/v3/guides/ios_youtube_helper) and it works just fine but the preview image is not the size of my view and I can't figure out how to change it so it fits within the UIView I've created. How can I make it fill the view?
这是它的样子。
Here is what it looks like.
推荐答案
这解决了我的问题:
在Assets文件夹中应该有一个名为YTPlayerView-iframe-player.html的html文件
In the Assets folder there should be an html file named "YTPlayerView-iframe-player.html"
替换样式标签之间的现有代码,如下所示,这将确保播放器填充100%的YTPlayerView:
Replace the existing code between "style" tags as shown below and this will make sure the Player fills 100% of the YTPlayerView:
<style>
body { margin: 0; width:100%%; height:100%%; }
html { width:100%%; height:100%%; }
</style>
希望这会有所帮助!祝周末愉快!
Hope this helps a bit! Have a great weekend!
这篇关于查看YTPlayer的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!