-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHome.html
More file actions
71 lines (64 loc) · 2.15 KB
/
Copy pathHome.html
File metadata and controls
71 lines (64 loc) · 2.15 KB
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
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video Player</title>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color:#000000;
}
#videoPlayer {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<video id="videoPlayer" autoplay muted>
<source id="videoSource" src="" type="video/mp4">
Your browser does not support the video tag.
</video>
<script>
// Function to set the video source and handle looping
function setVideoSource(videoPath) {
var video = document.getElementById('videoPlayer');
var source = document.getElementById('videoSource');
// Set new video source
source.src = videoPath;
video.load();
video.play();
// Loop playback until a new video is set
video.onended = function() {
setVideoSource(videoPath); // Loop the same video
};
}
// Initial video source setting
setVideoSource('');
// Toggle fullscreen function
function toggleFullscreen() {
var video = document.getElementById('videoPlayer');
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.mozRequestFullScreen) { /* Firefox */
video.mozRequestFullScreen();
} else if (video.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
video.webkitRequestFullscreen();
} else if (video.msRequestFullscreen) { /* IE/Edge */
video.msRequestFullscreen();
}
}
// Listen for messages from Python to change video
window.addEventListener('message', function(event) {
if (event.data.type === 'change_video') {
setVideoSource(event.data.videoPath);
}
});
</script>
</body>
</html>