// the find
feross/yt-player
Simple, robust, blazing-fast YouTube Player API
A thin wrapper around the YouTube IFrame Player API that gives you a normal event emitter and a saner method-based interface instead of YouTube's callback-based global API. Useful if you need programmatic control over embedded YouTube playback (custom controls, playlists, analytics) and don't want to hand-roll the IFrame API boilerplate.
Genuinely tiny (3.14kb gzipped) with no dependencies, so it won't drag anything into your bundle. Queues API calls until both the IFrame API script and the player instance are ready, which removes a real class of race-condition bugs people hit with the raw API. Adds a 'timeupdate' event that YouTube's API doesn't provide natively, and separates fatal player errors from per-video 'unplayable' errors, which the raw API also conflates.
Last push was October 2023 and it's a single maintainer (feross) project with no recent activity, so don't expect fixes if YouTube changes IFrame API behavior. No TypeScript types shipped or in DefinitelyTyped as far as the repo shows, so you're on your own for type safety. It's a light wrapper, not a real abstraction — you still have to know the underlying YouTube playerVars and quality-level semantics since it just passes options through. No React/Vue component wrapper, so integrating into a component framework means writing your own lifecycle glue around the imperative API.