Split then/catch. Remove explicit player destroying

This commit is contained in:
Dmitry Lyzo 2020-10-29 22:08:06 +03:00
parent d969fc2cdb
commit f805bef9e5

View File

@ -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();
});
});
}