mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
* chore: consistency/prettier * chore: rebase * chore: rebase * chore: include typings * fix: include typings file in prettier lint-staged
29 lines
649 B
JavaScript
29 lines
649 B
JavaScript
'use strict';
|
|
|
|
const BasePlayer = require('./BasePlayer');
|
|
const BroadcastDispatcher = require('../dispatcher/BroadcastDispatcher');
|
|
|
|
/**
|
|
* An Audio Player for a Voice Connection.
|
|
* @private
|
|
* @extends {BasePlayer}
|
|
*/
|
|
class AudioPlayer extends BasePlayer {
|
|
constructor(broadcast) {
|
|
super();
|
|
/**
|
|
* The broadcast that the player serves
|
|
* @type {VoiceBroadcast}
|
|
*/
|
|
this.broadcast = broadcast;
|
|
}
|
|
|
|
createDispatcher(options, streams) {
|
|
this.destroyDispatcher();
|
|
const dispatcher = (this.dispatcher = new BroadcastDispatcher(this, options, streams));
|
|
return dispatcher;
|
|
}
|
|
}
|
|
|
|
module.exports = AudioPlayer;
|