format
This commit is contained in:
parent
c091f8e81b
commit
2f6d8378d9
|
|
@ -17,7 +17,7 @@ class ContextMenu {
|
|||
this.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const event = e || window.event;
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue