Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Chewie player as video control bar which has better user experience #22

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Changed name of fullScreen to allowFullScreen
trustmefelix committed Feb 3, 2021
commit 9d34ac83899053d829b557b0f5140c3ddc1bda6e
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ class VideoScreen extends StatelessWidget {
preferredSize: Size(0.0, 0.0),
),
body: ListView(children: <Widget>[
VimeoPlayer(id: '505942118', autoPlay: true, fullScreen: true),
VimeoPlayer(id: '505942118', autoPlay: true, allowFullScreen: true),
]));
}
}
14 changes: 9 additions & 5 deletions example/lib/vimeoplayer.dart
Original file line number Diff line number Diff line change
@@ -13,19 +13,20 @@ class VimeoPlayer extends StatefulWidget {
final bool autoPlay;
final bool looping;
final int position;
final bool fullScreen;
final bool allowFullScreen;

VimeoPlayer({
@required this.id,
this.autoPlay,
this.looping,
this.position,
this.fullScreen,
@required this.allowFullScreen,
Key key,
}) : super(key: key);
}) : assert(id != null && allowFullScreen != null),
super(key: key);

@override
_VimeoPlayerState createState() => _VimeoPlayerState(id, autoPlay, looping, position, fullScreen);
_VimeoPlayerState createState() => _VimeoPlayerState(id, autoPlay, looping, position, allowFullScreen);
}

class _VimeoPlayerState extends State<VimeoPlayer> {
@@ -34,9 +35,10 @@ class _VimeoPlayerState extends State<VimeoPlayer> {
bool looping = false;
bool _overlay = true;
bool fullScreen = false;
bool allowFullScreen = false;
int position;

_VimeoPlayerState(this._id, this.autoPlay, this.looping, this.position, this.fullScreen);
_VimeoPlayerState(this._id, this.autoPlay, this.looping, this.position, this.allowFullScreen);

//Custom controller
VideoPlayerController _videoPlayerController;
@@ -67,6 +69,8 @@ class _VimeoPlayerState extends State<VimeoPlayer> {

@override
void initState() {
fullScreen = allowFullScreen;

//Create class
_quality = QualityLinks(_id);

14 changes: 9 additions & 5 deletions lib/vimeoplayer.dart
Original file line number Diff line number Diff line change
@@ -13,19 +13,20 @@ class VimeoPlayer extends StatefulWidget {
final bool autoPlay;
final bool looping;
final int position;
final bool fullScreen;
final bool allowFullScreen;

VimeoPlayer({
@required this.id,
this.autoPlay,
this.looping,
this.position,
this.fullScreen,
@required this.allowFullScreen,
Key key,
}) : super(key: key);
}) : assert(id != null && allowFullScreen != null),
super(key: key);

@override
_VimeoPlayerState createState() => _VimeoPlayerState(id, autoPlay, looping, position, fullScreen);
_VimeoPlayerState createState() => _VimeoPlayerState(id, autoPlay, looping, position, allowFullScreen);
}

class _VimeoPlayerState extends State<VimeoPlayer> {
@@ -34,9 +35,10 @@ class _VimeoPlayerState extends State<VimeoPlayer> {
bool looping = false;
bool _overlay = true;
bool fullScreen = false;
bool allowFullScreen = false;
int position;

_VimeoPlayerState(this._id, this.autoPlay, this.looping, this.position, this.fullScreen);
_VimeoPlayerState(this._id, this.autoPlay, this.looping, this.position, this.allowFullScreen);

//Custom controller
VideoPlayerController _controller;
@@ -67,6 +69,8 @@ class _VimeoPlayerState extends State<VimeoPlayer> {

@override
void initState() {
fullScreen = allowFullScreen;

//Create class
_quality = QualityLinks(_id);