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_Webradio

    Scheduled Pinned Locked Moved Entertainment
    6 Posts 5 Posters 3.1k Views 5 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
      Aries1984 Module Developer
      last edited by Aries1984

      I wanted to put my Magic Mirror in the bathroom and thought it might be handy to also having an internetradio included in the mirror. As there was no module, I’ve used the chance - being a javascript newibe - dug into it and created my very first own MagicMirror² module.

      It’s quite simple to use. You only need a module that controls the webradio. Stations can be switched (Prev/Next), Volume can be controlled (Up/Down) and playback can be paused or resumed. I’ve used MMM-Buttons myself to control my instance of the Webradio.

      –> Download from Github

      0_1541033324980_Paused.png

      3_1541033324981_Volume95.png

      2_1541033324981_Volume50.png

      1_1541033324980_Volume15.png

      1 Reply Last reply Reply Quote 0
      • R Offline
        Ramez
        last edited by

        Great, That’s exactly what I was thinking of doing but I dunno how cause i’m not a programmer :) :D but I hope that my ideas help,
        1- you can use MediaElement and it’s NPM Link instead of jplayer as it can play almost all extensions "mp3,rtmp,mp4,rtsp…etc I’ve digged into the code and found it’s nicely detect streaming

        var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]);
        
        if (hasFlash) {
        	_media.typeChecks.push(function (url) {
        		url = url.toLowerCase();
        
        		if (url.startsWith('rtmp')) {
        			if (~url.indexOf('.mp3')) {
        				return 'audio/rtmp';
        			} else {
        				return 'video/rtmp';
        			}
        		} else if (/\.og(a|g)/i.test(url)) {
        			return 'audio/ogg';
        		} else if (~url.indexOf('.m3u8')) {
        			return 'application/x-mpegURL';
        		} else if (~url.indexOf('.mpd')) {
        			return 'application/dash+xml';
        		} else if (~url.indexOf('.flv')) {
        			return 'video/flv';
        		} else {
        			return null;
        		}
        	});
        

        2- Alternatively you can push the streaming link (can also support local files .srtm and m3u8) to vlc using

        cvlc //web link or file goes here
        

        Note that your local file must NOT have a space in it’s name, don’t really know if this has a fix around?
        so your main task is to provide a nice UI for the mirror player and vlc will do the hard job in the background. And yes it does need vlc to be installed which fortunatly raspbian and almost all 3rd OSes comes with
        3-why not relaying on the nice UI of MP3Player by asim or at least I can help you providing a good skin "i’m not a programmer but am a good photoshopper :) "
        4- lastly, I’ve made a small library of straeming links "arabic contents imho! it’s my pleasure to make other counrty based list and share it so you can even create a new option/payload in your module specifying counrty and it will load it’s specific file containing country’s channels :thumbs_up:

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          Aries1984 Module Developer @Ramez
          last edited by

          @ramez
          Hi Ramez,

          1. thanks for the hint towards MediaElement. I might actually look into that.
          2. I’ll try MediaElement first…
          3. At the moment I’m actually quite happy with the lean text-based skin :)
          4. Yeah I was thinking about some sort of library for the next version, too. I could use the longpress of the On/Off Button to get into the menu and Vol+/Vol- to navigate through the menu (Continent -> Country -> Station). Ideally the Library is available online and autoupdates.
          A 1 Reply Last reply Reply Quote 0
          • rafaelcotaR Offline
            rafaelcota
            last edited by

            @Aries1984 said in MMM_Webradio:

            –> Download from Github

            I’m trying to use this modules, but it always starts on PAUSE, how can I start it in PLAY mode?

            Thank’s in advanced,

            1 Reply Last reply Reply Quote 0
            • A Offline
              AxLed Module Developer @Aries1984
              last edited by

              @Aries1984
              I have a tip for your point 4.
              I saw you are using notification system for your module, take a look at my module MMM-Navigate, it uses a rotary encoder to get some interaction with mm. So sending notifications play/pause or prev/next station or volumeup/down is no problem.

              AxLED

              1 Reply Last reply Reply Quote 0
              • kusselinK Offline
                kusselin
                last edited by kusselin

                can you put in the Radiologe?

                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