Merge branch 'fix'

This commit is contained in:
guozhigq
2023-08-15 21:30:31 +08:00
2 changed files with 8 additions and 2 deletions

View File

@ -76,7 +76,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
videoDetailController.isShowCover.value = false; videoDetailController.isShowCover.value = false;
videoDetailController.loopHeartBeat(); videoDetailController.loopHeartBeat();
} else { } else {
videoDetailController.timer!.cancel(); if (videoDetailController.timer != null) {
videoDetailController.timer!.cancel();
}
// 播放完成停止 or 切换下一个 // 播放完成停止 or 切换下一个
if (status == PlayerStatus.completed) { if (status == PlayerStatus.completed) {
// 当只有1p或多p未打开自动播放时播放完成还原进度条展示控制栏 // 当只有1p或多p未打开自动播放时播放完成还原进度条展示控制栏
@ -98,6 +100,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
@override @override
void dispose() { void dispose() {
plPlayerController!.pause();
plPlayerController!.dispose(); plPlayerController!.dispose();
if (videoDetailController.timer != null) { if (videoDetailController.timer != null) {
videoDetailController.timer!.cancel(); videoDetailController.timer!.cancel();

View File

@ -540,7 +540,10 @@ class PlPlayerController {
/// 音量 /// 音量
Future<void> getCurrentVolume() async { Future<void> getCurrentVolume() async {
_currentVolume.value = await VolumeController().getVolume(); // mac try...catch
try {
_currentVolume.value = await VolumeController().getVolume();
} catch (_) {}
} }
Future<void> setVolume(double volumeNew, Future<void> setVolume(double volumeNew,