MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM_radioDe

    Scheduled Pinned Locked Moved Requests
    3 Posts 2 Posters 407 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Arckoos
      last edited by

      Hi
      I installed the MMM_RadioDe module …
      Everything works but the only problem is that the radio does not start automatically.
      Here is my code in the config file:
      {
      module: ‘MMM-RadioDe’,
      position: “center”,

      config: {
      station: “rtu”,
      api_key: ‘df04ff67dd3339a6fc19c9b8be164d5b5245ae93’,

      }
      },
      How can I activate the automatic launch?

      1 Reply Last reply Reply Quote 0
      • A Offline
        Arckoos
        last edited by

        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&amp;playerHeight="+ this.config.height + "px&amp;playerType=web_embedded&amp;partnerLogo=null&amp;partnerUrl=null&amp;partnerBacklink=null&amp;partnerName=null&amp;popoutTitle=null&amp;stations=null&amp;listText=null&amp;listSubtext=null&amp;playerColor=" + this.config.player_color + "&amp;showFooter=null&amp;token=null&amp;playStation=" + this.config.station + "&amp;apikey=" + this.config.api_key + "&amp;popupWidth=null&amp;popupHeight=null&amp;autoplay=" + this.config.autoplay + "&amp;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);
          },
        

        });

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @Arckoos
          last edited by

          @arckoos you are not supposed to edit the module.js file

          only parms in config.js

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy