From 454951da8bc28c4a7998f7e28dd12438d1b2ce14 Mon Sep 17 00:00:00 2001 From: MemRelay Date: Fri, 13 Nov 2026 02:14:57 +0800 Subject: [PATCH] =?UTF-8?q?create:=20MSE=20=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=EF=BC=9A=E6=8B=96=E5=8A=A8=E6=97=B6=E7=9A=84=20waiting=20?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=BD=93=E4=BD=9C=E6=92=AD=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: memory-save:v380-mse-waiting-experience-2026-11-13-0217 MemRelay-Resource: cc4f7ee7-b994-4304-b6c3-ef95ad5d7372 --- ...E 播放器:拖动时的 waiting 不能当作播完.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/MSE 播放器:拖动时的 waiting 不能当作播完.md diff --git a/projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/MSE 播放器:拖动时的 waiting 不能当作播完.md b/projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/MSE 播放器:拖动时的 waiting 不能当作播完.md new file mode 100644 index 0000000..cbd980b --- /dev/null +++ b/projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/MSE 播放器:拖动时的 waiting 不能当作播完.md @@ -0,0 +1,22 @@ +--- +title: MSE 播放器:拖动时的 waiting 不能当作播完 +type: experience +permalink: main/projects/9b6e62e6-fd85-4580-a304-bbb9761075c7/mse-播放器拖动时的-waiting-不能当作播完 +stable_id: cc4f7ee7-b994-4304-b6c3-ef95ad5d7372 +scope: project +memory_type: experience +project_id: 9b6e62e6-fd85-4580-a304-bbb9761075c7 +usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 +status: active +revision: 1 +request_id: v380-mse-waiting-experience-2026-11-13-0217 +created_at: '2026-11-12T18:14:53.281307+00:00' +updated_at: '2026-11-12T18:14:53.281307+00:00' +tags: +- v380 +- frontend +- mse +--- + +问题:缓存好的录像在已缓冲范围内拖动时,浏览器会短暂触发 waiting。早期实现在 waiting 里发现“后面没有数据”就当作播完,导致一拖动就跳到下一段。 +解决:onWaiting 先判断正在加载或当前时间已缓冲就直接返回;否则跳到下一个已缓冲区间;只有 MediaSource 已 ended 且当前时间贴近 duration 时才当作播完。正常播完靠 video 的 ended 事件。另外 canplay/playing 时清空状态文字,避免暂停时拖动留下“正在缓冲”。 \ No newline at end of file