mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-14 00:03:42 +08:00
23 lines
593 B
TypeScript
23 lines
593 B
TypeScript
'use client';
|
|
|
|
import { useEffect, useRef } from 'react';
|
|
import { usePlayerSettings } from '@/components/player/hooks/usePlayerSettings';
|
|
|
|
interface AdKeywordsInjectorProps {
|
|
keywords: string[];
|
|
}
|
|
|
|
export function AdKeywordsInjector({ keywords }: AdKeywordsInjectorProps) {
|
|
const { setAdKeywords } = usePlayerSettings();
|
|
const initialized = useRef(false);
|
|
|
|
useEffect(() => {
|
|
if (!initialized.current && keywords.length > 0) {
|
|
setAdKeywords(keywords);
|
|
initialized.current = true;
|
|
}
|
|
}, [keywords, setAdKeywords]);
|
|
|
|
return null;
|
|
}
|