-
Notifications
You must be signed in to change notification settings - Fork 0
/
videochat.html
152 lines (136 loc) · 6.25 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<html lang="en">
<head>
<title>Agora Gesture Video Chat</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<nav class="navbar navbar-dark bg-dark">
<!-- <div id="buttons-container" class="row justify-content-center mt-3"> -->
<a class="navbar-brand fw-bold fs-7 " href="./index.html">PoseCall</a>
<div class="toggle-switch mt-2">
<label class="switch">
<input type="checkbox" id="gesture-control-toggle">
<span class="slider round"></span>
</label>
</div>
<div class="col-md-2 text-center p-4">
<button id="mic-btn" type="button" class="btn btn-block btn-danger btn-lg">
<i id="mic-icon" class="fas fa-microphone"></i>
</button>
</div>
<div class="col-md-2 text-center p-4">
<button id="video-btn" type="button" class="btn btn-block btn-danger btn-lg">
<i id="video-icon" class="fas fa-video"></i>
</button>
</div>
<div class="col-md-2 text-center p-4">
<button id="exit-btn" type="button" class="btn btn-block btn-danger btn-lg">
<i id="exit-icon" class="fas fa-phone-slash"></i>
</button>
</div>
</nav>
<br>
<div class="container-fluid p-4">
<div id="main-container">
<div class="full-screen-wrapper">
<div id="full-screen-video"></div>
</div>
<!-- <div id="center-screen-video"></div> -->
<div id="lower-video-bar" class="row fixed-bottom mb-1">
<div id="remote-streams-container" class="container col-9 ml-1">
<div id="remote-streams" class="row">
<!-- insert remote streams dynamically -->
</div>
</div>
<div id="local-stream-container" class="col p-0">
<div id="mute-overlay" class="col">
<i id="mic-icon" class="fas fa-microphone-slash"></i>
</div>
<div id="no-local-video" class="col text-center">
<i id="user-icon" class="fas fa-user"></i>
</div>
<div id="local-video" class="col p-0"></div>
</div>
</div>
<!-- CANVAS -->
<div class="container d-flex justify-content-start">
<canvas id="video-canvas" class="dots_video"></canvas>
</div>
</div>
</div>
<div class="modal fade" id="modalForm">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">Join Channel</h4>
<button type="button" class="close" data-dismiss="modal">
<span>×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-4">
<input type="text" id="form-appid" class="form-control">
<label for="form-appid">Agora AppId</label>
</div>
<div class="md-form mb-4">
<input type="text" id="form-token" class="form-control">
<label for="form-token">Agora Token</label>
</div>
<div class="md-form mb-4">
<input type="text" id="form-channel" class="form-control">
<label for="form-channel">Channel Name</label>
</div>
<div class="md-form mb-4">
<input type="number" id="form-uid" class="form-control" value="1" data-decimals="0" />
<label for="form-uid">User ID</label>
</div>
</div>
<div class="modal-footer d-flex justify-content-center">
<button id="join-channel" class="btn btn-default">Join Channel</button>
</div>
</div>
</div>
</div>
</body>
<script src="./js/AgoraRTCSDK-3.6.11.js"></script>
<!-- CSS Includes go here -->
<link rel="stylesheet" type="text/css" href="./assets/css/styles.css" />
<!-- Bootstrap and Font Awesome CSS Libraries -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj"
crossorigin="anonymous"></script>
<!-- JS Includes go here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<!-- tensorflow.js and posenet scripts -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/[email protected]/dist/teachablemachine-pose.min.js"></script>
<script type="text/javascript">
$('#mic-btn').prop('disabled', true)
$('#video-btn').prop('disabled', true)
$('#exit-btn').prop('disabled', true)
$('#gesture-btn').prop('disabled', true)
$(document).ready(function () {
$('#modalForm').modal('show')
})
</script>
<script type="text/javascript">
// init the session when user clicks join btn
$('#join-channel').click(function (event) {
var agoraAppId = $('#form-appid').val()
var token = $('#form-token').val()
var channelName = $('#form-channel').val()
var uid = parseInt($('#form-uid').val())
$('#modalForm').modal('hide')
initClientAndJoinChannel(agoraAppId, token, channelName, uid)
})
</script>
<script src="./js/agora.js"></script>
<script src="./js/pose.js"></script>
<script src="./js/buttons.js"></script>
</html>