Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View Size for YTPlayer

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. enter image description here

like image 354
raginggoat Avatar asked Jan 21 '26 10:01

raginggoat


1 Answers

This solved it for me:

In the Assets folder there should be an html file named "YTPlayerView-iframe-player.html"

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!

like image 90
AppsIntheParkNYC Avatar answered Jan 24 '26 03:01

AppsIntheParkNYC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!