GithubHelp home page GithubHelp logo

x3mer / mmm-mp3player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asimhsidd/mmm-mp3player

4.0 2.0 1.0 153 KB

A MagicMirror² module for playing music from folder.

License: GNU General Public License v3.0

JavaScript 76.96% CSS 23.04%

mmm-mp3player's Introduction

MMM-MP3Player

About

A MagicMirror² module for playing music from folder.
This is the version of the MMM-MP3Player module remade to my needs.
Starting screen:
picture
If no album cover found:
picture
Album cover retrieved from ID3-Tags:
picture

  • supports .mp3, .flac (surprisingly for me, it can be played as 'audio/mpeg' object as well) and .wav music formats;
  • reads ID3 metadata (artist and song title) - if no data, the filename is displayed;
  • displays album cover. Player tries to retrieve the image from ID3-Tags, otherwise it searches file cover.jpg in the playing music file directory.
  • autoplay, random order, loop playlist capability;
  • current settings of 'autoPlay' and 'random' options are displayed while loading the module;
  • control through notifications (play, stop, next track, prev track, turn random on/off);
  • module only supports rock music.

Dependencies

Beside the core modules, this module uses one dependency:

Module URL
node-id3 https://www.npmjs.com/package/node-id3

Installation

  • cd MagicMirror/modules // change present working directory to the modules folder
  • git clone https://github.com/x3mEr/MMM-MP3Player.git // clone the module from github
  • cd MMM-MP3Player // navigate to the MMM-MP3Player directory
  • npm install // install dependencies
  • Add the following configuration to the modules array in the MagicMirror/config/config.js file:
    modules: [
        {
			module: "MMM-MP3Player",
			position: "top_left",
			config: {
				musicPath: "modules/MMM-MP3Player/music/", 
				autoPlay: true,
				random: false,
				loopList: true,
			}
        }
    ]

Do not forget to add extra parameters for other modules (i.e. classes: "default everyone", for face recognition module)

  • Finally, add some cool music to the musicPath folder and enjoy!

Update

  • cd MagicMirror/modules/MMM-MP3Player // change present working directory to the modules folder
  • if you have done local edits, backup the files you have edited and run git reset --hard
  • git pull // to pull the changes from the repository

Configuration

Option Description
musicPath The path of the folder with .mp3 files.
Default: 'modules/MMM-MP3Player/music/'
Type: string
autoPlay Should music be played after loading the module?
Default: true
Type: boolean
random Should music be shuffled?
Default: false
Type: boolean
Note: Every next track is randomly selected. So after the playlist ends the order of tracks will be another.
loopList Loop the tracklist?
Default: true
Type: boolean
  • In case of random: true, previous track is not a track, played previously, it's a previous file in musicPath folder.

Control with notifications

The playback can be controlled from another module (e.g. voicecontrol) with notifications. To play track, pause playback, play next or previous track, turn random on/off, following notifications should be send, respectively:

this.sendNotification('PLAY_MUSIC', 'some_info');
this.sendNotification('STOP_MUSIC', 'some_info');
this.sendNotification('NEXT_TRACK', 'some_info');
this.sendNotification('PREVIOUS_TRACK', 'some_info');
this.sendNotification('RANDOM_ON', 'some_info');
this.sendNotification('RANDOM_OFF', 'some_info');

mmm-mp3player's People

Contributors

asimhsidd avatar kristjanesperanto avatar x3mer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vshakhlin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.