
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
video-ambilight
Advanced tools
🌈 A lightweight React component for creating an Ambilight effect with YouTube videos.
A lightweight React component to create a stunning Ambilight effect for YouTube videos. This package is inspired by the visual effects seen in modern video presentations, adding an immersive ambient glow that synchronizes with your content.
Install the package via npm:
npm install video-ambilight
or using Yarn:
yarn add video-ambilight
Here's a quick example of how to use the component:
import React from 'react'
import { VideoAmbilight } from 'video-ambilight'
export default function App() {
return (
<div style={{ maxWidth: '800px', margin: '0 auto' }}>
<VideoAmbilight videoId='dQw4w9WgXcQ' />
</div>
)
}
Customize the component by passing a className
or classNames
object with custom class names:
// tailwind example
import React from 'react'
import { VideoAmbilight } from 'video-ambilight'
export default function App() {
return (
<div className='max-w-4xl mx-auto'>
<VideoAmbilight
videoId='dQw4w9WgXcQ'
classNames={{
videoWrapper: 'relative',
ambilightWrapper: 'absolute inset-0',
aspectRatio: 'aspect-w-16 aspect-h-9',
ambilight: 'bg-black opacity-50',
ambilightVideo: 'hidden',
}}
/>
</div>
)
}
Prop | Type | Description | Required |
---|---|---|---|
videoId | string | The YouTube video ID to display. | Yes |
className | string | Optional class name for styling. | No |
classNames | object | Optional object for custom class names. | No |
The classNames
object can have the following properties:
Property | Type | Description |
---|---|---|
videoWrapper | string | Class name for the video wrapper. |
ambilightWrapper | string | Class name for the ambilight wrapper. |
aspectRatio | string | Class name for the aspect ratio container. |
ambilight | string | Class name for the ambilight effect container. |
ambilightVideo | string | Class name for the ambilight video container. |
Check out a live demo of the Ambilight effect: Live Demo
The component leverages the YouTube IFrame API to create two synchronized players:
Contributions are welcome! If you encounter any issues or have suggestions, feel free to open an issue or submit a pull request.
git checkout -b feature-name
.git commit -m 'Add feature-name'
.git push origin feature-name
.This project is licensed under the MIT License. See the LICENSE file for details.
Inspired by the Ambilight effect seen during the Next.js Conf presentations.
💻 Made with ❤️ by Bruno Silva
FAQs
🌈 A lightweight React component for creating an Ambilight effect with YouTube videos.
We found that video-ambilight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.