Skip to content

Commit

Permalink
Replace wakelock with wakelock_plus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkucharski17 committed Jul 11, 2024
1 parent c97d1f1 commit 3e63854
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 48 deletions.
1 change: 0 additions & 1 deletion lib/src/configuration/better_player_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:better_player/better_player.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';


///Configuration of Better Player. Allows to setup general behavior of player.
///Master configuration which contains children that configure specific part
///of player.
Expand Down
8 changes: 4 additions & 4 deletions lib/src/core/better_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// Package imports:
import 'package:visibility_detector/visibility_detector.dart';
import 'package:wakelock/wakelock.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

///Widget which uses provided controller to render video player.
class BetterPlayer extends StatefulWidget {
Expand Down Expand Up @@ -107,7 +107,7 @@ class _BetterPlayerState extends State<BetterPlayer>
///full screen is on, then full screen route must be pop and return to normal
///state.
if (_isFullScreen) {
Wakelock.disable();
WakelockPlus.disable();
_navigatorState.maybePop();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: _betterPlayerConfiguration.systemOverlaysAfterFullScreen);
Expand Down Expand Up @@ -250,7 +250,7 @@ class _BetterPlayerState extends State<BetterPlayer>
}

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

await Navigator.of(context, rootNavigator: true).push(route);
Expand All @@ -259,7 +259,7 @@ class _BetterPlayerState extends State<BetterPlayer>

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

await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: _betterPlayerConfiguration.systemOverlaysAfterFullScreen);
Expand Down
6 changes: 2 additions & 4 deletions lib/src/hls/hls_parser/hls_playlist_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,7 @@ class HlsPlaylistParser {
if (instreamId.startsWith('CC')) {
mimeType = MimeTypes.applicationCea608;
accessibilityChannel = int.parse(instreamId.substring(2));
} else
/* starts with SERVICE */ {
} else /* starts with SERVICE */ {
mimeType = MimeTypes.applicationCea708;
accessibilityChannel = int.parse(instreamId.substring(7));
}
Expand Down Expand Up @@ -830,8 +829,7 @@ class HlsPlaylistParser {
if (methodNone == method) {
currentSchemeDatas.clear();
cachedDrmInitData = null;
} else
/* !METHOD_NONE.equals(method) */ {
} else /* !METHOD_NONE.equals(method) */ {
fullSegmentEncryptionIV = _parseStringAttr(
source: line,
pattern: regexpIv,
Expand Down
108 changes: 70 additions & 38 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -57,6 +65,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
dbus:
dependency: transitive
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -109,22 +125,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.15.4"
intl:
http:
dependency: transitive
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
name: http
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
js:
version: "1.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.19.0"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -189,6 +213,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.12.0"
package_info_plus:
dependency: transitive
description:
name: package_info_plus
sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
url: "https://pub.dev"
source: hosted
version: "8.0.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e
url: "https://pub.dev"
source: hosted
version: "3.0.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -330,6 +370,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.0"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
version: "1.3.2"
vector_math:
dependency: transitive
description:
Expand All @@ -354,54 +402,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.2.1"
wakelock:
wakelock_plus:
dependency: "direct main"
description:
name: wakelock
sha256: "769ecf42eb2d07128407b50cb93d7c10bd2ee48f0276ef0119db1d25cc2f87db"
url: "https://pub.dev"
source: hosted
version: "0.6.2"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
sha256: "047c6be2f88cb6b76d02553bca5a3a3b95323b15d30867eca53a19a0a319d4cd"
name: wakelock_plus
sha256: "14758533319a462ffb5aa3b7ddb198e59b29ac3b02da14173a1715d65d4e6e68"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
wakelock_platform_interface:
version: "1.2.5"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
sha256: "1f4aeb81fb592b863da83d2d0f7b8196067451e4df91046c26b54a403f9de621"
name: wakelock_plus_platform_interface
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
sha256: "1b256b811ee3f0834888efddfe03da8d18d0819317f20f6193e2922b41a501b5"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
wakelock_windows:
version: "1.2.1"
web:
dependency: transitive
description:
name: wakelock_windows
sha256: "857f77b3fe6ae82dd045455baa626bc4b93cb9bb6c86bf3f27c182167c3a5567"
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
version: "0.5.1"
win32:
dependency: transitive
description:
name: win32
sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "5.5.1"
xdg_directories:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.3
wakelock: ^0.6.2
wakelock_plus: ^1.2.5
pedantic: ^1.11.1
meta: ^1.3.0
flutter_widget_from_html_core: ^0.15.1
Expand Down

0 comments on commit 3e63854

Please sign in to comment.