summaryrefslogtreecommitdiff
path: root/www/index.php
blob: 23cc3ffeea9cc324ff299432793593970e36d490 (plain)
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
<!doctype html>
<html>
<head>
	<title>A random youtube video!</title>
	<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'>
	<link rel="stylesheet" href="/static/style.css">
	<link rel="stylesheet" href="/static/content.css">
	<link rel="stylesheet" href="/static/noscript.css">
	<script type='text/javascript'>

		function get_random_video(){
			r = new XMLHttpRequest();
			r.onreadystatechange=function(){
				if(r.readyState == 4 && r.status == 200){
					if(r.responseText == ""){
						location.reload();
					} else {
						document.getElementById('middle').innerHTML=r.responseText;
					}
				}
			}
			r.open('GET', '/youtube.php', true);
			r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			r.send();
		}
		<?php /*
		function prep_player(){
			r = new XMLHttpRequest();
			r.onreadystatechange=function(){
				if(r.readyState == 4 && r.status == 200){
				document.getElementById('test1').innerHTML=r.responseText;
				}
			}
			r.open('POST', 'print_video.php', true);
			r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			r.send('mime=<?php echo $mime; ?>', 'vname=<?php echo $filename?>');
		<?php /*
			r.send('vid=<?php echo $vid; ?>', mime='<?php echo $mime; ?>', 'vname=<?php echo $filename?>');
		r.send('vid=<?php echo $_GET["vid"]; ?>', 'strm=1'); */ ?>
	</script>
</head>

<body onload=get_random_video()>
	<?php require_once("static/header.html"); ?>
	<?php require_once("static/noscript.html"); ?>
	<div align='center'>
		<div id='middle'>
			<h1>Fetching a random youtube video!</h1>
			<br>
			<p>One moment please.</p>
			<br>
			<br>
			<img src='/static/ajax-loader.gif'>
		</div>
	</div>
	<?php require_once("static/footer.php"); ?>