Read the statement by Michael Teeuw here.
Simple Music Player Module
-
If you have a nas / networked storage and want to use music files from there, how would you do that?
-
@dbaler My higly noobish answer is Samba, and mount a network folder.
-
@broberg Just change the directory in which JS file?
-
@dbaler If you are not using the default Music folder you could actually mount your network folder directly in that folder. No need to alter anything in the js files
Here is a easy to follow tutorial on how you mount a smb share in linux :
https://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/ -
@cowboysdude Is that “show list” already available?
-
Hi Eof,
Do you know why mm-music-player module is not loading even i added below code to config file? I downloaded and copied mm-music-player folder to MM’s Modules folder. Do i need to do something else?{
module: ‘mm-music-player’,
position: ‘bottom_left’,
config: {
startingVolume: 20,
fadeDuriation: 2000
}
}Thank you!
-
Hi aro28,
I had the same problem, so I decided to take a look at why this module couldn’t be loaded.
The issues is in the Node_Helper.js given, which is mistaken. The structure is wrong. It looks like a quick adaptation of a ctrl+C/ctrl+V made from index.js, found in the node_helper folder (MM core folders).
I’m actually tweeking it a bit. I’ll give you news when i get it worked nicely.
(In fact, it seems i can now load it, but since my speaker are broke, i cant be sure it reads files… I’ll change them tomorrow) -
@DrCastor
Great! Thank you for reply. I hope you will succeed. -
Ok, found bad speakers, but at least, they allow me to test it. It works :). I’m a real noob, so some useless things may still be there. But at least, it will do the trick
Go to the node_helper.js file, and change it this way:
var Class = require("../../js/class.js"); var express = require("express"); var path = require("path"); module.exports = NodeHelper.create({ init: function() { console.log("Initializing mm-music-player module helper ..."); }, start: function() { this.expressApp.get('/music', function (req, res) { var fs = require('fs'); var path = require('path'); var files = []; fs.readdir('modules/mm-music-player/music', (err, data) => { for(i = 0; i < data.length; i++){ if(path.extname(data[i]) == ".mp3"){ files.push(data[i]); } } res.send(files); }); }); }, /* setExpressApp(app) * Sets the express app object for this module. * This allows you to host files from the created webserver. * * argument app Express app - The Express app object. */ setExpressApp: function(app) { this.expressApp = app; var publicPath = this.path + "/public"; app.use("/" + this.name, express.static(publicPath)); }, });
If luck is by your side, it will work ;)
-
@DrCastor said in Simple Music Player Module:
Hi,
Could you please send a full code of “node_helper.js” file?
Thanks in advance,