Browse Source

Revert "Media_kit: Workaround for showing thumbnail when media_kit is buffering"

This reverts commit 9e0eb9e2e6f879c098dc60c74a21d99412fb981b.
ashilkn 1 year ago
parent
commit
d2bbf34795
1 changed files with 2 additions and 15 deletions
  1. 2 15
      lib/ui/viewer/file/video_widget_new.dart

+ 2 - 15
lib/ui/viewer/file/video_widget_new.dart

@@ -74,8 +74,6 @@ class _VideoWidgetNewState extends State<VideoWidgetNew> {
 
   @override
   Widget build(BuildContext context) {
-    final deviceSize = MediaQuery.sizeOf(context);
-    final fileAspectRatio = widget.file.width / widget.file.height;
     final colorScheme = getEnteColorScheme(context);
     return Hero(
       tag: widget.tagPrefix! + widget.file.tag,
@@ -95,20 +93,9 @@ class _VideoWidgetNewState extends State<VideoWidgetNew> {
           seekBarPositionColor: colorScheme.primary300,
           topButtonBarMargin: const EdgeInsets.only(top: verticalMargin),
           bufferingIndicatorBuilder: (p0) {
-            ///Workaround for displaying thumbnail when media_kit is buffering
-
-            //Calculate dimensions of file in wrt to screen
-            double? width = deviceSize.aspectRatio <= fileAspectRatio
-                ? deviceSize.width
-                : null;
-            double? height = deviceSize.aspectRatio >= fileAspectRatio
-                ? deviceSize.height
-                : null;
-            width ??= height! * fileAspectRatio;
-            height ??= width / fileAspectRatio;
             return OverflowBox(
-              maxHeight: height,
-              maxWidth: width,
+              maxHeight: MediaQuery.sizeOf(context).height,
+              maxWidth: MediaQuery.sizeOf(context).width,
               child: _getLoadingWidget(),
             );
           },