From d2b1a312f16326b29866346fb440d9a53b856572 Mon Sep 17 00:00:00 2001 From: Diego Tori Date: Sun, 2 Jul 2023 16:30:22 -0400 Subject: [PATCH 1/2] Issue #729. Migrated wakelock to wakelock_plus. Also upgraded all other dependencies. --- example/lib/app/app.dart | 4 ++-- lib/src/chewie_player.dart | 8 ++++---- pubspec.yaml | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/example/lib/app/app.dart b/example/lib/app/app.dart index 2f6d165cf..e0c08b0b2 100644 --- a/example/lib/app/app.dart +++ b/example/lib/app/app.dart @@ -49,9 +49,9 @@ class _ChewieDemoState extends State { Future 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() diff --git a/lib/src/chewie_player.dart b/lib/src/chewie_player.dart index 20a6db474..f4d4273ae 100644 --- a/lib/src/chewie_player.dart +++ b/lib/src/chewie_player.dart @@ -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, @@ -158,7 +158,7 @@ class ChewieState extends State { onEnterFullScreen(); if (!widget.controller.allowedScreenSleep) { - Wakelock.enable(); + WakelockPlus.enable(); } await Navigator.of( @@ -169,8 +169,8 @@ class ChewieState extends State { 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, diff --git a/pubspec.yaml b/pubspec.yaml index b6bdabe63..92dfd459f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 From 3a42d906fc0a2b2f7e5d08200b84bd547d1961c9 Mon Sep 17 00:00:00 2001 From: Diego Tori Date: Sun, 2 Jul 2023 16:39:17 -0400 Subject: [PATCH 2/2] Updated changelog for version 1.6.0. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb50774b7..1607dea2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.