DIYgod 6 years ago
parent
commit
2f6d8378d9
4 changed files with 6 additions and 6 deletions
  1. 1 1
      src/js/contextmenu.js
  2. 3 3
      src/js/controller.js
  3. 1 1
      src/js/fullscreen.js
  4. 1 1
      src/js/player.js

+ 1 - 1
src/js/contextmenu.js

@@ -17,7 +17,7 @@ class ContextMenu {
                 this.hide();
                 return;
             }
-            
+
             const event = e || window.event;
             event.preventDefault();
 

+ 3 - 3
src/js/controller.js

@@ -57,13 +57,13 @@ class Controller {
             });
         }
     }
-    
+
     initHighlights () {
         this.player.on('durationchange', () => {
             if (this.player.video.duration !== 1 && this.player.video.duration !== Infinity) {
                 if (this.player.options.highlight) {
                     const highlights = document.querySelectorAll('.dplayer-highlight');
-                    [].slice.call(highlights, 0).map((item) => {
+                    [].slice.call(highlights, 0).forEach((item) => {
                         this.player.template.playedBarWrap.removeChild(item);
                     });
                     for (let i = 0; i < this.player.options.highlight.length; i++) {
@@ -72,7 +72,7 @@ class Controller {
                         }
                         const p = document.createElement('div');
                         p.classList.add('dplayer-highlight');
-                        p.style.left = ( (this.player.options.highlight[i].time / this.player.video.duration) * 100) + '%';
+                        p.style.left =  this.player.options.highlight[i].time / this.player.video.duration * 100 + '%';
                         p.innerHTML = '<span class="dplayer-highlight-text">' + this.player.options.highlight[i].text + '</span>';
                         this.player.template.playedBarWrap.insertBefore(p, this.player.template.playedBarTime);
                     }

+ 1 - 1
src/js/fullscreen.js

@@ -34,7 +34,7 @@ class FullScreen {
                 utils.setScrollPosition(this.lastScrollPosition);
                 this.player.events.trigger('fullscreen_cancel');
             }
-        }
+        };
         if (/Firefox/.test(navigator.userAgent)) {
             document.addEventListener('mozfullscreenchange', docfullscreenchange);
             document.addEventListener('fullscreenchange', docfullscreenchange);

+ 1 - 1
src/js/player.js

@@ -438,7 +438,7 @@ class DPlayer {
         this.on('error', () => {
             if (!this.video.error) {
                 // Not a video load error, may be poster load failed, see #307
-                return
+                return;
             }
             this.tran && this.notice && this.type !== 'webtorrent' & this.notice(this.tran('Video load failed'), -1);
         });