nowplaying-node v0.1.3
nowplaying-node
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-toolsthen run:
npm install nowplaying-nodeElectron
If you're making electron app, you might need to install electron-rebuild:
npm install --save-dev electron-rebuildthen run:
.\node_modules\.bin\electron-rebuildto 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.AIMPFully supported.
- foobar2000:
player = PlayerName.CADFully supported. The foo_cad plugin (download) needs to be installed.
- iTunes:
player = PlayerName.ITUNESFully supported. Tested with iTunes 10.2.
- J. River Media Center and Media Jukebox:
player = PlayerName.CADFully supported through the CAD interface with Media Center 19 and later. More information here.
- MediaMonkey:
player = PlayerName.MEDIAMONKEYFully supported. Tested with MediaMonkey 3.2.5.
- MusicBee:
player = PlayerName.CADFully supported. MusicBee 1.2 (or higher) is required.
- Winamp:
player = PlayerName.WINAMPFully supported.
- WMP:
player = PlayerName.WMPFully supported, except for the .getRepeat() / .getShuffle().
- Spotify:
player = PlayerName.SPOTIFYPartially supported. Only the .getArtist(), .getTitle() information and .play(), .pause(), .stop(), .next(), and .previous() controls are available.
- Last.fm Client, TTPlayer, OpenPandora, Zune:
player = PlayerName.WLMPartially supported. Even in the best case, only the types .getTitle(), .getArtist(), .getAlbum() information and .play(), .pause(), .stop(), .next(), and .previous() are supported.