File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/core/src/components/YoutubePlayer Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,19 @@ const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
3333 opacity : viewStyles . opacity < 0.99 ? viewStyles . opacity : 0.99 ,
3434 } ,
3535 ] }
36+ /**
37+ * Addresses issue where webview is locked by aspect ratio and refuses to
38+ * change height according to provided style props.
39+ * See:
40+ * https://github.com/LonelyCpp/react-native-youtube-iframe/issues/13#issuecomment-611753123
41+ */
42+ webViewProps = { {
43+ injectedJavaScript : `
44+ var element = document.getElementsByClassName('container')[0];
45+ element.style.position = 'unset';
46+ true;
47+ ` ,
48+ } }
3649 />
3750 ) ;
3851} ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
2626 return (
2727 < View style = { viewStyles } >
2828 < YouTube
29+ style = { { flex : 1 } }
2930 videoId = { ! videoId && ! playlist ? defaultVideoId : videoId }
3031 opts = { options }
3132 />
You can’t perform that action at this time.
0 commit comments