feat: 调节进度时清空弹幕

This commit is contained in:
orz12
2024-07-12 23:24:46 +08:00
parent 7b5e695a7b
commit d588f329af

View File

@@ -806,6 +806,7 @@ class PlPlayerController {
/// 拖动进度条调节时,不等待第一帧,防止抖动 /// 拖动进度条调节时,不等待第一帧,防止抖动
await _videoPlayerController?.stream.buffer.first; await _videoPlayerController?.stream.buffer.first;
} }
danmakuController?.clear();
await _videoPlayerController?.seek(position); await _videoPlayerController?.seek(position);
// if (playerStatus.stopped) { // if (playerStatus.stopped) {
// play(); // play();
@@ -818,6 +819,7 @@ class PlPlayerController {
//_timerForSeek = null; //_timerForSeek = null;
if (duration.value.inSeconds != 0) { if (duration.value.inSeconds != 0) {
await _videoPlayerController?.stream.buffer.first; await _videoPlayerController?.stream.buffer.first;
danmakuController?.clear();
await _videoPlayerController?.seek(position); await _videoPlayerController?.seek(position);
// if (playerStatus.status.value == PlayerStatus.paused) { // if (playerStatus.status.value == PlayerStatus.paused) {
// play(); // play();