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.

    MP3 Player

    Scheduled Pinned Locked Moved Development
    59 Posts 5 Posters 14.9k Views 4 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.
    • S Offline
      sdetweil @bachoo786
      last edited by

      @bachoo786 you could say, I have updated the repo, git pull to get the changes…

      you need to
      git add,
      git commit -m and
      git push
      to update the repo

      Sam

      How to add modules

      learning how to use browser developers window for css changes

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

        @bachoo786 said in MP3 Player:

        fs.readdir(musicFolder, (err, files) => {

        the modulename.js that runs in the browser cannot read files directly, due to security restrictions ( any script could read ALL your files without you knowing)

        this is why the node_helper exists…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        B 1 Reply Last reply Reply Quote 0
        • B Offline
          bachoo786 @sdetweil
          last edited by

          @sdetweil said in MP3 Player:

          @bachoo786 said in MP3 Player:

          fs.readdir(musicFolder, (err, files) => {

          the modulename.js that runs in the browser cannot read files directly, due to security restrictions ( any script could read ALL your files without you knowing)

          this is why the node_helper exists…

          so whats the alternative? I had this MMM-QuranPlayer module that was able to read mp3 files from the folders in the “public” directory which was located in the root folder of the module.

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

            @bachoo786 I’m pretty sure the module used a node_helper

            now if you make it a url, then you can fetch it thru the browser… but the server side is actually reading the file

            but you could make it a file url

            file:///server/path to file

            in MagicMirror the server home folder is the MagicMirror folder

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • B Offline
              BiaGen @sdetweil
              last edited by

              Hey @bachoo786, I’ve been following your progress with the folder nesting—it’s a tricky bit of logic to get right in the node_helper, but it’ll be worth it for the cleaner UI!
              One thing I noticed while setting up my own music module is that the player looks a lot better if the MP3 metadata (ID3 tags) is actually clean. If the tags are messy, the ‘Artist’ and ‘Title’ fields on the mirror usually end up looking like a jumble of underscores and file extensions.
              Since you’re organizing a big library right now, I’ve been using https://editmp3tags.com/ to quickly fix the tags in the browser before dropping them into the music folder. It’s way faster than using a heavy desktop app and helps the module display everything correctly once you get that ‘better method’ logic sorted out.

              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 3
              • 4
              • 5
              • 6
              • 2 / 6
              • 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