fix: prevent video from auto-playing when it finishes loading#1316
fix: prevent video from auto-playing when it finishes loading#1316
Conversation
WalkthroughReplaces the previous play().catch / loadeddata branching with a canplay-based load flow in the downloader module, adding explicit handleCanPlay and handleError handlers, an explicit video.load() call, and updated one-time event listener registration and cleanup. No public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/effects-core/src/downloader.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/effects-core/src/downloader.ts (1)
299-300: Consider translating the comment to English.The implementation correctly prevents autoplay by using explicit
load()without callingplay(). However, the Chinese comment could be translated to English for consistency with the rest of the codebase.Apply this diff to translate the comment:
- // 显式触发视频加载 + // Explicitly trigger video loading video.load();
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/effects-core/src/downloader.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/effects-core/src/downloader.ts (1)
296-297: Past review concern addressed correctly.The event listeners now use
{ once: true }, which ensures automatic cleanup and avoids the previous capture-mismatch issue. The cross-removal pattern in the handlers provides additional safety.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.