1.1.4 • Published 2 years ago
nodejs-youtube-player v1.1.4
How to use
Install the Package
npm install nodejs-youtube-playerExample:
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