-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.html
92 lines (81 loc) · 3.72 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
<!DOCTYPE html>
<html>
<head>
<title>Local Chromecast</title>
<link rel="stylesheet" type="text/css" href="static/demo.css">
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="static/helloVideos.js"></script>
<script type="text/javascript">
<!--
window.onload = function() {
mediaTitles = [ {% for item in media %}'{{ item }}', {% endfor %} ];
mediaURLs = [ {% for item in media %}'{{ media_path }}{{ item }}', {% endfor %} ];
console.log(mediaURLs);
}
-->
</script>
</head>
<body>
<div>
<div>
<h2 style="display:block">Local Chromecast</h2>
<p>Stream/Cast local media to your ChromeCast</p>
<div style="float:left; width:100%; margin:10px;">
<h3 style="display: inline-block">Choose a video to cast</h3>
</div>
<br>
<div style="width:80%; margin:10px;">
<div style="margin:0px; float:left; width: 40%;">
{% for item in media %}
{% if loop.first %}
<input type="radio" class="radio" checked name="media" onclick="selectMedia({{ loop.index0 }});">{{ item }}<br />
{% else %}
<input type="radio" class="radio" name="media" onclick="selectMedia({{ loop.index0 }});">{{ item }}<br />
{% endif %}
{% endfor %}
</div>
<div style="margin-top:60px; float:left; width:20%;">
<input class="vertical" type="range" min="0" max="100" step="1" onmouseup="setReceiverVolume(1-this.value/100,false);">
<div class="vertical" style="margin-top:50px">Volume control</div>
</div>
</div>
<div style=" margin:10px; float:left; display:block; width:90%;">
<button onclick="launchApp()">Launch app</button>
<button onclick="stopApp()">Stop app</button>
<br>
<button onclick="loadMedia()">Load media</button>
<button id="playpauseresume" onclick="playMedia()">Play</button>
<button onclick="stopMedia()">Stop media</button>
<span id="muteText">Mute media</span>
<input type="checkbox" onclick="muteMedia(this);">
<div>
<br />
<div style="margin:10px;">
Progress : <input id="progress" class="seekbar" type="range" min="1" max="100" value="1" step="1" onmouseup="seekMedia(this.value);">
</div>
<br /><br />
<div style="margin:10px;">
State : <span id="playerstate">IDLE</span>
</div>
<div style="margin:10px;">
<textarea rows="20" cols="70" id="debugmessage">
</textarea>
</div>
<div>
<h3>Instructions:</h3>
<ol>
<li>Place media files (videos) in <i>{{ root_path }}/media</i> and refresh page</li>
<li>Click <i>Launch App</i> and choose the ChromeCast device in the popup that appears on the top-right of the page.</li>
<li>Select the file you wish to play/cast</li>
<li>Click <i>Load Media</i> and wait for the message <i>new media session ...</i></li>
<li>Click <i>Play</i> to start playing the video.</li>
<li>Use the <i>Progress</i> seekbar to change the play position of the video.</li>
<li>When done casting local videos click <i>Stop app</i> to release the Chromecast.</li>
</ol>
<b>Always keep an eye on the log for any error messages.</b>
<br /><br /><p><b>Source: </b><a href="https://github.com/abid-mujtaba/local-chromecast"><i>https://github.com/abid-mujtaba/local-chromecast</i></a> a fork of the Google Developer project <a href="https://github.com/googlecast/CastHelloVideo-chrome"><i>https://github.com/googlecast/CastHelloVideo-chrome</i></a>.</p>
</div>
</div>
</div>
</body>
</html>