Skip to content

Conversation

@ibrahimcesar
Copy link
Owner

No description provided.

Ibrahim Cesar Nogueira Bevilacqua and others added 3 commits November 15, 2025 13:23
Fixes onPlaybackRateChange and onPlaybackQualityChange events by handling
additional properties in YouTube's infoDelivery postMessage events.

## What Changed

### Core Implementation (src/lib/index.tsx)
- Added handlers for `playbackRate` and `playbackQuality` in infoDelivery event
- YouTube sends these properties via the same infoDelivery events as state changes
- Events now fire when user changes speed or quality via ⚙️ settings button

### Documentation (README.md)
- Updated Event Compatibility Status table - both events now ✅ Verified Working
- Added testing instructions for ⚙️ settings button usage
- Enhanced Advanced Events section with practical examples
- Added new "Event Status Tracker Demo" section
- Updated Quick Start example to showcase new events
- Updated Core Features section to highlight all events verified

### Demo Updates (demo/pages/index.js)
- Event Status Tracker now properly marks playback rate/quality as fired
- Added testing instructions in UI
- Enhanced event handler logging

## Technical Details

YouTube's iframe postMessage API sends multiple event types via `infoDelivery`:
- `info.playerState` - player state changes (already handled)
- `info.playbackRate` - playback speed changes (NEW)
- `info.playbackQuality` - video quality changes (NEW)

The infoDelivery handler now checks for all three properties and calls the
appropriate callback handlers.

## Testing

1. Play video in Events demo
2. Click ⚙️ settings button in YouTube player
3. Change "Playback speed" → onPlaybackRateChange fires
4. Change "Quality" → onPlaybackQualityChange fires
5. Event Status Tracker shows ✅ for both events

## Event Status

All core events now fully tested and verified:
✅ onIframeAdded
✅ onReady
✅ onStateChange
✅ onPlay
✅ onPause
✅ onEnd
✅ onBuffering
✅ onPlaybackRateChange (NEW - now working)
✅ onPlaybackQualityChange (NEW - now working)
⚠️ onError (untested - requires invalid video)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Merged PR #213 which implements playback rate and quality change events.

Conflict resolution:
- src/lib/index.tsx: Resolved formatting conflict in iframe parameters
  - Kept double quotes for string literals (consistent with codebase style)
  - Kept multi-line formatting for better readability
  - Preserved origin parameter logic from both branches

All 51 tests passing ✅
Fixes NPM publication issue where packages were not appearing on the
public NPM registry despite successful workflow runs.

Changes:
- package.json: Remove GitHub Packages registry from publishConfig,
  keep only "access": "public" for scoped package publishing
- auto-release.yml: Explicitly configure npm registry using npm config
  for both NPM and GitHub Packages publish steps
- release.yml: Apply same explicit registry configuration for
  consistent dual publishing

Why this fixes the issue:
- Previous publishConfig forced all publishes to GitHub Packages
- Using --registry flag wasn't sufficient to override for scoped packages
- Now each workflow step explicitly configures the target registry
- This ensures packages publish to the correct registry every time

All 51 tests passing ✅
@ibrahimcesar ibrahimcesar merged commit 6ab4242 into main Nov 15, 2025
5 of 7 checks passed
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
ES Module 3.05 KB (0%)
CommonJS 3.02 KB (0%)
CSS 1.05 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants