diff --git a/src/components/watch/embed-player.tsx b/src/components/watch/embed-player.tsx index dee937e..6b0aee3 100644 --- a/src/components/watch/embed-player.tsx +++ b/src/components/watch/embed-player.tsx @@ -1,11 +1,22 @@ 'use client'; import React from 'react'; +import { + FacebookShareButton, + TwitterShareButton, + LinkedinShareButton, + FacebookIcon, + TwitterIcon, + LinkedinIcon, +} from 'react-share'; interface EmbedPlayerProps { url: string; } function EmbedPlayer(props: EmbedPlayerProps) { + const ref = React.useRef(null); + const currentUrl = typeof window !== 'undefined' ? window.location.href : ''; + React.useEffect(() => { if (ref.current) { ref.current.src = props.url; @@ -16,9 +27,7 @@ function EmbedPlayer(props: EmbedPlayerProps) { return () => { iframe?.removeEventListener('load', handleIframeLoaded); }; - }, []); - - const ref = React.useRef(null); + }, [props.url]); const handleIframeLoaded = () => { if (!ref.current) { @@ -44,8 +53,20 @@ function EmbedPlayer(props: EmbedPlayerProps) { style={{ opacity: 0 }} referrerPolicy="no-referrer-when-downgrade" /> +
+ + + + + + + + + +
); } export default EmbedPlayer; +