From 878246260301fd1f67e136e6004ec8e6b786ef07 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 21 Oct 2023 21:00:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=AE=B0=E5=BF=86=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/controller.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 537dde58..c44dd99b 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -437,11 +437,6 @@ class PlPlayerController { Future _initializePlayer({ Duration seekTo = Duration.zero, }) async { - // 跳转播放 - if (seekTo != Duration.zero) { - await this.seekTo(seekTo); - } - // 设置倍速 if (_playbackSpeed.value != 1.0) { await setPlaybackSpeed(_playbackSpeed.value); @@ -453,6 +448,11 @@ class PlPlayerController { // await setLooping(_looping); // } + // 跳转播放 + if (seekTo != Duration.zero) { + await this.seekTo(seekTo); + } + // 自动播放 if (_autoPlay) { await play(); @@ -542,7 +542,6 @@ class PlPlayerController { } _position.value = position; _heartDuration = position.inSeconds; - print('seek duration: $duration'); if (duration.value.inSeconds != 0) { if (type != 'slider') { /// 拖动进度条调节时,不等待第一帧,防止抖动 @@ -561,9 +560,9 @@ class PlPlayerController { if (duration.value.inSeconds != 0) { await _videoPlayerController!.stream.buffer.first; await _videoPlayerController?.seek(position); - if (playerStatus.status.value == PlayerStatus.paused) { - play(); - } + // if (playerStatus.status.value == PlayerStatus.paused) { + // play(); + // } t.cancel(); _timerForSeek = null; }