Pārlūkot izejas kodu

Fix the problem of getting highlight exception after perload is enabled in multiple instances

hywel 4 gadi atpakaļ
vecāks
revīzija
f76834fb4b
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/js/controller.js

+ 1 - 1
src/js/controller.js

@@ -66,7 +66,7 @@ class Controller {
         this.player.on('durationchange', () => {
         this.player.on('durationchange', () => {
             if (this.player.video.duration !== 1 && this.player.video.duration !== Infinity) {
             if (this.player.video.duration !== 1 && this.player.video.duration !== Infinity) {
                 if (this.player.options.highlight) {
                 if (this.player.options.highlight) {
-                    const highlights = document.querySelectorAll('.dplayer-highlight');
+                    const highlights = this.player.template.playedBarWrap.querySelectorAll('.dplayer-highlight');
                     [].slice.call(highlights, 0).forEach((item) => {
                     [].slice.call(highlights, 0).forEach((item) => {
                         this.player.template.playedBarWrap.removeChild(item);
                         this.player.template.playedBarWrap.removeChild(item);
                     });
                     });