This commit is contained in:
2021-01-25 16:13:53 +08:00
parent e2a6568406
commit cf97b59a77
24 changed files with 132 additions and 35 deletions

View File

@@ -13,11 +13,11 @@ let micId = '';
function login() {
presetting.login(false, options => {
presetting.login(0, options => {
rtc = new RtcClient(options);
join();
});
presetting.login(true, options => {
presetting.login(1, options => {
shareUserId = options.userId;
share = new ShareClient(options);
});
@@ -330,6 +330,11 @@ function addMemberView(id) {
if($("#" + id)[0]){
return ;
}
let sid = id;
sid = sid.split("_")[0]
if(sid == "ceshi"){
return ;
}
let memberElm = $('#member-me').clone();
memberElm.attr('id', id);
// memberElm.attr('class', id);

View File

@@ -13,11 +13,11 @@ let micId = '';
function login() {
presetting.login(false, options => {
presetting.login(0, options => {
rtc = new RtcClient(options);
join();
});
presetting.login(true, options => {
presetting.login(1, options => {
shareUserId = options.userId;
share = new ShareClient(options);
});

View File

@@ -16,6 +16,15 @@
*
* Referencehttps://cloud.tencent.com/document/product/647/17275#Server
*/
function jiazai(){
document.getElementById("make").style.display = "block"
}
function tingzhi(){
document.getElementById("make").style.display = "none"
}
jiazainum = 0;
function genTestUserSig(userID) {
/**
* 腾讯云 SDKAppId需要替换为您自己账号下的 SDKAppId。
@@ -61,11 +70,15 @@ function genTestUserSig(userID) {
// userSig:userSig
// };
return new Promise((res)=>{
jiazai()
jiazainum++;
$.ajax({
url: window.url + 'userSig?userid=' + userID,
headers: { "Authorization": "Bearer " + localStorage.getItem("token")},
success(data){
res({data: data.data, id: 1400435767})
tingzhi()
}
})
})

View File

@@ -662,7 +662,7 @@ async function startNetworkTesting() {
.appendTo('#screen-share');
// 上下行网络质量
presetting.login(false, async options => {
presetting.login(2, async options => {
client = TRTC.createClient({ mode: 'rtc', ...options });
client.on('network-quality', event => {
networkQualityNum++;

View File

@@ -26,8 +26,10 @@ class Presetting {
login(share, callback) {
let userId = window.mid;
if (share) {
if (share == 1) {
userId = 'share_' + userId;
}else if(share == 2){
userId = 'ceshi_' + userId;
}
console.log(userId)

View File

@@ -11,7 +11,19 @@
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<style>
#make{
background-color: #000;
opacity: 0.5;
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 1001;
display: none;
}
</style>
<script>
(function (designWidth, maxWidth) {
var doc = document,
@@ -602,6 +614,8 @@
</script>
<div id="make"></div>
</body>
</html>

View File

@@ -11,7 +11,19 @@
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<style>
#make{
background-color: #000;
opacity: 0.5;
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 1001;
display: none;
}
</style>
<script>
(function (designWidth, maxWidth) {
var doc = document,
@@ -602,6 +614,7 @@
</script>
<div id="make"></div>
</body>
</html>