forked from stephenkeep/node-red-contrib-chromecast
-
Notifications
You must be signed in to change notification settings - Fork 1
/
chromecast-play.html
67 lines (53 loc) · 2.24 KB
/
chromecast-play.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
<script type="text/x-red" data-template-name="chromecast-play">
<div class="form-row">
<label for="node-input-creds"> Credentials</label>
<input type="text" id="node-input-creds">
</div>
<!-- By convention, most nodes have a 'name' property. The following div -->
<!-- provides the necessary field. Should always be the last option -->
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name of this Event">
</div>
<div class="form-row">
<label for="node-input-url">Media Url</label>
<input type="text" id="node-input-url" placeholder="Media Url">
</div>
<div class="form-row">
<label for="node-input-contentType">Media Type</label>
<input type="text" id="node-input-contentType" placeholder="audio/mp3">
</div>
<div class="form-row">
<label for="node-input-ip">IP</label>
<input type="text" id="node-input-ip" placeholder="0.0.0.0">
</div>
</script>
<!-- Next, some simple help text is provided for the node. -->
<script type="text/x-red" data-help-name="chromecast-play">
<h3>About</h3>
<p>Plays a Media file on a chromecast</p>
<h3>Use</h3>
<p>To use pass in the IP address of the chromecast <code>payload.ip_address</code> and a url to a media file <code>payload.url</code>.
</p>
</script>
<!-- Finally, the node type is registered along with all of its properties -->
<!-- The example below shows a small subset of the properties that can be set-->
<script type="text/javascript">
RED.nodes.registerType('chromecast-play', {
category: 'chromecast',
defaults: {
name: {value:""},
url: {value:""},
contentType: {value:""},
ip: {value:""},
},
inputs:1, // set the number of inputs - only 0 or 1
outputs:1, // set the number of outputs - 0 to n
icon: "bridge.png", // saved in icons/myicon.png
color: "#FFFF00",
label: function() {
return this.name || "Play";
},
paletteLabel: "Play"
});
</script>