BroadcastAudioPlayer.js (649B)
1 'use strict'; 2 3 const BasePlayer = require('./BasePlayer'); 4 const BroadcastDispatcher = require('../dispatcher/BroadcastDispatcher'); 5 6 /** 7 * An Audio Player for a Voice Connection. 8 * @private 9 * @extends {BasePlayer} 10 */ 11 class AudioPlayer extends BasePlayer { 12 constructor(broadcast) { 13 super(); 14 /** 15 * The broadcast that the player serves 16 * @type {VoiceBroadcast} 17 */ 18 this.broadcast = broadcast; 19 } 20 21 createDispatcher(options, streams) { 22 this.destroyDispatcher(); 23 const dispatcher = (this.dispatcher = new BroadcastDispatcher(this, options, streams)); 24 return dispatcher; 25 } 26 } 27 28 module.exports = AudioPlayer;