-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreceiver.html
88 lines (84 loc) · 3.1 KB
/
receiver.html
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
<!DOCTYPE html>
<html>
<head>
<!--
While this receiver doesn't have any text, it's important to know that
Chromecast defaults to a black background with black text. Changing that will
help your efforts.
We find that having everything fit in the HTML boxes tends to look nicer on TV
so, we also set overflow: hidden, which clips all flowing outside of boxes or
adding of scrollbars, which aren't useful on TV.
-->
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,700);
body {
font-family: "Droid Serif", serif;
color: #444;
line-height: 150%;
border: 0px;
margin: 0px;
width: 100%;
height: 100%;
overflow: hidden !important;
}
video {
width: 100%;
height: 100%;
margin: auto auto;
overflow: hidden !important;
}
.background {
background: center no-repeat url(background.webp);
}
<!--.logo {-->
<!--background-image: url(logo.webp);-->
<!--}-->
.progressBar {
background-color: rgb(3, 169, 244);
}
.splash {
background-image: url(background.webp);
}
.watermark {
background-image: url(watermark.webp);
background-size: 72px 72px;
}
</style>
<!--
Include the Receiver Library - Very important use our URL, don't attempt to
host this yourself.
-->
<script type="text/javascript"
src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js">
</script>
<title>CastMythTVPlayer</title>
</head>
<body>
<video id='video' />
<script type="text/javascript">
// Turn on debugging so that you can see what is going on. Please turn this off
// on your production receivers.
cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);
console.log('Starting receiver application');
window.mediaElement = document.getElementById('video');
// Create the media manager. This will handle all media messages by default.
window.mediaManager = new cast.receiver.MediaManager(window.mediaElement);
// Start the receiver manager
console.log('Starting receiver manager');
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
castReceiverManager.onSenderDisconnected = function (event) {
console.log("Sender disconnected");
if (window.castReceiverManager.getSenders().length == 0 &&
event.reason == cast.receiver.system.DisconnectReason.REQUESTED_BY_SENDER) {
window.close();
}
};
// The default inactivity is normally 10 seconds, since we are encouraging you
// to debug this receiver, we are setting it to 10 minutes. As setting a break
// point might inadvertently trigger a timeout. The purpose of the timer is to
// speed the recognition of disconnection of a sender. As the TCP/IP standard
// mechanisms can be quite slow.
castReceiverManager.start({maxInactivity: 600});
</script>
</body>
</html>