forked from jhomlala/betterplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/february changes 9 (jhomlala#330)
* Added overflowModalColor and overflowModalTextColor in BetterPlayerControlsConfiguration. * Disabled picture in picture in fullscreen mode. * Updated reusable video example * Fixed enabled parameter for skip back and forward * Fixed enabled parameter for skip back and forward * Updated changelog * Added AES DRM support * Added AES DRM support * Updated documentation * Updated token based DRM * Added widevine DRM support * Dart lint fixes, Dart format * Dart lint fixes, Dart format * Dart lint fixes, Dart format
- Loading branch information
Showing
24 changed files
with
462 additions
and
203 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
class VideoListData { | ||
final String videoTitle; | ||
final String videoUrl; | ||
Duration lastPosition; | ||
bool wasPlaying = false; | ||
|
||
VideoListData(this.videoTitle, this.videoUrl); | ||
} |
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,83 @@ | ||
import 'package:better_player/better_player.dart'; | ||
import 'package:better_player_example/constants.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class DrmPage extends StatefulWidget { | ||
@override | ||
_DrmPageState createState() => _DrmPageState(); | ||
} | ||
|
||
class _DrmPageState extends State<DrmPage> { | ||
BetterPlayerController _tokenController; | ||
BetterPlayerController _widevineController; | ||
|
||
@override | ||
void initState() { | ||
BetterPlayerConfiguration betterPlayerConfiguration = | ||
BetterPlayerConfiguration( | ||
aspectRatio: 16 / 9, | ||
fit: BoxFit.contain, | ||
); | ||
BetterPlayerDataSource _tokenDataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.network, | ||
Constants.tokenEncodedHlsUrl, | ||
videoFormat: BetterPlayerVideoFormat.hls, | ||
drmConfiguration: BetterPlayerDrmConfiguration( | ||
drmType: BetterPlayerDrmType.token, | ||
token: Constants.tokenEncodedHlsToken), | ||
); | ||
_tokenController = BetterPlayerController(betterPlayerConfiguration); | ||
_tokenController.setupDataSource(_tokenDataSource); | ||
|
||
_widevineController = BetterPlayerController(betterPlayerConfiguration); | ||
BetterPlayerDataSource _widevineDataSource = BetterPlayerDataSource( | ||
BetterPlayerDataSourceType.network, | ||
Constants.widevineVideoUrl, | ||
drmConfiguration: BetterPlayerDrmConfiguration( | ||
drmType: BetterPlayerDrmType.widevine, | ||
licenseUrl: Constants.widevineLicenseUrl, | ||
headers: {"Test": "Test2"}), | ||
); | ||
_widevineController.setupDataSource(_widevineDataSource); | ||
|
||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text("DRM player"), | ||
), | ||
body: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const SizedBox(height: 8), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: Text( | ||
"Auth token based DRM.", | ||
style: TextStyle(fontSize: 16), | ||
), | ||
), | ||
AspectRatio( | ||
aspectRatio: 16 / 9, | ||
child: BetterPlayer(controller: _tokenController), | ||
), | ||
const SizedBox(height: 16), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: Text( | ||
"Widevine - license url based DRM. Works only for Android.", | ||
style: TextStyle(fontSize: 16), | ||
), | ||
), | ||
AspectRatio( | ||
aspectRatio: 16 / 9, | ||
child: BetterPlayer(controller: _widevineController), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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.