-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoChat.html
93 lines (81 loc) · 3.29 KB
/
videoChat.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>VIDEO CHAT!! </title>
<link rel="stylesheet" href="styles.css"/>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<script src="https://cdn.agora.io/sdk/release/AgoraRTCSDK-3.3.1.js"></script>
<script src="https://kit.fontawesome.com/4da6d27084.js" crossorigin="anonymous"></script>
<script src="AgoraRTC.js"></script>
</head>
<body onload="startSelfStream()">
<div class="main-container">
<div id="left-pane">
<br>
<div id="logo">
<i class="fas fa-dragon"></i>
</div>
<div id="top-text">
<span style="font-size: 2rem;"><strong>Dragon Tutors</strong></span>
<br>
<span style="font-size: 1.2rem;">Video Chat</span>
</div>
<span id="result"></span>
<div id="controls">
<button onclick=mute() id="muteAudio">
<i class="fas fa-microphone"></i>
<br>
Mute
</button>
<br>
<button onclick=stopVideo() id="muteVideo"> <!-- if extra time, add icons w/ slash-->
<i class="fas fa-video"></i>
<br>
Stop Video
</button>
<br>
<button id="invite" onclick=invite()>
<i class="fas fa-people-arrows"></i>
<br>
Invite
</button>
<br>
<button onclick=shareScreen() id="shareScreen">
<i class="fas fa-desktop"></i>
<br>
Share screen
</button>
<br>
<button onclick=closeWindow() id="leave">
<i class="fas fa-sign-out-alt"></i>
<br>
Leave
</button>
</div>
</div>
<div id="right-pane">
<div id="self-stream"></div>
<div id="remote-stream"></div>
<div id="self-screen"></div>
<div id="remote-screen"></div>
</div>
</div>
<script>
let remoteStreams = 0;
function addVideoStream(elementId){
let streamDiv = document.createElement("div");
streamDiv.id = elementId;
streamDiv.style.height = "500px"
remoteStreams++;
if(remoteStreams == 1){
document.getElementById("remote-stream").appendChild(streamDiv);
document.getElementById("remote-stream").className = "invalid";
}
if (remoteStreams == 2){
document.getElementById("remote-screen").appendChild(streamDiv);
}
}
</script>
</body>
</html>