File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -292,20 +292,23 @@ class VideoContentElement extends ReplacedElement {
292
292
Widget toWidget (RenderContext context) {
293
293
final double _width = width ?? (height ?? 150 ) * 2 ;
294
294
final double _height = height ?? (width ?? 300 ) / 2 ;
295
- return Container (
296
- child: Chewie (
297
- controller: ChewieController (
298
- videoPlayerController: VideoPlayerController .network (
299
- src.first ?? "" ,
295
+ return AspectRatio (
296
+ aspectRatio: _width / _height,
297
+ child: Container (
298
+ child: Chewie (
299
+ controller: ChewieController (
300
+ videoPlayerController: VideoPlayerController .network (
301
+ src.first ?? "" ,
302
+ ),
303
+ placeholder: poster != null
304
+ ? Image .network (poster)
305
+ : Container (color: Colors .black),
306
+ autoPlay: autoplay,
307
+ looping: loop,
308
+ showControls: showControls,
309
+ autoInitialize: true ,
310
+ aspectRatio: _width / _height,
300
311
),
301
- placeholder: poster != null
302
- ? Image .network (poster)
303
- : Container (color: Colors .black),
304
- autoPlay: autoplay,
305
- looping: loop,
306
- showControls: showControls,
307
- autoInitialize: true ,
308
- aspectRatio: _width / _height,
309
312
),
310
313
),
311
314
);
You can’t perform that action at this time.
0 commit comments