This commit is contained in:
DIYgod 2018-09-27 00:14:25 +08:00
parent c091f8e81b
commit 2f6d8378d9
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
4 changed files with 6 additions and 6 deletions

View File

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

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
});