chore: Go back to chewie

This commit is contained in:
Christian Pauly 2021-12-27 12:37:16 +01:00
parent 4bb56c6261
commit 541d488f53
4 changed files with 19 additions and 19 deletions

View File

@ -5,7 +5,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flick_video_player/flick_video_player.dart';
import 'package:chewie/chewie.dart';
import 'package:flutter_blurhash/flutter_blurhash.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
@ -27,7 +27,7 @@ class EventVideoPlayer extends StatefulWidget {
}
class _EventVideoPlayerState extends State<EventVideoPlayer> {
FlickManager? _flickManager;
ChewieController? _chewieManager;
bool _isDownloading = false;
String? _networkUri;
File? _tmpFile;
@ -63,7 +63,7 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
@override
void dispose() {
_flickManager?.dispose();
_chewieManager?.dispose();
super.dispose();
}
@ -77,24 +77,24 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
fallbackBlurHash;
final videoFile = _tmpFile;
final networkUri = _networkUri;
if (kIsWeb && networkUri != null && _flickManager == null) {
_flickManager = FlickManager(
if (kIsWeb && networkUri != null && _chewieManager == null) {
_chewieManager = ChewieController(
videoPlayerController: VideoPlayerController.network(networkUri),
);
} else if (!kIsWeb && videoFile != null && _flickManager == null) {
_flickManager = FlickManager(
} else if (!kIsWeb && videoFile != null && _chewieManager == null) {
_chewieManager = ChewieController(
videoPlayerController: VideoPlayerController.file(videoFile),
autoPlay: true,
);
}
final flickManager = _flickManager;
final chewieManager = _chewieManager;
return SizedBox(
width: 400,
height: 300,
child: Stack(
children: [
if (flickManager == null) ...[
if (chewieManager == null) ...[
if (hasThumbnail)
ImageBubble(widget.event)
else
@ -115,7 +115,7 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
),
),
] else
FlickVideoPlayer(flickManager: flickManager),
Center(child: Chewie(controller: chewieManager)),
],
),
);

View File

@ -148,6 +148,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
chewie:
dependency: "direct main"
description:
name: chewie
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
cli_util:
dependency: transitive
description:
@ -351,13 +358,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+1"
flick_video_player:
dependency: "direct main"
description:
name: flick_video_player
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1"
fluffybox:
dependency: transitive
description:

View File

@ -13,6 +13,7 @@ dependencies:
audioplayers: ^0.20.1
blurhash_dart: ^1.1.0
cached_network_image: ^3.1.0
chewie: ^1.2.2
cupertino_icons: any
desktop_drop: ^0.3.0
desktop_notifications: ^0.6.1
@ -22,7 +23,6 @@ dependencies:
#fcm_shared_isolate:
# git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
file_picker_cross: ^4.5.0
flick_video_player: ^0.3.1
flutter:
sdk: flutter
flutter_app_badger: ^1.3.0

View File

@ -99,5 +99,5 @@ index e1670a32..7e3238b0 100644
+ fcm_shared_isolate:
+ git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
file_picker_cross: ^4.5.0
flick_video_player: ^0.3.1
flutter:
sdk: flutter