really really really messy implementation of prism

This commit is contained in:
Amish Shah
2016-12-28 17:04:18 +00:00
parent 8d966932a9
commit be32bbc3a4
9 changed files with 145 additions and 160 deletions

View File

@@ -16,17 +16,10 @@ nonce.fill(0);
* @extends {EventEmitter}
*/
class StreamDispatcher extends EventEmitter {
constructor(player, stream, sd, streamOptions) {
constructor(player, stream, streamOptions) {
super();
this.player = player;
this.stream = stream;
this.streamingData = {
channels: 2,
count: 0,
sequence: sd.sequence,
timestamp: sd.timestamp,
pausedTime: 0,
};
this._startStreaming();
this._triggered = false;
this._volume = streamOptions.volume;
@@ -47,6 +40,10 @@ class StreamDispatcher extends EventEmitter {
this.setVolume(streamOptions.volume || 1);
}
get streamingData() {
return this.player.streamingData;
}
/**
* How long the stream dispatcher has been "speaking" for
* @type {number}