diff --git a/src/streaming/controllers/StreamController.js b/src/streaming/controllers/StreamController.js index 1c1e02f72c799527bd7b6571104ee18b188496f8..abf5e233af6133edfa526af02181b83e7ae5cc63 100644 --- a/src/streaming/controllers/StreamController.js +++ b/src/streaming/controllers/StreamController.js @@ -274,12 +274,14 @@ function StreamController() { } function getNextStream() { - const start = activeStream.getStreamInfo().start; - const duration = activeStream.getStreamInfo().duration; + if (activeStream) { + const start = activeStream.getStreamInfo().start; + const duration = activeStream.getStreamInfo().duration; - return streams.filter(function (stream) { - return (stream.getStreamInfo().start === (start + duration)); - })[0]; + return streams.filter(function (stream) { + return (stream.getStreamInfo().start === (start + duration)); + })[0]; + } } function switchStream(oldStream, newStream, seekTime) {