-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
96 lines (96 loc) · 4.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./assets/css/style.css">
<title>Web RTC Meeting V5 Quick Demo</title>
<script src="./config.js"></script>
</head>
<body>
<div class="rong-container">
<h3 class="rong-title"> Web RTC Meeting V5 Quick Demo </h3>
<div class="rong-login-box">
<div class="im-wrap">
<div class="input-wrap">
<input class="rong-input" id="appkey" type="text" value="" placeholder="请输入 appkey" autocomplete="off" oninput="inputChangeFn(this)">
<span class="arrow vertical-arrow">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" type="button" value="初始化 IM" onclick="initIM(this)">
<span class="arrow vertical-arrow">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" type="button" value="设置 IM 监听" onclick="setIMListener(this)">
<span class="arrow vertical-arrow">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" id="token" type="text" value="" placeholder="请输入 token" autocomplete="off" oninput="inputChangeFn(this)">
<span class="arrow vertical-arrow">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" type="button" value="连接 IM" onclick="connectIM(this)">
</div>
</div>
<div class="boundary-line">
<span class="arrow horizontal-arrow left-horizontal-arrow">------------------------</span>
<span class="arrow vertical-arrow">--------------------------------------------------------------------</span>
<span class="arrow horizontal-arrow right-horizontal-arrow">------------------------></span>
<div class="tips">IM 连接成功后才可初始化 RTC</div>
</div>
<div class="rtc-wrap">
<div class="input-wrap">
<input class="rong-input" type="button" value="初始化 RTC" onclick="initRTCClient(this)">
<span class="arrow vertical-arrow">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" id="roomId" type="text" value="" placeholder="请输入房间号" autocomplete="off" oninput="inputChangeFn(this)">
<span class="arrow vertical-arrow leave-repeat-line">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" type="button" value="加入房间" onclick="joinRoom(this)">
<span class="arrow vertical-arrow leave-repeat-line">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" id="setRoomListener" type="button" value="设置 Room 监听、订阅远端资源" onclick="initRTCListener(this)">
<span class="arrow vertical-arrow leave-repeat-line">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input rong-input-pub" type="button" value="发布摄像头麦克风资源" onclick="publishMicrophoneCamera(this)">
<input class="rong-input rong-input-pub" type="button" value="发布屏幕共享资源" onclick="publishScreenShare(this)">
<span class="arrow vertical-arrow pubnext leave-repeat-line">--------></span>
</div>
<div class="input-wrap">
<input class="rong-input" type="button" value="离开房间" onclick="leaveRoom(this)">
</div>
</div>
<div class="rejoin-line">
<span class="arrow horizontal-arrow left-horizontal-arrow">------------------------</span>
<span class="arrow vertical-short-arrow">------------------------------------------------------</span>
<span class="arrow horizontal-arrow right-revert-horizontal-arrow"><------------------------</span>
<div class="tips">离开房间后,可重新加入房间继续后续流程</div>
</div>
<div id="rong-video-box"></div>
</div>
</div>
<!-- RongIMLib -->
<script src="https://cdn.ronghub.com/RongIMLib-5.9.2.prod.js"></script>
<!-- RTCLib v5 -->
<script src="https://cdn.ronghub.com/RCRTC-5.6.17.prod.js"></script>
<script src="./assets/js/im.js"></script>
<script src="./assets/js/rtc.js"></script>
<script>
const inputChangeFn = (e) => {
if (e.value) {
e.nextElementSibling.style.color = '#09f';
} else {
e.nextElementSibling.style.color = '#fff';
}
if (e.id === 'roomId') {
document.querySelector('.rejoin-line').style.color = '#fff';
}
}
</script>
</body>
</html>