新增间隔随机镜头
parent
7d2746d7ba
commit
cc065c91bd
30
js/handle.js
30
js/handle.js
|
@ -10,7 +10,9 @@ let autoDel = false
|
|||
let speakExpireTime = 10*60
|
||||
// 歌曲列表
|
||||
var musicList = []
|
||||
|
||||
// 镜头出现时间
|
||||
let cameraTimer = null;
|
||||
let cameraTime = 60000*3//默认3分钟
|
||||
// 领舞人领舞时间 秒
|
||||
let leaderTime = 15*60
|
||||
// 何时添加镜头
|
||||
|
@ -44,7 +46,6 @@ function getEvent(name) {
|
|||
|
||||
return map[name] ? map[name] : ''
|
||||
}
|
||||
|
||||
// 领舞者:根据事件文字 获取事件名
|
||||
function getLeaderEvent(name) {
|
||||
let map = {
|
||||
|
@ -127,7 +128,23 @@ function peopleFluo(val){
|
|||
function dancer(val){
|
||||
return allEventList.includes(val);
|
||||
}
|
||||
|
||||
// 间隔多久加镜头
|
||||
function cameraEv(){
|
||||
cameraTimer = setInterval(()=>{
|
||||
console.log('随机镜头');
|
||||
list.forEach(item=>{
|
||||
var haveDan = $(`.ground-bg`).is(`.${item}`);
|
||||
// 如果之前有镜头,删除镜头
|
||||
if(haveDan) {
|
||||
$('.ground-bg').removeClass(item);
|
||||
}
|
||||
})
|
||||
setTimeout(()=>{
|
||||
$('.ground-bg').addClass(list[Math.floor(Math.random()*list.length)]);
|
||||
},1000)
|
||||
},cameraTime-1000)
|
||||
}
|
||||
cameraEv();
|
||||
// 删除久未说话的人
|
||||
function delExpireDiv() {
|
||||
if (!autoDel) {
|
||||
|
@ -255,6 +272,9 @@ function receiveMessage(event)
|
|||
}
|
||||
|
||||
if(leader.event=='scale-left' || leader.event=='scale-right' || leader.event=='scale-bottom-left' || leader.event=='scale-bottom-right'){
|
||||
let again = null;
|
||||
clearInterval(cameraTimer);
|
||||
clearTimeout(again);
|
||||
// 领舞喊镜头
|
||||
list.forEach(item=>{
|
||||
var haveDan = $(`.ground-bg`).is(`.${item}`);
|
||||
|
@ -267,6 +287,10 @@ function receiveMessage(event)
|
|||
setTimeout(()=>{
|
||||
$('.ground-bg').addClass(leader.event);
|
||||
},addJingTime)
|
||||
// 重新开启间隔随机镜头事件
|
||||
again = setTimeout(()=>{
|
||||
cameraEv();
|
||||
},10000)
|
||||
} else {
|
||||
if(firTimes==0){
|
||||
firTimes++;
|
||||
|
|
Loading…
Reference in New Issue