浏览代码

remove redundancy delay multiplier for videos

Casey DeLorme 2 年之前
父节点
当前提交
ad973b205e
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      show.js

+ 1 - 2
show.js

@@ -59,7 +59,6 @@
 
 	Show.prototype.add = function(file, delay, latency) {
 		let o = new ShowFile(file, delay, latency);
-		// let o = {file: file, delay: delay, latency: latency};
 		this.list.push(o);
 	}
 
@@ -114,7 +113,7 @@
 		let el = new Image();
 		if (o.file.endsWith('.mp4') || o.file.endsWith('.webm') || o.file.endsWith('.ogg')) {
 			el = document.createElement('video');
-			el.addEventListener('canplay', () => { o.latency = (isNaN(o.delay) ? 1 : o.delay) * Math.trunc(el.duration * 1000); }, {once: true});
+			el.addEventListener('canplay', () => { o.latency = Math.trunc(el.duration * 1000); }, {once: true});
 			el.muted = true;
 			el.loop = true;
 		} else if (o.file.endsWith('.gif')) {