Skip to content

Commit

Permalink
resolved issue with screen turning off during video playback
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrinzigmundv committed Sep 11, 2023
1 parent f6dd36e commit 39fe2c4
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 3 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 20
targetSdkVersion 33
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.5.0"
multiDexEnabled true
}
signingConfigs {
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/channelpage-iptv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:video_player/video_player.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

import 'package:digilogtv/services/storage.dart';

Expand Down Expand Up @@ -49,6 +50,7 @@ class _ChannelPageIPTVState extends State<ChannelPageIPTV> {
@override
void initState() {
super.initState();
WakelockPlus.enable();
_videoPlayerController = VideoPlayerController.networkUrl(
Uri.parse(storage.channels.channelList[index].link))
..initialize().then((_) {
Expand All @@ -59,6 +61,7 @@ class _ChannelPageIPTVState extends State<ChannelPageIPTV> {

@override
void dispose() async {
WakelockPlus.disable();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]);
_videoPlayerController.dispose();
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/channelpage-youtube.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

import 'package:digilogtv/services/storage.dart';

Expand All @@ -28,10 +29,12 @@ class _ChannelPageYouTubeState extends State<ChannelPageYouTube> {
@override
void initState() {
super.initState();
WakelockPlus.enable();
}

@override
void dispose() {
WakelockPlus.disable();
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
super.dispose();
}
Expand Down
4 changes: 4 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
import FlutterMacOS
import Foundation

import package_info_plus
import shared_preferences_foundation
import wakelock_plus

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
}
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/1.5.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Resolved issue with screen turning off during video playback
48 changes: 48 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
dbus:
dependency: transitive
description:
name: dbus
sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263"
url: "https://pub.dev"
source: hosted
version: "0.7.8"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -304,6 +312,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.15.4"
http:
dependency: transitive
description:
name: http
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -424,6 +440,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: transitive
description:
name: package_info_plus
sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -717,6 +749,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.15"
wakelock_plus:
dependency: "direct main"
description:
name: wakelock_plus
sha256: aac3f3258f01781ec9212df94eecef1eb9ba9350e106728def405baa096ba413
url: "https://pub.dev"
source: hosted
version: "1.1.1"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "40fabed5da06caff0796dc638e1f07ee395fb18801fbff3255a2372db2d80385"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
watcher:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: digilogtv
description: A free and open-source TV news app, inspired by Linux Mint's Hypnotix.
publish_to: 'none'
version: 1.0.0
version: 1.5.0

environment:
sdk: '>=3.1.0 <4.0.0'
Expand All @@ -17,6 +17,7 @@ dependencies:
mobx_codegen: ^2.3.0
shared_preferences: ^2.2.0
video_player: ^2.7.1
wakelock_plus: ^1.1.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 39fe2c4

Please sign in to comment.