aboutsummaryrefslogtreecommitdiff
path: root/src/app/movies/components/video_player.jsx
blob: 15db6a8aadd120e15c1f352b7f2b278ffe7ffd90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use client";

import styles from "../styles/video_player.module.css";
import { useState, useEffect } from "react";

export default function VIDEO_PLAYER({ id: id }) {
	const [frame, setFrame] = useState(null);

	useEffect(() => {
		make_player(`https://vidsrc.pro/embed/movie/${id}`);
	}, []);

	function make_player(url) {
		setFrame(
			<iframe
				src={url}
				referrerPolicy="origin"
				allowFullScreen
				height={500}
				className={styles.VideoPlayer}
			></iframe>
		);
	}

	return (
		<section className={styles.VideoContainer}>
			<div>
				<button
					onClick={() =>
						make_player(`https://vidsrc.pro/embed/movie/${id}`)
					}
				>
					Vidsrc.pro
				</button>
				<button
					onClick={() =>
						make_player(`https://blackvid.space/embed?tmdb=${id}`)
					}
				>
					Blackvid
				</button>
				<button
					onClick={() =>
						make_player(`https://vidsrc.to/embed/movie/${id}`)
					}
				>
					Vidsrc.to
				</button>
				<button
					onClick={() =>
						make_player(`https://vidsrc.icu/embed/movie/${id}`)
					}
				>
					Vidsrc.icu
				</button>
			</div>
			{frame}
		</section>
	);
}