intersept load action only if the middleware is not destroyed

This commit is contained in:
nklhrstv 2020-03-19 09:46:52 +02:00
parent 0dd46973b2
commit f7ab601618

View file

@ -30,7 +30,7 @@ function withStreamingServer(Video) {
video.on(eventName, listener);
}
function dispatch(args) {
if (args && args.commandName === 'load') {
if (!destroyed && args && args.commandName === 'load') {
stream = null;
video.dispatch({ commandName: 'stop' });
if (args.commandArgs && args.commandArgs.stream && typeof args.commandArgs.stream.infoHash === 'string' && typeof args.commandArgs.streamingServerUrl === 'string') {