Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

delete utils function

lauirfb7d5f48eafa9
diff --git a/lib/pages/player/player_item.dart b/lib/pages/player/player_item.dart
index c8ee4d98..6ccf5059 100644
--- a/lib/pages/player/player_item.dart
+++ b/lib/pages/player/player_item.dart
@@ -133,13 +133,14 @@ class _PlayerItemState extends State<PlayerItem>
}
void play() {
- playerController.play();
+ playerTimer?.cancel();
playerTimer = getPlayerTimer();
+ playerController.play();
}
void pause(){
- playerController.pause();
playerTimer?.cancel();
+ playerController.pause();
}
void playOrPause() {
@@ -176,7 +177,7 @@ class _PlayerItemState extends State<PlayerItem>
}
void _handleTap() {
- if (Utils.isPC()) {
+ if (Utils.isDesktop()) {
playOrPause();
} else {
if (showPositioned) {
@@ -188,7 +189,7 @@ class _PlayerItemState extends State<PlayerItem>
}
void _handleDoubleTap(){
- if (Utils.isPC()) {
+ if (Utils.isDesktop()) {
enterOrExitFullScreen();
} else {
if (!showPositioned) {
diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart
index 62d3d7b4..6eadbf63 100644
--- a/lib/utils/utils.dart
+++ b/lib/utils/utils.dart
@@ -382,10 +382,7 @@ class Utils {
/// 判断是否为桌面设备
static bool isDesktop() {
- if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
- return true;
- }
- return false;
+ return Platform.isWindows || Platform.isMacOS || Platform.isLinux;
}
/// 判断设备是否为宽屏
@@ -406,10 +403,6 @@ class Utils {
return !isDesktop() && !isWideScreen();
}
- static bool isPC(){
- return Platform.isWindows || Platform.isMacOS || Platform.isLinux;
- }
-
/// 判断是否分屏模式 (android only)
static Future<bool> isInMultiWindowMode() async {
if (Platform.isAndroid) {