0.1.3 • Published 6 years ago

nowplaying-node v0.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

nowplaying-node

build

Currently investigating foobar and WMP player freezing cause.

Install

You need windows-build-tools to build native module:

npm --add-python-to-path install --global windows-build-tools

then run:

npm install nowplaying-node

Electron

If you're making electron app, you might need to install electron-rebuild:

npm install --save-dev electron-rebuild

then run:

.\node_modules\.bin\electron-rebuild

to rebuild usable module for your current Electron's Node version

How to use:

Import NowPlaying:

import { NowPlaying, PlayerName } from "nowplaying-node";

Create player interface:

const myAIMP = new NowPlaying({
    fetchCover: true,
    player: PlayerName.AIMP,
});

Get information:

myAIMP.update();
console.log("%s - %s", myAIMP.getArtist(), myAIMP.getTitle())

Track info only is updated when .update() is called, so put them in an interval to always have most recent info:

setInterval(() => {
    myAIMP.update();
    console.log("%s - %s", myAIMP.getArtist(), myAIMP.getTitle())
    console.log(myAIMP.getPosition());
    console.log(myAIMP.getCoverPath());
}, 1000);

List of supported players:

  • AIMP:
player = PlayerName.AIMP

Fully supported.

  • foobar2000:
player = PlayerName.CAD

Fully supported. The foo_cad plugin (download) needs to be installed.

  • iTunes:
player = PlayerName.ITUNES

Fully supported. Tested with iTunes 10.2.

  • J. River Media Center and Media Jukebox:
player = PlayerName.CAD

Fully supported through the CAD interface with Media Center 19 and later. More information here.

  • MediaMonkey:
player = PlayerName.MEDIAMONKEY

Fully supported. Tested with MediaMonkey 3.2.5.

  • MusicBee:
player = PlayerName.CAD

Fully supported. MusicBee 1.2 (or higher) is required.

  • Winamp:
player = PlayerName.WINAMP

Fully supported.

  • WMP:
player = PlayerName.WMP

Fully supported, except for the .getRepeat() / .getShuffle().

  • Spotify:
player = PlayerName.SPOTIFY

Partially supported. Only the .getArtist(), .getTitle() information and .play(), .pause(), .stop(), .next(), and .previous() controls are available.

  • Last.fm Client, TTPlayer, OpenPandora, Zune:
player = PlayerName.WLM

Partially supported. Even in the best case, only the types .getTitle(), .getArtist(), .getAlbum() information and .play(), .pause(), .stop(), .next(), and .previous() are supported.