This commit is contained in:
2020-11-27 13:54:32 +08:00
parent 28500a1a1a
commit a35253b4b9
23 changed files with 97 additions and 23 deletions

2
dist/js/app.60c6d986.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/js/app.60c6d986.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/js/chunk-14e6a7cb.24505999.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/js/chunk-16964057.b8852d7c.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/js/chunk-ebdb96a0.cbefff6f.js vendored Normal file
View File

@@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ebdb96a0"],{"27ad":function(e,t,c){"use strict";c("dd4c")},6413:function(e,t,c){"use strict";c.r(t);var n=c("7a23"),o=Object(n["withScopeId"])("data-v-e6e249bc");Object(n["pushScopeId"])("data-v-e6e249bc");var d={class:"body",id:"rbody"};Object(n["popScopeId"])();var a=o((function(e,t,c,o,a,i){var r=Object(n["resolveComponent"])("NavTop"),u=Object(n["resolveComponent"])("router-view");return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:"mine",style:{height:e.height+"px"}},[Object(n["createVNode"])(r,{type:1,style:{"flex-shrink":"0"}}),Object(n["createVNode"])("div",d,[Object(n["createVNode"])(u)])],4)})),i=c("c022"),r=Object(n["defineComponent"])({components:{NavTop:i["a"]},setup:function(){var e=Object(n["ref"])(0);return Object(n["onMounted"])((function(){e.value=document.documentElement.clientHeight})),window.onresize=function(){e.value=document.documentElement.clientHeight},{height:e}}});c("27ad");r.render=a,r.__scopeId="data-v-e6e249bc";t["default"]=r},dd4c:function(e,t,c){}}]);
//# sourceMappingURL=chunk-ebdb96a0.cbefff6f.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./src/layout/Live.vue?d282","webpack:///./src/layout/Live.vue","webpack:///./src/layout/Live.vue?cdce","webpack:///./src/layout/Live.vue?b857"],"names":["class","id","style","height","type","components","NavTop","setup","value","document","documentElement","clientHeight","window","onresize","render","__scopeId"],"mappings":"kHAAA,W,0JCGaA,MAAM,OAAOC,GAAG,S,sLAFzB,yBAKM,OALDD,MAAM,OAAQE,MAAK,QAAU,EAAAC,OAAM,O,CACpC,yBAAiD,GAAxCC,KAAM,EAAGF,MAAA,sBAClB,yBAEM,MAFN,EAEM,CADF,yBAAc,M,kBCAX,+BAAgB,CAC3BG,WAAW,CACPC,SAAA,MAEJC,MAJ2B,WAMvB,IAAMJ,EAAS,iBAAI,GAOnB,OANA,wBAAU,WACNA,EAAOK,MAAQC,SAASC,gBAAgBC,gBAE5CC,OAAOC,SAAS,WACZV,EAAOK,MAAQC,SAASC,gBAAgBC,cAErC,CACHR,a,UCbZ,EAAOW,OAAS,EAChB,EAAOC,UAAY,kBAEJ,gB","file":"js/chunk-ebdb96a0.cbefff6f.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Live.vue?vue&type=style&index=0&id=e6e249bc&lang=scss&scoped=true\"","<template>\n <div class=\"mine\" :style=\"{height:height + 'px'}\">\n <NavTop :type=\"1\" style=\"flex-shrink:0\"></NavTop>\n <div class=\"body\" id=\"rbody\">\n <router-view/>\n </div>\n </div>\n</template>\n<style lang=\"scss\" scoped>\n.mine{\n display: flex;\n flex-direction: column;\n .body{\n // display: flex;\n width: 100%;\n min-height: calc(100% - 57px);\n background-color: #F5F5F5;\n // padding: 23px;\n }\n}\n</style>\n<script lang=\"ts\">\nimport { defineComponent, onMounted, ref } from 'vue';\nimport NavTop from \"@/components/NavTop.vue\"\n\nexport default defineComponent({\n components:{\n NavTop\n },\n setup(){\n console.log(1)\n const height = ref(0);\n onMounted(() => {\n height.value = document.documentElement.clientHeight;\n })\n window.onresize=function(){ \n height.value = document.documentElement.clientHeight;\n }\n return {\n height\n }\n }\n})\n</script>","\nimport { defineComponent, onMounted, ref } from 'vue';\nimport NavTop from \"@/components/NavTop.vue\"\n\nexport default defineComponent({\n components:{\n NavTop\n },\n setup(){\n console.log(1)\n const height = ref(0);\n onMounted(() => {\n height.value = document.documentElement.clientHeight;\n })\n window.onresize=function(){ \n height.value = document.documentElement.clientHeight;\n }\n return {\n height\n }\n }\n})\n","import { render } from \"./Live.vue?vue&type=template&id=e6e249bc&scoped=true&bindings={}\"\nimport script from \"./Live.vue?vue&type=script&lang=ts\"\nexport * from \"./Live.vue?vue&type=script&lang=ts\"\n\nimport \"./Live.vue?vue&type=style&index=0&id=e6e249bc&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-e6e249bc\"\n\nexport default script"],"sourceRoot":""}

15
dist/js/common.js vendored
View File

@@ -273,25 +273,32 @@ function addVideoView(id, isLocal = false) {
function addMemberView(id) {
let memberElm = $('#member-me').clone();
memberElm.attr('id', id);
memberElm.find('div.member-id').html(id);
// memberElm.attr('class', id);
memberElm.css('display', 'flex');
memberElm.find("#video-btn").click((el)=>{
console.log(el)
console.log($(el.target).attr("src"))
const src = $(el.target).attr("src") == "img/camera-on.png" ? 1 : 0
console.log("video" + id);
sendsx(id,src)
})
memberElm.find("#mic-btn").click((el)=>{
console.log($(el.target).attr("src"))
const src = $(el.target).attr("src") == "img/mic-on.png" ? 1 : 0
console.log("mic" + id);
sendjinyan(id,src)
})
memberElm.find("#video-btn").removeAttr("id")
memberElm.find("#mic-btn").removeAttr("id")
console.log("移除")
memberElm.appendTo($('#member-list'));
getname(id).then((res)=>{
$("#" + id).find('div.member-id').html(res);
// console.log(.length)
})
memberElm.appendTo($('#member-list'));
}
function removeView(id) {
console.log("被删除")
if ($('#' + id)[0]) {
$('#' + id).remove();
//将video-grid中第一个div设为main-video

65
dist/js/iminit.js vendored
View File

@@ -1,9 +1,31 @@
let options = {
SDKAppID: 1400435767 // 接入时需要将0替换为您的即时通信 IM 应用的 SDKAppID
};
let tim = TIM.create(options);
window.tim = TIM.create(options);
tim.setLogLevel(0);
function getname(id){
return new Promise((res, rej)=>{
let promise = tim.getGroupMemberProfile({
groupID:window.roomid,
userIDList:[id],
memberCustomFieldFilter:["nick"]
})
promise.then(function(imResponse) {
console.log(imResponse.data.memberList); // 群成员列表
res(imResponse.data.memberList[0].nick)
}).catch(function(imError) {
console.warn('getGroupMemberProfile error:', imError);
setTimeout(()=>{
getname(id).then((e)=>{
res(e)
})
},1000)
});
})
}
function formatDateTime (inputTime) {
inputTime = inputTime * 1000
var date = new Date(inputTime);
var y = date.getFullYear();
var m = date.getMonth() + 1;
@@ -28,6 +50,9 @@ function formatDateTime (inputTime) {
if(!event.data[i].payload.text){
break;
}
if(event.data[i].payload.text.includes("beelinkMuteUserId") || event.data[i].payload.text.includes("inkTurnOffTheCameraUserId")){
break;
}
const list = $("#liaotianliebiao")
const html = ` <div>
<p>${formatDateTime(event.data[i].time)}</p>
@@ -204,4 +229,42 @@ function formatDateTime (inputTime) {
});
function sendjinyan(id,type){
const m = tim.createTextMessage({
to: window.roomid,
conversationType: TIM.TYPES.CONV_GROUP,
payload: {
text: `beelinkMuteUserId:${id},isClose:${type}`
}
})
const promise = tim.sendMessage(m);
promise.then(function(imResponse) {
// 发送成功
console.log(imResponse);
}).catch(function(imError) {
// 发送失败
console.warn('sendMessage error:', imError);
});
}
function sendsx(id,type){
const m = tim.createTextMessage({
to: window.roomid,
conversationType: TIM.TYPES.CONV_GROUP,
payload: {
text: `beelinkTurnOffTheCameraUserId:${id},isClose:${type}`
}
})
const promise = tim.sendMessage(m);
promise.then(function(imResponse) {
// 发送成功
console.log(imResponse);
}).catch(function(imError) {
// 发送失败
console.warn('sendMessage error:', imError);
});
}
// 开始登录

View File

@@ -205,6 +205,7 @@ class RtcClient {
const userId = evt.userId;
removeView(userId);
console.log('peer-leave ' + userId);
});
// fired when a remote stream is added
this.client_.on('stream-added', evt => {