mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 05:45:10 +00:00
chore: Go back to chewie
This commit is contained in:
parent
93dcbeee20
commit
bbcd1ff7b0
4 changed files with 19 additions and 19 deletions
|
@ -5,7 +5,7 @@ import 'dart:io';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.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_blurhash/flutter_blurhash.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
@ -27,7 +27,7 @@ class EventVideoPlayer extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
||||||
FlickManager? _flickManager;
|
ChewieController? _chewieManager;
|
||||||
bool _isDownloading = false;
|
bool _isDownloading = false;
|
||||||
String? _networkUri;
|
String? _networkUri;
|
||||||
File? _tmpFile;
|
File? _tmpFile;
|
||||||
|
@ -63,7 +63,7 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_flickManager?.dispose();
|
_chewieManager?.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,24 +77,24 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
||||||
fallbackBlurHash;
|
fallbackBlurHash;
|
||||||
final videoFile = _tmpFile;
|
final videoFile = _tmpFile;
|
||||||
final networkUri = _networkUri;
|
final networkUri = _networkUri;
|
||||||
if (kIsWeb && networkUri != null && _flickManager == null) {
|
if (kIsWeb && networkUri != null && _chewieManager == null) {
|
||||||
_flickManager = FlickManager(
|
_chewieManager = ChewieController(
|
||||||
videoPlayerController: VideoPlayerController.network(networkUri),
|
videoPlayerController: VideoPlayerController.network(networkUri),
|
||||||
);
|
);
|
||||||
} else if (!kIsWeb && videoFile != null && _flickManager == null) {
|
} else if (!kIsWeb && videoFile != null && _chewieManager == null) {
|
||||||
_flickManager = FlickManager(
|
_chewieManager = ChewieController(
|
||||||
videoPlayerController: VideoPlayerController.file(videoFile),
|
videoPlayerController: VideoPlayerController.file(videoFile),
|
||||||
autoPlay: true,
|
autoPlay: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final flickManager = _flickManager;
|
final chewieManager = _chewieManager;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 400,
|
width: 400,
|
||||||
height: 300,
|
height: 300,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
if (flickManager == null) ...[
|
if (chewieManager == null) ...[
|
||||||
if (hasThumbnail)
|
if (hasThumbnail)
|
||||||
ImageBubble(widget.event)
|
ImageBubble(widget.event)
|
||||||
else
|
else
|
||||||
|
@ -115,7 +115,7 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
] else
|
] else
|
||||||
FlickVideoPlayer(flickManager: flickManager),
|
Center(child: Chewie(controller: chewieManager)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
14
pubspec.lock
14
pubspec.lock
|
@ -148,6 +148,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
chewie:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: chewie
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
cli_util:
|
cli_util:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -351,13 +358,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.2+1"
|
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:
|
fluffybox:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -13,6 +13,7 @@ dependencies:
|
||||||
audioplayers: ^0.20.1
|
audioplayers: ^0.20.1
|
||||||
blurhash_dart: ^1.1.0
|
blurhash_dart: ^1.1.0
|
||||||
cached_network_image: ^3.1.0
|
cached_network_image: ^3.1.0
|
||||||
|
chewie: ^1.2.2
|
||||||
cupertino_icons: any
|
cupertino_icons: any
|
||||||
desktop_drop: ^0.3.0
|
desktop_drop: ^0.3.0
|
||||||
desktop_notifications: ^0.6.1
|
desktop_notifications: ^0.6.1
|
||||||
|
@ -22,7 +23,6 @@ dependencies:
|
||||||
#fcm_shared_isolate:
|
#fcm_shared_isolate:
|
||||||
# git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
|
# git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
|
||||||
file_picker_cross: ^4.5.0
|
file_picker_cross: ^4.5.0
|
||||||
flick_video_player: ^0.3.1
|
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_app_badger: ^1.3.0
|
flutter_app_badger: ^1.3.0
|
||||||
|
|
|
@ -99,5 +99,5 @@ index e1670a32..7e3238b0 100644
|
||||||
+ fcm_shared_isolate:
|
+ fcm_shared_isolate:
|
||||||
+ git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
|
+ git: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
|
||||||
file_picker_cross: ^4.5.0
|
file_picker_cross: ^4.5.0
|
||||||
flick_video_player: ^0.3.1
|
|
||||||
flutter:
|
flutter:
|
||||||
|
sdk: flutter
|
||||||
|
|
Loading…
Reference in a new issue