Merge branch 'master' of http://git.scdxtc.com/chen/squareDancing
commit
9c74a19b3b
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
<!--音乐-->
|
||||
<audio id="music" data-song="顶级 Slow 气派炸街5.0.mp3" controls autoplay loop style="z-index: 999; position: fixed;display: none;">
|
||||
<source src="http://bili.scdxtc.cn/music/顶级 Slow 气派炸街5.0.mp3" type="audio/mp3">
|
||||
<source src="https://bili.scdxtc.cn/music/顶级 Slow 气派炸街5.0.mp3" type="audio/mp3">
|
||||
</audio>
|
||||
<!--点击播放音乐-->
|
||||
<script>
|
||||
|
|
29
js/handle.js
29
js/handle.js
|
@ -48,15 +48,15 @@ function getFirstEventKeyword(name) {
|
|||
|
||||
// 设置领舞 name=姓名 time=有效期 单位秒
|
||||
function setLeader(name, time) {
|
||||
localStorage.setItem('leader', name)
|
||||
localStorage.setItem('leader_end_at', (new Date).getTime()/1000 + time)
|
||||
sessionStorage.setItem('leader', name)
|
||||
sessionStorage.setItem('leader_end_at', (new Date).getTime()/1000 + time)
|
||||
}
|
||||
|
||||
// 获取领舞人信息
|
||||
function getLeader() {
|
||||
let res = []
|
||||
res['name'] = localStorage.getItem('leader') ? localStorage.getItem('leader') : ''
|
||||
res['time'] = localStorage.getItem('leader_end_at') ? localStorage.getItem('leader_end_at') : 0
|
||||
res['name'] = sessionStorage.getItem('leader') ? sessionStorage.getItem('leader') : ''
|
||||
res['time'] = sessionStorage.getItem('leader_end_at') ? sessionStorage.getItem('leader_end_at') : 0
|
||||
|
||||
return res
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ function dancer(val){
|
|||
// 接受消息处理
|
||||
function receiveMessage(event)
|
||||
{
|
||||
// console.log(event.data, 'event test')
|
||||
console.log(event.data, '接受信息')
|
||||
// 我们能信任信息来源吗?
|
||||
if (event.origin !== "https://live.bilibili.com") {
|
||||
return false
|
||||
|
@ -111,8 +111,8 @@ function receiveMessage(event)
|
|||
if (data.ct === '') {
|
||||
return false
|
||||
}
|
||||
// adminList = ['内有猛犬小心','热心市民阿狄呐','流域_墨绿绿'];
|
||||
adminList = ['饺子吃肉肉'];
|
||||
adminList = ['内有猛犬小心','热心市民阿狄呐','流域_墨绿绿'];
|
||||
// adminList = ['饺子吃肉肉'];
|
||||
// 大航海列表
|
||||
if (adminList.length > 0) {
|
||||
// 获取当前领舞人
|
||||
|
@ -158,7 +158,7 @@ function receiveMessage(event)
|
|||
let random2 = Math.floor(Math.random() + 0.5)
|
||||
|
||||
// 获取领舞信息
|
||||
let leaderInfo = localStorage.getItem('leader')
|
||||
let leaderInfo = sessionStorage.getItem('leader')
|
||||
|
||||
let isLeader = data.uname == leaderInfo ? 1 : 0
|
||||
// 给弹幕加上随机事件
|
||||
|
@ -183,9 +183,9 @@ function receiveMessage(event)
|
|||
}
|
||||
// 新用户
|
||||
if(dm.is_new==1){
|
||||
if(dm.uname!=leader.uname){//如果弹幕的人的名字不等于领舞者的名字,就创建一个人物
|
||||
// if(dm.uname!=leader.uname){//如果弹幕的人的名字不等于领舞者的名字,就创建一个人物
|
||||
peopleObj(dm.uname,dm.uid,dm.text,dm.event);
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
// 老用户
|
||||
$(`#${dm.uid} .speak`).html(dm.text);
|
||||
|
@ -230,9 +230,12 @@ function receiveMessage(event)
|
|||
}
|
||||
// 领舞喊一起喊
|
||||
// leader.text.slice(0,3);
|
||||
if(leader.text.slice(0,4)=="一起喊:" || leader.text.slice(0,4)=="一起喊:"){
|
||||
allSay(leader.text.slice(4));
|
||||
}
|
||||
if (leader.text.length >= 4) {
|
||||
if(leader.text.slice(0,4)=="一起喊:" || leader.text.slice(0,4)=="一起喊:"){
|
||||
allSay(leader.text.slice(4));
|
||||
}
|
||||
}
|
||||
|
||||
// 领舞自己喊跳舞
|
||||
if(peopleHan(dm.text)){
|
||||
clearInterval(dancerTimer);
|
||||
|
|
Loading…
Reference in New Issue