-
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 placeholder until play example * Added playback stalled feature in iOS * Added playback stalled feature in iOS * BetterPlayerTheme addition, custom controls rework * Exposed BetterPlayerPlaylistState and betterPlayerController getter within. * Overridden duration implementation * Overridden duration implementation * Overridden duration implementation * Overridden duration implementation * Updated readme, general refactor * PR refactor
- Loading branch information
Showing
27 changed files
with
394 additions
and
108 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
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,61 @@ | ||
import 'package:better_player/better_player.dart'; | ||
import 'package:better_player_example/constants.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class OverriddenDurationPage extends StatefulWidget { | ||
@override | ||
_OverriddenDurationPageState createState() => _OverriddenDurationPageState(); | ||
} | ||
|
||
class _OverriddenDurationPageState extends State<OverriddenDurationPage> { | ||
BetterPlayerController _betterPlayerController; | ||
|
||
@override | ||
void initState() { | ||
BetterPlayerConfiguration betterPlayerConfiguration = | ||
BetterPlayerConfiguration( | ||
aspectRatio: 16 / 9, | ||
fit: BoxFit.contain, | ||
handleLifecycle: true, | ||
); | ||
_betterPlayerController = BetterPlayerController(betterPlayerConfiguration); | ||
_setupDataSource(); | ||
super.initState(); | ||
} | ||
|
||
void _setupDataSource() async { | ||
BetterPlayerDataSource dataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.network, | ||
Constants.elephantDreamVideoUrl, | ||
|
||
///Play only 10 seconds of this video. | ||
overriddenDuration: Duration(seconds: 10), | ||
); | ||
_betterPlayerController.setupDataSource(dataSource); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text("Notification player"), | ||
), | ||
body: Column( | ||
children: [ | ||
const SizedBox(height: 8), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: Text( | ||
"Click play on player to show notification in status bar.", | ||
style: TextStyle(fontSize: 16), | ||
), | ||
), | ||
AspectRatio( | ||
aspectRatio: 16 / 9, | ||
child: BetterPlayer(controller: _betterPlayerController), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.