react-ambilight
v2.0.0
Published
Compatibility package for react-ambilight 1.x. Re-exports the YouTube Ambilight component from @videoglow/react-youtube.
Maintainers
Readme
react-ambilight
Compatibility package for react-ambilight 1.x. Version 2 keeps the 1.x
component API and implements it on top of
@videoglow/react-youtube.
New projects should install @videoglow/react-youtube directly.
Live examples and documentation: https://videoglow.brunosilva.io
Install
# npm
npm install react-ambilight
# pnpm
pnpm add react-ambilight
# yarn
yarn add react-ambilight
# bun
bun add react-ambilightReact 18.2 and 19 (React 16 and 17 are no longer supported).
Usage (unchanged)
import { VideoAmbilight } from 'react-ambilight'
import 'react-ambilight/dist/style.css' // optional; the file is now empty
export default function App() {
return <VideoAmbilight videoId="dQw4w9WgXcQ" />
}className and the classNames object (videoWrapper, ambilightWrapper,
aspectRatio, ambilight, ambilightVideo) are honored as before.
What changed in 2.0
- Synchronization no longer seeks on every animation frame. Drift is checked
once per second and corrected only above 0.25 s. Tune it through
@videoglow/react-youtubeif needed. - Players and listeners are destroyed on unmount. Strict Mode leaves one pair of players.
youtube-playeris no longer a dependency.PlayerStates,YouTubePlayer,CustomEvent,EventTypeandRecursiveVoidare exported as deprecated aliases of the typed@videoglow/youtubeAPI.
See the migration guide.
License
MIT
