-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ejs
215 lines (199 loc) · 8.64 KB
/
index.ejs
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<html ng-app>
<head>
<title>Roshan Video Chat</title>
<script>
// Symple client options
CLIENT_OPTIONS = {
url: '<%- socketHost %>',
token: '<%- token %>',
peer: <%- JSON.stringify(peer) %>
}
// WebRTC config
// This is where you would add TURN servers for use in production
WEBRTC_CONFIG = {
iceServers: [{
"url":
navigator.mozGetUserMedia ? "stun:stun.services.mozilla.com" :
navigator.webkitGetUserMedia ? "stun:stun.l.google.com:19302" :
"stun:23.21.150.121"
}
, {url: "stun:stun.l.google.com:19302"}
, {url: "stun:stun1.l.google.com:19302"}
, {url: "stun:stun2.l.google.com:19302"}
, {url: "stun:stun3.l.google.com:19302"}
, {url: "stun:stun4.l.google.com:19302"}
, {url: "stun:23.21.150.121"}
, {url: "stun:stun01.sipphone.com"}
, {url: "stun:stun.ekiga.net"}
, {url: "stun:stun.fwdnet.net"}
, {url: "stun:stun.ideasip.com"}
, {url: "stun:stun.iptel.org"}
, {url: "stun:stun.rixtelecom.se"}
, {url: "stun:stun.schlund.de"}
, {url: "stun:stunserver.org"}
, {url: "stun:stun.softjoys.com"}
, {url: "stun:stun.voiparound.com"}
, {url: "stun:stun.voipbuster.com"}
, {url: "stun:stun.voipstunt.com"}
, {url: "stun:stun.voxgratia.org"}
, {url: "stun:stun.xten.com"}
]
}
</script>
<!-- Framework -->
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="bootstrap-theme.min.css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="bootstrap.min.js"></script>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="socket.io-1.4.5.js"></script>
<!-- Symple -->
<link rel="stylesheet" type="text/css" href="symple.player.css">
<script type="text/javascript" src="symple.js"></script>
<script type="text/javascript" src="symple.client.js"></script>
<script type="text/javascript" src="symple.player.js"></script>
<script type="text/javascript" src="symple.player.webrtc.js"></script>
<!-- Application -->
<link rel="stylesheet" type="text/css" href="app.css">
<script type="text/javascript" src="helpers.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-controller="mainCtrl">
<div id="loading-overlay" ng-show="isLoading">
<div class="icon">
</div>
</div>
<div id="container">
<nav id="nav">
<h1 id="logo"><a href="/">Video Chat | Messaging</a></h1>
<a href="//github.com/roshancode/vC">code</a>
</nav>
<div class="alert alert-danger" ng-show="errorText" ng-bind="errorText">You have been disconnected from the server</div>
<div class="row">
<div class="col-md-4">
<div id="login" ng-show="!isLoggedIn()" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Login</h3>
</div>
<div class="panel-body">
<form ng-submit="login()">
<div class="input-group">
<input type="text" class="form-control" ng-model="handle" value="auscaster" placeholder="Enter a handle to login..." />
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">Login</button>
</span>
</div>
</form>
</div>
</div>
<div id="roster">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">People</h3>
</div>
<ul class="list-group">
<li class="list-group-item list-group-item-warning" ng-show="!isLoggedIn()"><small>Please log in...</small></li>
<li class="list-group-item" ng-repeat="peer in peers">
<div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:void(0)" ng-click="setMessageTarget(peer.user)">Direct message</a></li>
<li><a href="javascript:void(0)" ng-click="startVideoCall(peer.user)">Video chat</a></li>
</ul>
</div>
<b>@{{peer.user}}</b>
<!--
<h4 class="list-group-item-heading">@{{peer.user}}</h4>
<p class="list-group-item-text">...</p>
-->
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-8">
<div id="video">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Video</h3>
</div>
<div class="panel-body">
<div class="local-video-wrap">
<div class="local-video">
</div>
<button id="start-local-video" class="btn btn-primary" ng-click="startLocalVideo()" ng-show="remoteVideoPeer && !localVideoPlaying">Start video</button>
</div>
<div class="remote-video-wrap">
<div class="remote-video">
</div>
</div>
</div>
<div class="modal fade" id="incoming-call-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Incoming call...</h4>
</div>
<div class="modal-body">
<p>You have an incoming video call from <span class="caller"></span></p>
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-success accept">Accept</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger reject">Reject</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="messages">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Conversation</h3>
</div>
<ul class="list-group">
<li class="list-group-item">
<form id="post-message" ng-submit="sendMessage()">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default dropdown-toggle direct-user" data-toggle="dropdown" type="button">@</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:void(0)" ng-click="setMessageTarget()">Send to everyone</a></li>
<li class="divider"></li>
<li ng-repeat="peer in peers">
<a href="javascript:void(0)" ng-click="setMessageTarget(peer.user)">@{{peer.user}}</a>
</li>
</ul>
</span>
<input type="text" class="form-control message-text" ng-model="messageText" placeholder="Type your message here" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Send!</button>
</span>
</div>
</form>
</li>
<li class="list-group-item" ng-class="getMessageClass(message)" ng-repeat="message in messages">
<span class="time">{{message.time}}</span>
<span class="user">@{{message.user}}</span>
<span class="data">{{message.data}}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
Built with <a> Love</a>,
<a href="http://socket.io">Socket.IO</a>,
<a href="http://getbootstrap.com">Bootstrap</a> and
<a href="http://angularjs.org">AngularJS</a>.
© 2019 <a href="https://github.com/roshancode"> Roshan Lamichhane</a>
</footer>
</div></div>
</body>
</html>