-
Notifications
You must be signed in to change notification settings - Fork 0
/
stream.html
708 lines (607 loc) · 32.3 KB
/
stream.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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-121783460-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-121783460-1');
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Colour-PLAY</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
<!-- Socket.io -->
<script src="/socket.io/socket.io.js"></script>
<!-- Font awesome -->
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<!-- Custom styles for this template -->
<link href="css/small-business.css" rel="stylesheet">
<link rel="stylesheet" href="styles.ef46db3751d8e999.css">
<link href="css/style.css" rel="stylesheet">
<link href="css/mobile-style.css" rel="stylesheet">
<link href="css/html5player.css" rel="stylesheet">
<link rel="icon" type="image/png" href="img/ee.png">
</head>
<body class="bg-light" id="Home">
<!-- Loading Page Angular Cli-->
<app-root></app-root>
<ngx-ui-loader fgssize="75" [fgstype]="SPINNER.wanderingCubes"></ngx-ui-loader>
<script src="runtime.755ca2ad3607a7f2.js" type="module"></script>
<script src="polyfills.07f619d4921efb7a.js" type="module"></script>
<script src="main.c7fa1be5fc07b1ae.js" type="module"></script>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#Home"><img src="img/logo.png" alt="Colour-PLAY logo"
height="50" width="50"> Colour-PLAY</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a id="chat-nav" class="nav-link js-scroll-trigger hide" href="#messageArea">Chatroom</a>
</li>
<li class="nav-item">
<a id="about-nav" class="nav-link js-scroll-trigger hide" href="#about">About</a>
</li>
<li class="nav-item">
<a id="contact-nav" class="nav-link js-scroll-trigger hide" href="#contact">Contact</a>
</li>
<li class="nav-item">
<a id="logout-nav" class="logout-nav" href="/logout" style="text-decoration:none">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<div class="container">
<!-- User Form (First Page) -->
<div id="userFormArea" class="row">
<div class="col-md-12">
<!-- ADD DESCRIPTION HERE -->
<h2>Welcome to Video Synchronization Platform</h2>
<p class="lead">The hot new video synchronization platform used to watch videos in realtime with
friends!</p>
<hr style="height:20pt; visibility:hidden;" />
<h2> Join a Room! </h2>
<form id="userForm">
<div class="form-group">
<p style="color:red; margin-bottom: 0px" id="missinginfo"></p>
<label>Enter Name</label>
<input class="form-control" id="username" />
<br />
<p style="color:red; margin-bottom: 0px" id="missinginfo2"></p>
<label>Enter Room ID (Default 1)</label>
<button type="button" id="button" onClick="randomroom()" class="btn btn-primary random"
style="background-color:black;cursor: pointer; border-color:black; "> Random</button>
<br />
<input class="form-control" id="roomnum" />
<br />
<input style="margin-top: 10px;" type="submit" class="btn btn-primary" value="Enter" />
<hr style="height:65pt; visibility:hidden;" />
</div>
</form>
</div>
</div>
<div id="roomArea">
<!-- Heading Row -->
<div class="row my-4" style="margin-top: 0px !important;">
<div class="col-lg-7">
<div class="mobile-hide"><b>Mobile User</b>, please play the video once manually to give the
browser
permission to control the video player. </div>
<br>
<div style="margin: 10px" class="dropdown">
<button style="background-color: #3f4e5d; cursor: pointer; border-color:black;"
class="btn btn-info dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-video"></i> Player
</button>
<div class="form-control dropdown-menu scrollable-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" onclick="changePlayer(roomnum, 0)"><i class="fab fa-youtube"></i>
YouTube</a>
<a class="dropdown-item" onclick="changePlayer(roomnum, 1)"><img width="14px" height="14px"
src="img/dailymotion-logo.svg" alt="Daily Motion Logo"> Daily
Motion</a>
<a class="dropdown-item" onclick="changePlayer(roomnum, 2)"><i class="fab fa-vimeo"></i>
Vimeo</a>
<a class="dropdown-item" onclick="changePlayer(roomnum, 3)"><i
class="fas fa-file-video"></i> HTML5 Player (.mp4/.webm) (Beta)</a>
</div>
</div>
<!-- INVITE MOVED TO MODAL -->
<h2><span id="hostlabel" class="label label-default"><i class="fas fa-user"></i> Current Host:
Yasiru Tishan
</span></h2>
<!----------------------------------- PLAYER AREA ----------------------------------->
<div id='playerArea'>
<div class="video" id="player"></div>
</div>
<div id='dailyArea'>
<div class="video" id="player-daily"></div>
</div>
<div id='vimeoArea'>
<iframe class="video" id="player-vimeo" src="https://player.vimeo.com/video/76979871"
width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen
allowfullscreen></iframe>
</div>
<div id='HTML5Area'>
<div class="html5player">
<video
src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
width="640" height="360" class="video html5video" id="html5src" controls>
<!-- fallback content here -->
</video>
</div>
</div>
<!----------------------------------- PLAYER AREA ----------------------------------->
<!-- <hr> -->
<div>
<button id="playButton" onclick="playVideo(roomnum)"
style="background-color:red;cursor: pointer; border-color:black; " style="margin-top:.5rem"
class="btn btn-primary"><i class="fa fa-play"></i> Play / <i class="fa fa-pause"></i>
Pause</button>
<button style="background-color: #219a1d;cursor: pointer; border-color:black; " id="syncbutton"
onclick="syncVideo(roomnum);syncAlert()" style="margin-top:.5rem" class="btn btn-primary"><i
class="fa fa-sync"></i> Sync</button>
<button style="background-color: #219a1d; cursor: pointer; border-color:black; " id="loveButton"
onclick="loveLive(roomnum)" style="margin-top:.5rem" class="btn btn-primary"><i
class="far fa-heart"></i> Random K-pop</button>
<!-- <br/> -->
<button style="background-color: #219a1d; cursor: pointer; border-color:black; " id="hostbutton"
onclick="changeHost(roomnum)" style="margin-top:.5rem" class="btn btn-primary"><i
class="fas fa-users"></i> Make me the host!</button>
<!-- Turn off the lights -->
<button style="background-color: #219a1d; cursor: pointer; border-color:black; "
id="lightButton" style="margin-top:.5rem" class="btn btn-primary switch"><i
style="pointer-events:none;" class="fas fa-lightbulb"></i></button>
</div>
<!-- Div for lights off! -->
<div id='persoff'></div>
<div class="topbotmargins">
<input type="Video"
style="max-width: 200px; margin-right: .5rem; margin-bottom: .5rem; float: left;"
class="form-control" id="inputVideoId" placeholder="Video ID / URL">
<button id="enqueueButton" onclick="enqueueVideoParse(roomnum)"
style="background-color: #219a1d; cursor: pointer; border-color:black; "
class="btn btn-primary"><i class="fas fa-plus"></i> Add to Queue</button>
<button id="emptyButton" onclick="emptyQueue(roomnum)"
style="background-color: #219a1d; cursor: pointer; border-color:black; "
class="btn btn-primary"><i class="fas fa-trash"></i> Empty Queue</button>
</div>
<div>
<button id="changeButton" onclick="changeVideoParse(roomnum)"
style="background-color: #ce0684; cursor: pointer; border-color:black; "
class="btn btn-primary"><i class="fas fa-exchange-alt"></i> Change Video</button>
<button id="previousButton" onclick="prevVideo(roomnum)"
style="background-color: #007aae; cursor: pointer; border-color:black; "
class="btn btn-primary"><i class="fas fa-step-backward"></i> Previous</button>
<button id="nextButton" onclick="playNext(roomnum)"
style="background-color: #007aae; cursor: pointer; border-color:black; "
class="btn btn-primary"><i class="fas fa-step-forward"></i> Next</button>
<br />
</div>
<br />
<!-- HTML5 player input -->
<p style="display: none" id="beta-message" class="lead">Queue is currently only supported by
YouTube
</p>
</div>
<div class="col-lg-5">
<h5 class="right-header">Online Users</h5>
<hr style="height:0pt; visibility:hidden;" />
<div class="col-md-13">
<div class="well online-users noscrollbar">
<ul class="list-group" id="users"></ul>
</div>
<!-- Trigger the modal with a button -->
<button style="background-color: #781816; cursor: pointer; border-color:black;" type="button"
class="nonmobile-hide btn btn-info btn-sm invite-button" data-toggle="modal"
data-target="#inviteModal"><i style="width: 30px; height: 30px;"
class="fas fa-user-plus"></i><br>
<h5>Invite</h5>
</button>
</div>
<hr style="height:0pt; visibility:hidden;" />
<h5 style="color:gray;">Chatroom</h5>
<!-- Modal -->
<div id="inviteModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Invite a Friend</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<p>Send a friend your unique room link so they can watch videos too!</p>
<input class="inv_input" id="inv_input" type="text"
value="http://localhost:3000/ROOMNUM" class="field left" readonly>
</div>
<div class="modal-footer">
<div style="opacity: 1" class="tooltip">
<button type="button" class="btn btn-default" onclick="copyInvite()"
onmouseout="outFunc()"><span class="tooltiptext" id="myTooltip">Copy to
clipboard</span><i class="fas fa-clipboard"></i> Copy to
Clipboard</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="messageArea" class="row">
<br />
<div class="col-md-12">
<div class="chat noscrollbar" id="chat"></div>
<!-- Message Form (Enter Message) -->
<form id="messageForm">
<div class="form-group">
<br />
<input class="form-control chat-form" id="message" placeholder="Enter Message..." />
<br />
<br />
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Call to Action Well -->
<div class="card text-white bg-secondary my-4 text-center">
<div class="card-body">
<p class="text-white m-0"> To use Colour-PLAY just enter your name and a shared room number with
friends. Then all you have to do is select your video client (YouTube by default), enter a video
ID, and click "Change Video". All video playback should be synchronized to everyone in the room!
</p>
</div>
</div>
<section id="about" class="bg-light">
<hr style="height:30pt; visibility:hidden;" />
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>About Colour-PLAY</h2>
<p class="lead">Colour-PLAY is a video synchronization platform created for viewing
parties
with friends!</p>
<p> To use Colour-PLAY just enter your name and a shared room number with friends. Then
all
you have to do is select your video client (YouTube by default), enter a video ID,
and
click "Change Video". All video playback should
be synchronized to everyone in the room! </p>
<p> There is one host per room that can control the video client directly with the
native
player controls. Everyone else can still use them but it will only affect them until
they hit sync!</p>
<p> Have fun watching videos with friends!</p>
</div>
</div>
</div>
</section>
<hr style="height:10pt; visibility:hidden;" />
<section id="contact" class="bg-light">
<hr style="height:20pt; visibility:hidden;" />
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>Contact Me</h2>
<p class="lead">Who Am I?</p>
<p> I'm <b>Yasiru Tishan</b>
A Lead in Graphic Designer & Web Developer
I am a creative professional with extensive graphic design, web development, social
media, and project management.
I am also good at multitasking and hard worker.</p>
<p> I am an enthusiastic, confident character and goal-oriented team leader and counts
on interpersonal skills and organizational planning as a critical strength.
My experience in IT is attached to the technology industry, architecture, corporate
sectors,
and designer positions.</p>
<p> You can contact me directly at <a
href="mailto:10749896@students.plymouth.ac.uk?Subject=Colour-PLAY">10749896@students.plymouth.ac.uk</a>
if
you have any questions, concerns, or just to say hi! If you want to submit a
suggestion,
please see the
github issues page.</p>
<a href="https://github.com/yasirutishan"><button
style="margin-top:.5rem; background-color: black; cursor: pointer; border-color:black;"
class="btn btn-primary"><i class="far fa-lightbulb"></i> Github</button></a>
</div>
</div>
</div>
</section>
<hr style="height:50pt; visibility:hidden;" />
</div>
</div>
<!-- /.container -->
<!-- Footer -->
<footer id="footer" class="py-5 bg-dark footer">
<div class="container">
<p class="m-0 text-center text-white">Copyright © Video Synchronization Platform 2023</p>
</div>
<!-- /.container -->
</footer>
<script>
var socket = io.connect();
var roomnum = 1
var id = "M7lc1UVf-VE"
var username = ""
// Don't allow trailing or leading whitespace!
var nosymbols = new RegExp("^(([a-zA-Z0-9_-][a-zA-Z0-9 _-]*[a-zA-Z0-9_-])|([a-zA-Z0-9_-]*))$");
// Chat stuff
$(function () {
var $messageForm = $('#messageForm');
var $message = $('#message');
var $chat = $('#chat');
var $roomArea = $('#roomArea');
var $userFormArea = $('#userFormArea');
var $userForm = $('#userForm');
var $users = $('#users');
var $username = $('#username');
var $roomnum = $('#roomnum');
var $vidlist = $('#vidlist');
$messageForm.submit(function (e) {
e.preventDefault();
socket.emit('send message', $message.val());
$message.val('');
});
socket.on('new message', function (data) {
var last_div = $('.chat > div:last')[0]
// This checks for the last user
// If you are the last user, attach the message instead of creating a new div
if (last_div !== undefined) {
var myRegex = /.*<strong>(.+)<\/strong>.*/g
var match = myRegex.exec(last_div.innerHTML)
console.log(last_div.innerHTML)
var last_user = ""
if (match != null) {
console.log("found the user!" + match[1])
last_user = match[1]
}
}
if (data.user != last_user) {
$chat.append('<div class="well well-sm message-well"><strong>' + data.user + '</strong>: ' + data.msg + '</div>');
}
// If you sent the last message, append to previous
else {
last_div.innerHTML = last_div.innerHTML + " <br> " + data.msg
}
// Auto scroll on each message send!
$('div#chat').scrollTop($('div#chat')[0].scrollHeight)
});
// Submit user form
$userForm.submit(function (e) {
e.preventDefault();
// New User
// Get rid of trailing/leading whitespace
// If name not entered
if ($username.val() == "") {
console.log("ENTER A NAME")
var noname = document.getElementById('missinginfo')
noname.innerHTML = "Surely you have a name right? Enter it below!"
}
// If name is too long
else if ($username.val().length > 30) {
console.log("NAME IS TOO LONG")
var noname = document.getElementById('missinginfo')
noname.innerHTML = "Your name can't possibly be over 30 characters!"
}
// If roomnate
else if ($roomnum.val().length > 50) {
console.log("ROOM NAME IS TOO LONG")
var noname = document.getElementById('missinginfo')
noname.innerHTML = "How are you going to remember a room code that has more than 50 characters?"
}
// If Room contains symbols
// Can only be reached if the user decided to be sneaky and paste them!
else if (!nosymbols.test($roomnum.val())) {
console.log("ENTER A PROPER ROOMNUMBER")
var noname = document.getElementById('missinginfo')
noname.innerHTML = ""
var noname2 = document.getElementById('missinginfo2')
noname2.innerHTML = "Please enter a room ID without symbols or leading/trailing whitespace!"
} else {
username = $username.val()
socket.emit('new user', $username.val(), function (data) {
if (data) {
$userFormArea.hide();
$roomArea.show();
// Move footer to correct position
document.getElementById('footer').style.position = 'relative';
// Show header buttons!
document.getElementById('chat-nav').style.display = 'block';
document.getElementById('about-nav').style.display = 'block';
document.getElementById('contact-nav').style.display = 'block';
// This sets the room number on the client
if ($roomnum.val() != "") {
roomnum = $roomnum.val()
}
// Sets the invite link (roomnum)
document.getElementById("inv_input").value = "http://localhost:3000/" + roomnum
history.pushState('', 'Colour-PLAY', roomnum);
}
});
// Join room
socket.emit('new room', $roomnum.val(), function (data) {
// This should only call back if the client is the host
if (data) {
console.log("Host is syncing the new socket!")
syncVideo(roomnum)
}
});
$username.val('');
}
});
socket.on('get users', function (data) {
var html = '';
for (i = 0; i < data.length; i++) {
html += '<li style="padding-right: 10em;" class="list-group-item chat-users">' + data[i] + '</li>';
}
$users.html(html)
});
// Updates the queue
// Parameters - vidlist, currPlayer, videoId
socket.on('get vidlist', function (data) {
console.log("i am updating the queue")
var yt = data.vidlist.yt
var html = ''
if (yt.length > 0) {
for (i = 0; i < yt.length; i++) {
html += '<li class="vid-item"><div class="thumb"><a href="javascript: removeAt(' + i + ')" class="ghost-button-full-color"><i class="far fa-times-circle"></i></a><a href="javascript: playAt(' + i +
')"><img src="http://img.youtube.com/vi/' + yt[i].videoId + '/0.jpg"></a></div><a href="javascript: playAt(' + i + ')" class="desc">' + yt[i].title + '</a></li>'
}
} else {
html += '<li class="vid-item"></li>'
}
$vidlist.html(html)
});
// Prevent special characters from being typed
$('#roomnum').on('keypress', function (event) {
var nosymbols = new RegExp("^[a-zA-Z0-9\s]+$");
var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
console.log(key)
console.log(event.keyCode)
// Allow enters and spaces to be used still
if ($roomnum.val().length > 50 || !nosymbols.test(key) && event.keyCode != 13 && event.keyCode != 32 && event.keyCode != 45 && event.keyCode != 95) {
event.preventDefault();
return false;
}
});
// Prevent special characters from being typed
$('#username').on('keypress', function (event) {
var nosymbols = new RegExp("^[a-zA-Z0-9\s]+$");
var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
// Allow enters and spaces to be used still
if ($username.val().length > 30 || !nosymbols.test(key) && event.keyCode != 13 && event.keyCode != 32 && event.keyCode != 45 && event.keyCode != 95) {
event.preventDefault();
return false;
}
});
});
// Remove the video from the queue at idx
function removeAt(idx) {
socket.emit('remove at', {
idx: idx
})
}
function playAt(idx) {
socket.emit('play at', {
idx: idx
}, function (data) {
var videoId = data.videoId
// Change the video
socket.emit('change video', {
room: roomnum,
videoId: videoId,
time: 0
})
})
}
// Turn off the lights!
var per = 0;
$(document).ready(function () {
$("#persoff").css("height", $(document).height()).hide();
$(document).click(function (e) {
if (!$(e.target).hasClass('switch') && per == 1) {
$("#persoff").toggle();
per = 0;
}
});
$(".switch").click(function () {
$("#persoff").toggle();
per += 1;
if (per == 2) {
per = 0;
}
});
});
// playlist
$(document).ready(function () {
$(".arrow-right").bind("click", function (event) {
event.preventDefault();
$(".vid-list-container").stop().animate({
scrollLeft: "+=336"
}, 750);
});
$(".arrow-left").bind("click", function (event) {
event.preventDefault();
$(".vid-list-container").stop().animate({
scrollLeft: "-=336"
}, 750);
});
});
// set id
socket.on('set id', function (data) {
// Ensure no valid id too
if (data.id != "" && nosymbols.test(data.id)) {
document.getElementById('roomnum').value = data.id
// Probably should not force it to be readonly
console.log("You are joining room: " + data.id)
}
// Reset url for next person
// Workaround
socket.emit('reset url')
});
function copyInvite() {
/* Get the text field */
var copyText = document.getElementById("inv_input");
console.log(copyText)
/* Select the text field */
copyText.select();
/* Copy the text inside the text field */
document.execCommand("Copy");
/* Alert the copied text */
// alert("Copied the text: " + copyText.value);
var tooltip = document.getElementById("myTooltip");
tooltip.innerHTML = "Copied!";
}
function outFunc() {
var tooltip = document.getElementById("myTooltip");
tooltip.innerHTML = "Copy to clipboard";
}
// Generate a random alphanumeric room id
function randomroom() {
document.getElementById('roomnum').value = Math.random().toString(36).substr(2, 12)
}
</script>
<!-- Bootstrap core JavaScript -->
<script src="js/dependencies/jquery.min.js"></script>
<script src="js/dependencies/bootstrap.bundle.min.js"></script>
<script src="js/dependencies/scrolling-nav.js"></script>
<script src="js/dependencies/bootstrap-notify.min.js"></script>
<!-- Plugin JavaScript -->
<script src="js/dependencies/jquery.easing.min.js"></script>
<!-- My JS files -->
<script src="js/sync.js"></script>
<script src="js/player.js"></script>
<script src="js/host.js"></script>
<script src="js/events.js"></script>
<script src="js/notify.js"></script>
<!-- Youtube -->
<script src="js/yt.js"></script>
<!-- Daily Motion -->
<script src="https://api.dmcdn.net/all.js"></script>
<script src="js/dm.js"></script>
<!-- Vimeo -->
<script src="https://player.vimeo.com/api/player.js"></script>
<script src="js/vimeo.js"></script>
<!-- HTML5 Player -->
<script src="js/html5.js"></script>
</body>
</html>