Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stopPlaying() {
this.playing = false;
this.playingIntent = null;
if (this.instream) {
//not all streams implement these...
//and even file stream don't seem to implement them properly...
unpipe(this.instream);
if (this.instream.end) {
this.instream.end();
}
if (this.instream.destroy) {
this.instream.destroy();
}
this.instream = null;
}
if (this.streamProc) {
this.streamProc.stdin.pause();
this.streamProc.kill("SIGKILL");
this.streamProc = null;
}
}