Skip to content

Commit e3e7d69

Browse files
authored
Merge pull request #3 from Piwigo/master
updating master
2 parents fb49ef1 + 5ad021e commit e3e7d69

3 files changed

Lines changed: 31 additions & 30 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you face trouble please [create tickets](https://github.com/Piwigo/piwigo-flu
1010

1111
# Installation
1212

13-
For now, this application is in Beta. You can download the latest version either from Github or from Google Play Store:
13+
You can download the latest version either from Github or from Google Play Store:
1414

1515
## Download from Play Store
1616

@@ -87,7 +87,7 @@ With Piwigo NG, you can upload images from the phone.
8787

8888
# Flutter
8989

90-
This application is made with [Google's Flutter](https://flutter.dev/?gclid=Cj0KCQjwvYSEBhDjARIsAJMn0lj-G1Ly0oznQeMGvyTYBY2TZfxFpkb9WYp4dsyMSwKIUsmTwE-SltIaAsjFEALw_wcB&gclsrc=aw.ds)
90+
This application is made with [Flutter](https://flutter.dev/?gclid=Cj0KCQjwvYSEBhDjARIsAJMn0lj-G1Ly0oznQeMGvyTYBY2TZfxFpkb9WYp4dsyMSwKIUsmTwE-SltIaAsjFEALw_wcB&gclsrc=aw.ds)
9191

9292
A UI toolkit for building beautiful, natively compiled applications for [mobile](https://flutter.dev/docs), [web](https://flutter.dev/web), and [desktop](https://flutter.dev/desktop) from a single codebase.
9393

@@ -105,4 +105,4 @@ For the upload, we are using the **uploadAsync** method of the API. This method
105105
# Licence
106106

107107
Piwigo is a free software, it can be redistributed it and / or modified under the terms of the GNU General Public License
108-
[see more here](./LICENCE.txt)
108+
[see more here](./LICENCE.txt)

lib/views/UploadGalleryViewPage.dart

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dart:io';
22

3-
import 'package:video_player/video_player.dart';
3+
import 'package:better_player/better_player.dart';
44
import 'package:file_picker/file_picker.dart';
55
import 'package:image_picker/image_picker.dart';
66
import 'package:piwigo_ng/constants/SettingsConstants.dart';
@@ -593,15 +593,24 @@ class VideoItem extends StatefulWidget {
593593
_VideoItemState createState() => _VideoItemState();
594594
}
595595
class _VideoItemState extends State<VideoItem> {
596-
VideoPlayerController _controller;
596+
BetterPlayerController _controller;
597597

598598
@override
599599
void initState() {
600600
super.initState();
601-
_controller = VideoPlayerController.file(File(widget.path))
602-
..initialize().then((_) {
603-
setState(() {});
604-
});
601+
BetterPlayerDataSource betterPlayerDataSource = BetterPlayerDataSource.file(widget.path);
602+
_controller = BetterPlayerController(
603+
BetterPlayerConfiguration(
604+
aspectRatio: 1,
605+
autoPlay: true,
606+
looping: true,
607+
fit: BoxFit.cover,
608+
controlsConfiguration: BetterPlayerControlsConfiguration(
609+
showControls: false
610+
),
611+
),
612+
betterPlayerDataSource: betterPlayerDataSource);
613+
setState(() {});
605614
}
606615

607616
@override
@@ -612,25 +621,18 @@ class _VideoItemState extends State<VideoItem> {
612621

613622
@override
614623
Widget build(BuildContext context) {
615-
if(_controller.value.isInitialized) {
616-
return FittedBox(
617-
fit: BoxFit.cover,
618-
child: GestureDetector(
619-
onTap: () {
620-
setState(() {
621-
_controller.value.isPlaying
622-
? _controller.pause()
623-
: _controller.play();
624-
});
625-
},
626-
child: SizedBox(
627-
width: _controller.value.size?.width ?? 0,
628-
height: _controller.value.size?.height ?? 0,
629-
child: VideoPlayer(_controller),
630-
),
631-
),
624+
return GestureDetector(
625+
onTap: () {
626+
setState(() {
627+
_controller.isPlaying()
628+
? _controller.pause()
629+
: _controller.play();
630+
});
631+
},
632+
child: AspectRatio(
633+
aspectRatio: 1,
634+
child: BetterPlayer(controller: _controller),
635+
)
632636
);
633-
}
634-
return CircularProgressIndicator();
635637
}
636-
}
638+
}

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ dependencies:
5656
photo_view: ^0.9.0
5757
cached_network_image: ^3.0.0
5858
better_player: ^0.0.79
59-
video_player: ^2.2.10
6059
wakelock: ^0.5.6
6160

6261
dev_dependencies:

0 commit comments

Comments
 (0)