2023-08-02 15:56:33 +02:00
|
|
|
import { extractYoutubeId } from "@lib/string.ts";
|
2023-08-02 01:58:03 +02:00
|
|
|
|
|
|
|
export const YoutubePlayer = ({ link }: { link: string }) => {
|
|
|
|
const id = extractYoutubeId(link);
|
|
|
|
return (
|
|
|
|
<iframe
|
2023-08-02 15:56:33 +02:00
|
|
|
class="mb-6"
|
2023-08-02 01:58:03 +02:00
|
|
|
width="100%"
|
|
|
|
height="400px"
|
|
|
|
src={`https://www.youtube-nocookie.com/embed/${id}`}
|
|
|
|
frameBorder="0"
|
|
|
|
allow="autoplay; encrypted-media"
|
|
|
|
allowFullScreen
|
|
|
|
>
|
|
|
|
</iframe>
|
|
|
|
);
|
|
|
|
};
|