Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 26, 2018
1 parent c091f8e commit 2f6d837
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ContextMenu {
this.hide();
return;
}

const event = e || window.event;
event.preventDefault();

Expand Down
6 changes: 3 additions & 3 deletions src/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 2f6d837

Please sign in to comment.