-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMM-RadioDe.js
49 lines (36 loc) · 2.11 KB
/
MMM-RadioDe.js
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
Module.register("MMM-RadioDe",{
// Default module config.
defaults: {
api_key: false,
station: 'antennekids',
autoplay: "true",
player_color: "61ce42", //does not have any influence
height:"92", // in pixel
width:"360", // in pixel
// volume:"70%" not yet implemented
},
display: true,
// Subclass start method.
start: function() {
Log.info("Starting module: " + this.name);
//Log.info("Setting System Volume to " + this.config.volume);
//exec("amixer -q sset Master " + this.config.volume, null);
},
getDom: function() {
var wrapper = document.createElement("div");
if (this.display) {
var script = document.createElement("div");
script.innerHTML = "<div class=\"ng-app-embedded\"><div style=\"display:none;\" class=\"\" data-playertype=\"web_embedded\" data-playstation=\"antennekids\" data-autoplay=\"false\" data-playercolor=\"" + this.config.player_color + "\" data-apikey=\"" + this.config.api_key + "\" data-iframe=\"true\"></div><iframe src=\"http://radio.de/inc/microsite/index.html?playerWidth="+ this.config.width +"px&playerHeight="+ this.config.height + "px&playerType=web_embedded&partnerLogo=null&partnerUrl=null&partnerBacklink=null&partnerName=null&popoutTitle=null&stations=null&listText=null&listSubtext=null&playerColor=" + this.config.player_color + "&showFooter=null&token=null&playStation=" + this.config.station + "&apikey=" + this.config.api_key + "&popupWidth=null&popupHeight=null&autoplay=" + this.config.autoplay + "&iframe=true\" id=\"radioDeIframe0\" name=\"radioDeIframe0\" frameborder=\"0\" style=\"width: "+ this.config.width +"px; height: "+ this.config.height + "px;\" height=\""+this.config.height+"\" width=\""+this.config.height+"\"></iframe></div>";
wrapper.appendChild(script);
}
return wrapper;
},
suspend: function(){
this.display = false;
this.updateDom(300);
},
resume: function(){
this.display = true;
this.updateDom(300);
},
});