aboutsummaryrefslogtreecommitdiffstats
path: root/examples/tg16/web/stream.gathering.org/index.html
blob: 9a3670ca2911f5bb7d0596c807f8002bad6cabe9 (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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>The Gathering 2016 Streams</title>

	<!-- Mobile specific
	---------------------->
	<meta name="viewport" content="width=device-width, initial-scale=0.35">

	<!-- CSS specifics
	-------------------->
	<link rel="stylesheet" href="./resources/css/normalize.css">
	<link rel="stylesheet" href="./resources/css/skeleton.css">
	<link rel="stylesheet" href="./resources/css/core.css">
	<link rel="stylesheet" href="./resources/css/button-styles.css">

	<style type="text/css">
		.vjs-big-play-button {
			top:0;
			left:0;
			right:0;
			bottom:0;
			margin:auto;
		}
	</style>

	<!-- JavaScript specifics
	---------------------------->
	<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
	<link href="//vjs.zencdn.net/5.8/video-js.min.css" rel="stylesheet">
	<script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
	
	<script type="text/javascript">
		function swapVideo (url) {
			window.location = '/?url=' + encodeURIComponent(url);//window.btoa(url);
		}

		var _float = true;

		function animateFloat() {
			if(_float) {
				$("#floater").animate({top: '-=20px'}, "slow");
				$("#floater").animate({top: '+=20px'}, "slow", animateFloat);
			}
		}

		function toggleAnimation() {
			$('#bubble').stop().fadeOut( 400 );
			if(_float) {
				_float = false;
				$("#floater").delay(800).animate({top: '172px'}, "slow");
			} else {
				_float = true;
				animateFloat();
			}
		}

		$(document).ready(function() {
			$("#floater").click(function() {
				toggleAnimation();
			});
			$("#bubble").click(function() {
				toggleAnimation();
			});
			
			//animateFloat();
			//$( "#bubble" ).delay( 5000 ).fadeOut( 400 );
		});
	</script>

	<style type="text/css">
		#floater {
			position: absolute;
			top: 172px;
			right: 0px;
			width: 531px;
			height: 396px;
			//background-image: url('/resources/images/floater.svg');
			background-size: cover;
		}

		#bubble {
			position: absolute;
			visibility: hidden;
			top: 62px;
			right: 170px;
			width: 200px;
			height: 25px;
			color: #000000;
			cursor: pointer;
		}
	</style>

<!-- creative, event och game -->
</head>
<body>
	<div id="header">
		<img src="resources/images/thegathering.png" width="400">
	</div>
	<div class="section">
		<div class="container">
			<div class="row">
				<div class="twelve columns" style="margin-top: 85px;">
				<h1>Takk for i år!</h1>
				<h3 style="color: grey;"><3 Streamteam</h3>
				</div>
			</div>
		</div>
	</div>


<script src="//vjs.zencdn.net/5.8/video.js"></script>
<script src="./resources/js/videojs-contrib-hls.js"></script>
<script>

// GOOGLE CAST

var current_media;
var session;

function show_castposter() {
	stop_loader();
	castposter.style.display = 'block';
	loader.style.display = 'none';
	video.style.display = 'none';
}

function hide_castposter() {
	castposter.style.display = 'none';
	loader.style.display = 'none';
	video.style.display = 'inline';
}

function stop_casting() {
	hide_castposter();
	if (current_media) {
		var media = current_media;
		current_media = null;
		media.stop();
	}
	if (session) {
		session.stop();
		session = null;
	}
}

function cast_current_video() {
	if (session === undefined || selected_stream === undefined) {
		return;
	}
	var title = streams[selected_stream].name;
	var url = streams[selected_stream].url;
	document.getElementById('casttarget').textContent = session.receiver.friendlyName;
	show_castposter();
	video.pause();
	// If we are already casting this, do nothing.
	if (current_media && current_media.media.contentId === url) {
		console.log("Already casting " + url + " to " + session.receiver.friendlyName + " (" + current_media.playerState + ")");
		return;
	}
	if (current_media) {
		current_media = null;  // Signal to on_media_status_update.
	}
	var media_info = new chrome.cast.media.MediaInfo(url, "video/mp4");
	media_info.metadata = new chrome.cast.media.GenericMediaMetadata();
	media_info.metadata.title = global_title;  //  + ': ' + title;
	var request = new chrome.cast.media.LoadRequest(media_info);
	session.loadMedia(request,
		on_media_discovered.bind(this, 'loadMedia'),
		on_media_error);
}

var techOrder = ["html5", "flash"];
if (navigator.userAgent.match(/Trident|Edge|OPR/)) {
	console.log("hit!");
        techOrder = ["flash", "html5"];
	//var video = document.getElementById('video');
	//video.src = "http://bleh";
}
var player = videojs('stream', {
  techOrder: techOrder
});
player.play();
</script>
</body>
</html>