forked from BunyaminEfe/php-mp4-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall.php
160 lines (125 loc) · 3.8 KB
/
all.php
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="mtv.css">
<script src="sfx.js"></script>
<script>
<?php
$videolar_ad=array();
$ilk="";
$videolar_klasor=opendir("videolar");
while($video=readdir($videolar_klasor)) {
if($video!="."&&$video!="..")
{
if($ilk == "")
{
array_push($videolar_ad,$video);
shuffle($videolar_ad);
}
else
{
array_push($videolar_ad,$video);
shuffle($videolar_ad);
}
}
}
closedir($videolar_klasor);
$toplam=count($videolar_ad);
$son= $toplam-1;
$dosyalar="var videos=new Array(";
for($sira=0;$sira<$toplam; $sira++)
{
$video_ad= "videolar/". $videolar_ad[$sira];
if($sira!=$son)
{
$dosyalar_ek="\"".$video_ad."\",";
}
else
{
$dosyalar_ek="\"".$video_ad."\");";
}
$dosyalar.=$dosyalar_ek;
}
echo $dosyalar ?>
var currentVideo = 0;
function nextVideo() {
videoPlayer = document.getElementById("play-video")
videoPlayer.removeEventListener('ended',nextVideo,false);
videoPlayer.src = videos[currentVideo];
videoPlayer.play()
currentVideo = (currentVideo + 1) % videos.length
videoPlayer.addEventListener('ended', nextVideo,false);
}
function ooops() {
console.log(document.getElementById("play-video").error.code)
}
</script>
</head>
<body>
<header>
<h1>Here's a big tune for you:</h1>
</header>
<main>
<section>
<div class="video-player">
<video class="videom" id="play-video" controls autobuffer></video>
</div>
<script>
document.getElementById("play-video").addEventListener('error', ooops,false);
function ooops() {
console.log(document.getElementById("play-video").error)
}
nextVideo()
var elem = document.getElementById("video-player");
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
</script>
</section>
<section>
<script>
function beep() {
var audio = document.getElementById("beep");
audio.play();
}
function horn() {
var audio = document.getElementById("horn");
audio.play();
}
function laser() {
var audio = document.getElementById("laser");
audio.play();
}
function rewind() {
var audio = document.getElementById("rewind");
audio.play();
var bekind = document.getElementById('play-video');
bekind.pause();
bekind.currentTime = 0;
bekind.load();
}
function gun() {
var audio = document.getElementById("gun");
audio.play();
}
</script>
<p><input type="button" value="horn" onclick="horn()"> <audio id="horn" src="sfx/horn.wav"></audio>
<input type="button" value="gunshot" onclick="gun()"> <audio id="gun" src="sfx/gun.wav"></audio>
<input type="button" value="beep" onclick="beep()"> <audio id="beep" src="sfx/beep.wav"></audio>
<input type="button" value="laser" onclick="laser()"> <audio id="laser" src="sfx/laser.wav"></audio>
<input type="button" value="rewind" onclick="rewind()"> <audio id="rewind" src="sfx/rewind.wav"></audio>
</p>
<P>* tip: use picture-in-picture to use the sound effects on mobile</P>
<?php include 'stats.php';?>
</section>
</main>
<?php include 'footer.php';?>
</body>
</html>