diff --git a/public/css/room.css b/public/css/room.css index 7d617ab..e544cd8 100644 --- a/public/css/room.css +++ b/public/css/room.css @@ -73,7 +73,7 @@ video{ width: 100%; height: 100%; padding: 10rem; - grid-area: 1/1/3/4; + grid-area: 1/1/3/5; border-radius: 17rem; } .video-box{ diff --git a/public/js/iminit.js b/public/js/iminit.js index d70933a..8066cb9 100644 --- a/public/js/iminit.js +++ b/public/js/iminit.js @@ -24,6 +24,22 @@ function getname(id){ }) } +function getgrouplist(){ + let promise = tim.getGroupOnlineMemberCount(window.roomid); + promise.then(function(imResponse) { + console.log(imResponse.data.memberCount); + if(imResponse.data.memberCount < 3){ + $("#main-video").css("grid-area","1/1/3/5") + $(".liaotian").css("grid-area","3/1/4/5") + }else{ + $("#main-video").css("grid-area","1/1/3/4") + $(".liaotian").css("grid-area","3/1/4/4") + } + }).catch(function(imError) { + console.warn('getGroupOnlineMemberCount error:', imError); // 获取直播群在线人数失败的相关信息 + }); +} + function formatDateTime (inputTime) { inputTime = inputTime * 1000 var date = new Date(inputTime); @@ -169,6 +185,9 @@ function formatDateTime (inputTime) { default: break; } + setInterval(() => { + getgrouplist() + }, 2000); }).catch((err)=>{ console.log(err) }) @@ -189,6 +208,9 @@ function formatDateTime (inputTime) { default: break; } + setInterval(() => { + getgrouplist() + }, 2000); }).catch((err)=>{ console.log(err) }) diff --git a/public/zhibo.html b/public/zhibo.html index 8743b07..319ef21 100644 --- a/public/zhibo.html +++ b/public/zhibo.html @@ -65,7 +65,7 @@ border-bottom: 1rem solid #EEEEEE; } .liaotian{ - grid-area: 3/1/4/4; + grid-area: 3/1/4/5; margin-top: 28rem; height: 90%; margin-left: 10rem;