Skip to content

Commit

Permalink
Update player.js
Browse files Browse the repository at this point in the history
dash autoplay and destroy
  • Loading branch information
Kumhy authored Sep 28, 2024
1 parent 33f9af9 commit 094cd0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ class DPlayer {
if (window.dashjs) {
// const dashjsPlayer = window.dashjs.MediaPlayer().create().initialize(video, video.src, false); //undefined
const dashjsPlayer = window.dashjs.MediaPlayer().create();
dashjsPlayer.initialize(video, video.src, false);
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 {
Expand Down

0 comments on commit 094cd0f

Please sign in to comment.