nodejs-youtube-player
v1.1.4
Published
A Simple Youtube Audio Player made with Pure Node-JS
Downloads
11
Maintainers
Readme
How to use
Install the Package
npm install nodejs-youtube-player
Example:
const youtube = require("nodejs-youtube-player");
const AudioPlayer = new youtube.AudioPlayer();
(async () => {
await AudioPlayer.playDownload("Porter Robinson Everything Goes On");
})();
Usage:
const youtube = require("nodejs-youtube-player");
const AudioPlayer = new youtube.AudioPlayer();
(async () => {
//We need to use await or else it will crash
await AudioPlayer.stream("MUSIC NAME HERE"); //Method 1
await AudioPlayer.playDownload("MUSIC NAME HERE"); //Method 2 //RECOMMENDED
AudioPlayer.SilentMode = true; //Disables all the console.log output
AudioPlayer.pause(); //Pause the audio
AudioPlayer.resume(); //Resume the paused audio
AudioPlayer.stop(); //Stop the audio
})();
Detailed Usage:
Playing an Audio (Via streaming)
AudioPlayer.stream("MUSIC NAME HERE");
Playing an Audio (Downloading it first and then playing it)
AudioPlayer.playDownload("MUSIC NAME HERE");
Pausing the Audio
AudioPlayer.pause();
Resuming the Audio
AudioPlayer.resume();
Stopping the Audio
AudioPlayer.stop();
Disabling all the Console.log(); output
AudioPlayer.SilentMode = true; //false by default