[mob][photos] Rename old video player

This commit is contained in:
ashilkn 2024-12-10 15:48:36 +05:30
parent 25a3ce2909
commit 5893c927c2
2 changed files with 17 additions and 10 deletions

View File

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart';
import "package:photos/ui/viewer/file/video_widget_native.dart";
import "package:photos/ui/viewer/file/video_widget_media_kit.dart";
import "package:photos/ui/viewer/file/zoomable_live_image_new.dart";
class FileWidget extends StatelessWidget {
@ -41,13 +41,19 @@ class FileWidget extends StatelessWidget {
// use old video widget on iOS simulator as the new one crashes while
// playing certain videos on iOS simulator
// if (kDebugMode && Platform.isIOS) {
// return VideoWidget(
// return VideoWidgetChewie(
// file,
// tagPrefix: tagPrefix,
// playbackCallback: playbackCallback,
// );
// }
return VideoWidgetNative(
// return VideoWidgetNative(
// file,
// tagPrefix: tagPrefix,
// playbackCallback: playbackCallback,
// key: key ?? ValueKey(fileKey),
// );
return VideoWidgetMediaKit(
file,
tagPrefix: tagPrefix,
playbackCallback: playbackCallback,

View File

@ -23,25 +23,25 @@ import "package:photos/utils/wakelock_util.dart";
import 'package:video_player/video_player.dart';
import 'package:visibility_detector/visibility_detector.dart';
class VideoWidget extends StatefulWidget {
class VideoWidgetChewie extends StatefulWidget {
final EnteFile file;
final bool? autoPlay;
final String? tagPrefix;
final Function(bool)? playbackCallback;
const VideoWidget(
const VideoWidgetChewie(
this.file, {
this.autoPlay = false,
this.tagPrefix,
this.playbackCallback,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<VideoWidget> createState() => _VideoWidgetState();
State<VideoWidgetChewie> createState() => _VideoWidgetChewieState();
}
class _VideoWidgetState extends State<VideoWidget> {
class _VideoWidgetChewieState extends State<VideoWidgetChewie> {
final _logger = Logger("VideoWidget");
VideoPlayerController? _videoPlayerController;
ChewieController? _chewieController;
@ -170,7 +170,8 @@ class _VideoWidgetState extends State<VideoWidget> {
showErrorDialogForException(
context: context,
exception: error,
message: S.of(context).failedToPlayVideo + "\n" + error.toString(),
message:
S.of(context).failedToPlayVideo + "\n" + error.toString(),
);
} else {
showToast(context, S.of(context).failedToPlayVideo);