From 03ec17f3d25f1af910ce4ccff1e1226d3560a2eb Mon Sep 17 00:00:00 2001 From: iotcat Date: Wed, 15 Jan 2020 20:56:37 +0000 Subject: [PATCH] auto swi qua --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index cc1b2f7..dcd3547 100644 --- a/index.html +++ b/index.html @@ -140,14 +140,14 @@ } var autoSwitchQuality = function(){ if(isWaiting && options.video.quality.length > 1){ - waitEvent(); + waitEvent(15000); dp.notice("监测到卡顿,切换片源"); options.video.defaultQuality = (options.video.defaultQuality >= options.video.quality.length - 1) ? 0 : options.video.defaultQuality+1; console.log('Switch quality to ' + options.video.defaultQuality); dp.switchQuality(options.video.defaultQuality); } } - var waitEvent = function(){ + var waitEvent = function(t = 6000){ isWaiting = true; setTimeout(function(){ if(dp.video.currentTime > options.video.playFrom + 10){ @@ -155,7 +155,7 @@ }else{ setTimeout(autoSwitchQuality, 9000); } - }, 6000); + }, t); };