diff --git a/src/js/player.js b/src/js/player.js index 860ace46f..4912a79ca 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -435,12 +435,14 @@ class DPlayer { // https://github.com/Dash-Industry-Forum/dash.js case 'dash': if (window.dashjs) { - const dashjsPlayer = window.dashjs.MediaPlayer().create().initialize(video, video.src, false); + // const dashjsPlayer = window.dashjs.MediaPlayer().create().initialize(video, video.src, false); //undefined + const dashjsPlayer = window.dashjs.MediaPlayer().create(); + dashjsPlayer.initialize(video, video.src, this.options.autoplay); const options = this.options.pluginOptions.dash; dashjsPlayer.updateSettings(options); this.plugins.dash = dashjsPlayer; this.events.on('destroy', () => { - window.dashjs.MediaPlayer().reset(); + dashjsPlayer.destroy(); delete this.plugins.dash; }); } else {