From f805bef9e51ca1de0e8623bf8bb6ad57d18af6e3 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 29 Oct 2020 22:08:06 +0300 Subject: [PATCH] Split then/catch. Remove explicit player destroying --- src/components/playback/playbackmanager.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index a096d255c1..54831094e1 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -2240,17 +2240,14 @@ class PlaybackManager { const streamInfo = createStreamInfoFromUrlItem(item); streamInfo.fullscreen = playOptions.fullscreen; getPlayerData(player).isChangingStream = false; - return player.play(streamInfo).then(function () { + return player.play(streamInfo).then(() => { loading.hide(); onPlaybackStartedFn(); onPlaybackStarted(player, playOptions, streamInfo); - }, function () { + }).catch(() => { // TODO: show error message self.stop(player); loading.hide(); - }).catch(() => { - player.destroy(); - loading.hide(); }); }); }