Added an AudioPreloader React component to preload the /hohoho.mp3 audio file for notifications, and included it in the app layout. Also updated _document.tsx to add a preload link for the audio file. Added yt-dlp.exe binary to the repository.
28 lines
517 B
TypeScript
28 lines
517 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
|
|
/**
|
|
* Preloads the notification audio file to ensure it's ready when needed
|
|
*/
|
|
export function AudioPreloader() {
|
|
useEffect(() => {
|
|
// Preload the audio file
|
|
const audio = new Audio('/hohoho.mp3')
|
|
audio.preload = 'auto'
|
|
|
|
// Try to load it immediately
|
|
audio.load().catch(err => {
|
|
console.log('Audio preload failed (non-critical):', err)
|
|
})
|
|
|
|
return () => {
|
|
// Cleanup
|
|
audio.src = ''
|
|
}
|
|
}, [])
|
|
|
|
return null
|
|
}
|
|
|