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
<!DOCTYPE html>
<html>
	<head>
		<title>CS50 Live</title>
		<script type="text/javascript">
			window.streamname = "cs50";
			function chooseraster(raster)
			{
				if ($("#dvr").attr("checked"))
				{
					if (raster == "choose")
						alert("To use DVR functionality, you must choose a raster size");
					else
						window.location = "embed.html?dvr=true&streamname=" + window.streamname + "&raster=" + raster;
				}
				else
				{
					if (raster == "choose")
					{
						window.location = "embed.html?streamname=" + window.streamname;
					}
					else
					{
						window.location = "embed.html?streamname=" + window.streamname + "&raster=" + raster;
					}
				}
			}

			function toggle_dvr()
			{
				if ($("#dvr").attr("checked"))
				{
					$("#choose").slideUp();
				}
				else
				{
					$("#choose").slideDown();
				}
			}
		</script>
		<script type="text/javascript" src="//code.jquery.com/jquery-1.8.3.min.js"></script>

	</head>
	<body>
		<div id="container_div">
			<h4>Please choose your viewing experience:</h4>
			
			<div id="dvr_div">
				<p>DVR functionality?</p>
				<input type="checkbox" name="dvr" id="dvr" onclick="toggle_dvr()" />
			</div>
			<div id="raster_div">
				<ul>
					<li><button type="button" onclick="chooseraster('720p')" id="720p">720p</button></li>
					<li><button type="button" onclick="chooseraster('360p')" id="360p">360p</button></li>
					<li><button type="button" onclick="chooseraster('160p')" id="160p">160p</button></li>
					<li id="choose"><button type="button" onclick="chooseraster('choose')">Choose for me based on my connection</button></li>
				</ul>
			</div>
		</div>
	</body>
</html>