From 48df618d933290ed57d1cf38a85346ab1d0fd723 Mon Sep 17 00:00:00 2001 From: Chrystian Huot Date: Wed, 10 Jul 2019 08:10:43 -0400 Subject: [PATCH] Fix: should not send call events when playing empty audio stream --- client/imports/app/radio/radio.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/imports/app/radio/radio.service.ts b/client/imports/app/radio/radio.service.ts index e3823b5..f66d9a5 100644 --- a/client/imports/app/radio/radio.service.ts +++ b/client/imports/app/radio/radio.service.ts @@ -298,7 +298,7 @@ export class AppRadioService implements OnDestroy { let watchdog = null; const progressHandler = () => { - if (playing) { + if (this._call.current && playing) { this._emitTimeEvent(); if (watchdog) { @@ -310,14 +310,16 @@ export class AppRadioService implements OnDestroy { }; const startHandler = () => { - playing = true; + if (this._call.current) { + playing = true; - this._emitCallEvent(); - this._emitQueueEvent(); + this._emitCallEvent(); + this._emitQueueEvent(); + } }; const stopHandler = () => { - if (playing) { + if (this._call.current && playing) { playing = false; if (watchdog) {