diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 21695e9e..d67f9b66 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -218,7 +218,10 @@ class _VideoDetailPageState extends State @override void didChangeAppLifecycleState(AppLifecycleState lifecycleState) { - if (lifecycleState == AppLifecycleState.inactive && autoPiP) { + var routePath = Get.currentRoute; + if (lifecycleState == AppLifecycleState.inactive && + autoPiP && + routePath.startsWith('/video')) { floating.enable( aspectRatio: Rational( videoDetailController.data.dash!.video!.first.width!, diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 4d4d1a9b..17f461ac 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1,6 +1,7 @@ // ignore_for_file: avoid_print import 'dart:async'; +import 'dart:io'; import 'dart:typed_data'; import 'package:easy_debounce/easy_throttle.dart'; @@ -380,8 +381,10 @@ class PlPlayerController { // 解除倍速限制 await pp.setProperty("af", "scaletempo2=max-speed=8"); // 音量不一致 - await pp.setProperty("volume-max", "100"); - await pp.setProperty("ao", "audiotrack,opensles"); + if (Platform.isAndroid) { + await pp.setProperty("volume-max", "100"); + await pp.setProperty("ao", "audiotrack,opensles"); + } // 音轨 if (dataSource.audioSource != '' && dataSource.audioSource != null) { @@ -443,10 +446,14 @@ class PlPlayerController { Duration seekTo = Duration.zero, }) async { // 设置倍速 - if (_playbackSpeed.value != 1.0) { - await setPlaybackSpeed(_playbackSpeed.value); - } else { + if (videoType.value == 'live') { await setPlaybackSpeed(1.0); + } else { + if (_playbackSpeed.value != 1.0) { + await setPlaybackSpeed(_playbackSpeed.value); + } else { + await setPlaybackSpeed(1.0); + } } getVideoFit(); // if (_looping) {