-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
139 lines (115 loc) · 3.5 KB
/
index.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
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
<html>
<head>
<title>Chromecast Receivers - Launcher</title>
<link rel="stylesheet" type="text/css" href="common.css">
<link rel="icon" type="image/svg+xml" href="cast-icon.svg">
<style>
/* Center everything. */
body {
text-align: center;
}
#loading {
height: 10vh;
}
#instructions {
font-size: 3vh;
margin-bottom: 5vh;
}
#options {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
gap: 4vh;
}
.option {
border: 1px solid black;
width: 15vw;
min-width: 10em;
display: flex;
flex-direction: column;
}
.title {
font-size: 4vh;
}
.description {
font-size: 2vh;
margin-bottom: 2vh;
}
.launch {
/* Style the launch button to just be the icon. */
border: none;
background: none;
cursor: pointer;
/* Make it 10% of the view port height. */
height: 10vh;
/* Push it to the bottom of its container. */
margin-top: auto;
}
.launch img {
/* Fill the button size with the image. */
height: 100%;
}
#source {
margin-top: 10vh;
font-size: 2vh;
}
#source a {
color: black;
}
</style>
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
<script>
// Start a sender session so that the cast button will launch the right app.
window['__onGCastApiAvailable'] = function(isAvailable) {
if (isAvailable) {
// Hide the loading message and show the launch button.
document.getElementById('loading').classList.add('hidden');
document.getElementById('instructions').classList.remove('hidden');
document.getElementById('options').classList.remove('hidden');
}
};
function launch(appId) {
cast.framework.CastContext.getInstance().setOptions({
receiverApplicationId: appId,
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
});
cast.framework.CastContext.getInstance().requestSession();
}
</script>
</head>
<body>
<!-- A very brief message while loading. -->
<div id="loading">
Loading Chromecast APIs...
</div>
<!-- The launch buttons show even when there are no devices. -->
<div id="instructions" class="hidden">
Click the cast icon for any receiver to launch that receiver.
</div>
<div id="options" class="hidden">
<div class="option">
<div class="title">Speed Test</div>
<div class="description">Powered by OpenSpeedtest.com</div>
<button class="launch" onclick="launch('009EBD9B')"><img src="cast-icon.svg"></button>
</div>
<div class="option">
<div class="title">Print Cast SDK Version</div>
<div class="description">Print (and speak aloud, for speaker devices) the Cast SDK version.</div>
<button class="launch" onclick="launch('6889684F')"><img src="cast-icon.svg"></button>
</div>
<div class="option">
<div class="title">Print Cast Serial Number</div>
<div class="description">Print (and speak aloud, for speaker devices) the Cast serial number. (Linked here, not developed here.)</div>
<button class="launch" onclick="launch('39B1F81E')"><img src="cast-icon.svg"></button>
</div>
<div class="option">
<div class="title">Visualize Key Events <b>(NOT WORKING)</b></div>
<div class="description">See remote control key events on a Chromecast in realtime.</div>
<button class="launch" onclick="launch('C5091515')"><img src="cast-icon.svg"></button>
</div>
</div>
<div id="source">
<a href="https://github.com/joeyparrish/chromecast-receivers">Source Code</a>
</div>
</body>
</html>