Skip to content

Conversation

@harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw commented Jan 18, 2026

πŸ”— Linked issue

Resolves #339, Resolves #297, Resolves #561

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Multiple YouTube players on a page shared state incorrectly - clicking one would load ALL iframes. The component also had memory leaks (no cleanup on unmount) and layout transitions could cause playback failures.

Fixed by tracking each player's trigger state independently, adding proper cleanup via player.destroy(), and guarding against stale refs during async operations. Also reverted objectFit default from contain back to cover and made it configurable via new placeholderObjectFit prop.

<!-- New prop for non-16:9 videos like YouTube Shorts -->
<ScriptYouTubePlayer 
  video-id="abc123" 
  placeholder-object-fit="contain" 
/>

harlan-zw and others added 4 commits January 16, 2026 01:58
Combined commits:
- fix(plausible): use consistent window reference in clientInit stub
- Fix #339: clicking one player no longer loads all iframes
- Fix #297: guard against stale refs during layout transitions
- Fix #561: revert objectFit to cover, add placeholderObjectFit prop
- Add player cleanup on unmount to prevent memory leaks
- Fix duplicate head link keys
- Add missing api-change emit
- Add e2e test for multiple players

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
scripts-docs Error Error Jan 18, 2026 2:55am
scripts-playground Ready Ready Preview, Comment Jan 18, 2026 2:55am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 18, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/scripts/@nuxt/scripts@586

commit: 698010a

@harlan-zw harlan-zw merged commit dc4c7f4 into main Jan 18, 2026
9 of 10 checks passed
@harlan-zw harlan-zw deleted the youtube-bugs branch January 18, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants