-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added initialized event * Added INITIALIZED event * Added autoDetectFullscreenDeviceOrientation implementation * Fixed autoPlay background issue * Fixed cupertino icons * Fixed progress bar not working correctly for iOS 12 with file datasource * Fixed progress bar not working correctly for iOS 12 with file datasource * 0.0.36 release
- Loading branch information
Showing
16 changed files
with
219 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import 'package:better_player/better_player.dart'; | ||
import 'package:better_player_example/constants.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AutoFullscreenOrientationPage extends StatefulWidget { | ||
@override | ||
_AutoFullscreenOrientationPageState createState() => | ||
_AutoFullscreenOrientationPageState(); | ||
} | ||
|
||
class _AutoFullscreenOrientationPageState | ||
extends State<AutoFullscreenOrientationPage> { | ||
BetterPlayerController _betterPlayerController; | ||
|
||
@override | ||
void initState() { | ||
BetterPlayerConfiguration betterPlayerConfiguration = | ||
BetterPlayerConfiguration( | ||
aspectRatio: 16 / 9, | ||
fit: BoxFit.contain, | ||
autoDetectFullscreenDeviceOrientation: true); | ||
BetterPlayerDataSource dataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.NETWORK, Constants.forBiggerBlazesUrl); | ||
_betterPlayerController = BetterPlayerController(betterPlayerConfiguration); | ||
_betterPlayerController.setupDataSource(dataSource); | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text("Normal player"), | ||
), | ||
body: Column( | ||
children: [ | ||
const SizedBox(height: 8), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: Text( | ||
"Aspect ratio and device orientation on full screen will be " | ||
"managed by the BetterPlayer. Click on the fullscreen option.", | ||
style: TextStyle(fontSize: 16), | ||
), | ||
), | ||
AspectRatio( | ||
aspectRatio: 16 / 9, | ||
child: BetterPlayer(controller: _betterPlayerController), | ||
), | ||
RaisedButton( | ||
child: Text("Play horizontal video"), | ||
onPressed: () { | ||
BetterPlayerDataSource dataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.NETWORK, | ||
Constants.forBiggerBlazesUrl); | ||
_betterPlayerController.setupDataSource(dataSource); | ||
}, | ||
), | ||
RaisedButton( | ||
child: Text("Play vertical video"), | ||
onPressed: () async { | ||
BetterPlayerDataSource dataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.NETWORK, | ||
Constants.verticalVideoUrl); | ||
_betterPlayerController.setupDataSource(dataSource); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
///Supported event types | ||
enum BetterPlayerEventType { | ||
INITIALIZED, | ||
PLAY, | ||
PAUSE, | ||
SEEK_TO, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.