1.1.4 • Published 11 months ago

nodejs-youtube-player v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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
1.1.4

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago