-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.html
70 lines (64 loc) · 2.08 KB
/
player.html
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
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Player</title>
<meta name="robots" content="noindex, nofollow" />
<meta name="referrer" content="never" />
<meta name="referrer" content="no-referrer" />
<style>
html,
body {
width: 100%;
height: 100%;
margin: auto;
overflow: hidden;
background: #000000;
}
</style>
</head>
<body>
<iframe width="100%" height="100%" frameBorder="0" id="mse"></iframe>
<video id="vidt" width="100%" height="100%"controls>
<img id="vidi" src="Icon.jpg">
<source id="vidf" src="" type="video/mp4">
</video>
<script>
//https://www.mp4upload.com/embed-pwwuv53wq83s.html
//68747470733A2F2F7777772E6D703475706C6F61642E636F6D2F656D6265642D7077777576353377713833732E68746D6C
function getThumbnailUrl(videoUrl) {
// Usa una expresión regular para extraer el dominio y el ID del video
const urlMatch = videoUrl.match(/^(https:\/\/[^\/]+)\/v2\/([^\/]+)\.mp4/);
if (urlMatch && urlMatch[1] && urlMatch[2]) {
// Extrae el dominio y el ID del video
const baseUrl = urlMatch[1];
const videoId = urlMatch[2];
// Construye la URL de la miniatura usando el dominio extraído
const thumbnailUrl = `${baseUrl}/thumbs/${videoId}.jpg`;
return thumbnailUrl;
} else {
// Si no se puede extraer el ID del video, devuelve un mensaje de error
throw new Error('No se pudo extraer el dominio o el ID del video.');
}
}
function hex2a(hexx) {
var hex = hexx.toString();//force conversion
var str = '';
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
return str;
}
var file = window.location.hash.split('#')[1];
file = hex2a(file); // returns '2460'
console.log(file);
if (file.includes(".mp4")){
vidf.src=file
vidt.poster = getThumbnailUrl(file)
vidi.src = vidt.poster;
mse.remove();
}else {
mse.src=file
}
</script>
</body>
</html>