LonelyCpp / react-native-youtube-iframe

A wrapper of the Youtube-iframe API built for react native.
https://lonelycpp.github.io/react-native-youtube-iframe/
MIT License
598 stars 153 forks source link

How can I customize the height without having a depending width proportion? #286

Closed darias08 closed 1 year ago

darias08 commented 1 year ago

Hello,

I am trying to change the height of the video but it seems to be fixed proportional with the width. Like for example, if I have a width 340, and height 450. I can't change the height any longer because it will stay to that proportional size no matter what. If I put 600 as height and 340 is still the width, it won't change anything. I realize only the width can be change as much as needed, but for the height it has to be very specific and can only change it's size depending on the width length.

I just want to know how can I edit the height to match the size I want instead of adjusting accordingly with the width.

Ashish-Coder12 commented 1 year ago

hii darias ,got a solution for you i am also trying for this and made a solution

<View style={{borderWidth:1,height:400,width:240,overflow:'hidden',alignSelf:'center'}} className="my-5"> <YoutubePlayer width={500} height={400} play={playing} videoId={"Uv_IzDwDdRw"} webViewStyle={{marginLeft:-260,}} />

psdewar commented 1 year ago

@darias08 did you use @Ashish-Coder12's solution?