From edfa5d6868034bd52d1561c9ad601bf34d72fe4c Mon Sep 17 00:00:00 2001 From: iotcat Date: Wed, 15 Jan 2020 20:59:56 +0000 Subject: [PATCH] auto swi qua --- index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index dcd3547..dc8f49b 100644 --- a/index.html +++ b/index.html @@ -141,8 +141,11 @@ var autoSwitchQuality = function(){ if(isWaiting && options.video.quality.length > 1){ waitEvent(15000); + if(options.video.defaultQuality >= options.video.quality.length - 1){ + return; + } dp.notice("监测到卡顿,切换片源"); - options.video.defaultQuality = (options.video.defaultQuality >= options.video.quality.length - 1) ? 0 : options.video.defaultQuality+1; + options.video.defaultQuality = (options.video.defaultQuality >= options.video.quality.length - 1) ? options.video.defaultQuality : options.video.defaultQuality+1; console.log('Switch quality to ' + options.video.defaultQuality); dp.switchQuality(options.video.defaultQuality); }