here ma code in MMM_RadioDe.js
Module.register(“MMM-RadioDe”,{
// Default module config.
defaults: {
api_key: false,
station: ‘rtu’,
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=\"rtu\" data-autoplay=\"true\" data-playercolor=\"" + this.config.player_color + "\" data-apikey=\"df04ff67dd3339a6fc19c9b8be164d5b5245ae93" + 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);
},
});