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

Wakelock Plus Migration #747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.6.0
* [#747](https://github.com/fluttercommunity/chewie/pull/747): Migrated from `wakelock` to `wakelock_plus`. Thanks [diegotori](https://github.com/diegotori).
* Also upgrades `video_player` from `2.4.7` to `2.7.0`.

## 1.5.0
* 🛠️ [#712](https://github.com/fluttercommunity/chewie/pull/712): Progress Bars can now be disabled by setting `ChewieController.draggableProgressBar` to `false`. Thanks [shiyiya](https://github.com/shiyiya).
* ⬆️ Increased Dart SDK constraint to cover Dart `3.0.0` and higher.
Expand Down
4 changes: 2 additions & 2 deletions example/lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class _ChewieDemoState extends State<ChewieDemo> {

Future<void> initializePlayer() async {
_videoPlayerController1 =
VideoPlayerController.network(srcs[currPlayIndex]);
VideoPlayerController.networkUrl(Uri.parse(srcs[currPlayIndex]));
_videoPlayerController2 =
VideoPlayerController.network(srcs[currPlayIndex]);
VideoPlayerController.networkUrl(Uri.parse(srcs[currPlayIndex]));
await Future.wait([
_videoPlayerController1.initialize(),
_videoPlayerController2.initialize()
Expand Down
8 changes: 4 additions & 4 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:video_player/video_player.dart';
import 'package:wakelock/wakelock.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

typedef ChewieRoutePageBuilder = Widget Function(
BuildContext context,
Expand Down Expand Up @@ -158,7 +158,7 @@ class ChewieState extends State<Chewie> {
onEnterFullScreen();

if (!widget.controller.allowedScreenSleep) {
Wakelock.enable();
WakelockPlus.enable();
}

await Navigator.of(
Expand All @@ -169,8 +169,8 @@ class ChewieState extends State<Chewie> {
widget.controller.exitFullScreen();

// The wakelock plugins checks whether it needs to perform an action internally,
// so we do not need to check Wakelock.isEnabled.
Wakelock.disable();
// so we do not need to check WakelockPlus.isEnabled.
WakelockPlus.disable();

SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual,
Expand Down
14 changes: 7 additions & 7 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: chewie
description: A video player for Flutter with Cupertino and Material play controls
version: 1.5.0
version: 1.6.0
homepage: https://github.com/fluttercommunity/chewie

environment:
sdk: '>=2.13.0 <4.0.0'
flutter: '>=1.22.0'
sdk: '>=2.17.0 <4.0.0'
flutter: ">=2.11.0"

dependencies:
cupertino_icons: ^1.0.5
flutter:
sdk: flutter
provider: ^6.0.3
video_player: ^2.4.7
wakelock: ^0.6.2
provider: ^6.0.5
video_player: ^2.7.0
wakelock_plus: ^1.0.0+2

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
flutter_lints: ^2.0.2

flutter:
uses-material-design: true