File tree 1 file changed +18
-5
lines changed
1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,13 @@ function ThumbnailWrapper({
37
37
onClick = { ( ) => setHideThumbnail ( true ) }
38
38
onError = { ( ) => setError ( true ) }
39
39
style = { {
40
- width : adjustedWidth ,
41
- height : adjustedHeight ,
42
- backgroundImage : `url(${ error ? discordImageFailure : thumbnail } )` ,
40
+ width : "100%" ,
41
+ height : "auto" ,
42
+ maxWidth : adjustedWidth ,
43
+ maxHeight : adjustedHeight ,
43
44
} }
44
45
>
46
+ < Styles . Image src = { error ? discordImageFailure : thumbnail } />
45
47
< Styles . VideoThumbnailPlayButtonContainer >
46
48
< Styles . VideoThumbnailPlayButton
47
49
width = { 12 }
@@ -61,6 +63,13 @@ interface EmbedVideoProps
61
63
}
62
64
63
65
function EmbedVideo ( props : EmbedVideoProps ) {
66
+ const { width : adjustedWidth , height : adjustedHeight } = useSize (
67
+ props . width ,
68
+ props . height
69
+ ) ;
70
+
71
+ console . log ( { props, adjustedWidth, adjustedHeight } ) ;
72
+
64
73
if ( props . proxyUrl )
65
74
return (
66
75
< ThumbnailWrapper
@@ -94,8 +103,12 @@ function EmbedVideo(props: EmbedVideoProps) {
94
103
height = { props . height }
95
104
>
96
105
< Styles . VideoIframe
97
- width = { 400 }
98
- height = { 225 }
106
+ width = "100%"
107
+ height = "100%"
108
+ style = { {
109
+ maxWidth : adjustedWidth ,
110
+ maxHeight : adjustedHeight ,
111
+ } }
99
112
src = { url . toString ( ) }
100
113
allowFullScreen = { true }
101
114
/>
You can’t perform that action at this time.
0 commit comments