openvidu-getaroom new style and pathnames allowed in URL
This commit is contained in:
parent
9a0d002ad3
commit
ab9857864e
@ -28,9 +28,10 @@ window.addEventListener('beforeunload', function () {
|
||||
|
||||
function joinRoom(sessionId) {
|
||||
|
||||
var pathname = (location.pathname.slice(-1) === "/" ? location.pathname : location.pathname+"/");
|
||||
if (!sessionId) {
|
||||
// If the user is joining to a new room
|
||||
var sessionId = '#' + randomString();
|
||||
sessionId = '#' + randomString();
|
||||
}
|
||||
|
||||
// As insecure OpenVidu, the user's token can be a random string
|
||||
@ -38,11 +39,11 @@ function joinRoom(sessionId) {
|
||||
|
||||
// --- 1) Get an OpenVidu object and init a session with a sessionId ---
|
||||
|
||||
// OpenVidu listening on "localhost:8443"
|
||||
// Init OpenVidu object
|
||||
OV = new OpenVidu();
|
||||
|
||||
// We will join the room "sessionId"
|
||||
session = OV.initSession("wss://" + location.hostname + ":8443/" + sessionId);
|
||||
// We will join the video-call "sessionId". This parameter must start with the URL of OpenVidu Server, with secure WebSocket protocol ('wss://')
|
||||
session = OV.initSession("wss://" + location.hostname + ":8443" + pathname + sessionId);
|
||||
|
||||
|
||||
// --- 2) Specify the actions when events take place ---
|
||||
@ -95,7 +96,7 @@ function joinRoom(sessionId) {
|
||||
}
|
||||
});
|
||||
|
||||
window.history.pushState("", "", '/' + sessionId);
|
||||
window.history.pushState("", "", pathname + sessionId);
|
||||
|
||||
showSessionHideJoin();
|
||||
initializeSessionView();
|
||||
@ -110,7 +111,7 @@ function leaveRoom() {
|
||||
session.disconnect();
|
||||
|
||||
showJoinHideSession();
|
||||
window.location.href = window.location.origin;
|
||||
window.location.href = window.location.origin + window.location.pathname;
|
||||
}
|
||||
|
||||
|
||||
@ -152,14 +153,22 @@ function randomString() {
|
||||
|
||||
// 'Session' page
|
||||
function showSessionHideJoin() {
|
||||
$('#nav-join').hide();
|
||||
$('#nav-session').show();
|
||||
$('#join').hide();
|
||||
$('#session').show();
|
||||
$('footer').hide();
|
||||
$('#main-container').removeClass('container');
|
||||
}
|
||||
|
||||
// 'Join' page
|
||||
function showJoinHideSession() {
|
||||
$('#nav-join').show();
|
||||
$('#nav-session').hide();
|
||||
$('#join').show();
|
||||
$('#session').hide();
|
||||
$('footer').show();
|
||||
$('#main-container').addClass('container');
|
||||
}
|
||||
|
||||
// Prepare HTML dynamic elements (URL clipboard input)
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
<title>OpenVidu getaroom</title>
|
||||
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="resources/images/favicon.ico" type="image/x-icon">
|
||||
|
||||
<script src="OpenVidu.js"></script>
|
||||
<script src="app.js"></script>
|
||||
@ -12,11 +13,15 @@
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<!--Bootstrap -->
|
||||
<!-- Bootstrap -->
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
|
||||
crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||
crossorigin="anonymous">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
|
||||
crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<!-- Bootstrap -->
|
||||
|
||||
<!--Custom styles -->
|
||||
<link rel="styleSheet" href="style.css" type="text/css" media="screen">
|
||||
@ -25,40 +30,66 @@
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Join page template -->
|
||||
<div id="join" class="row no-margin" style="display: none;">
|
||||
<div class="jumbotron col-lg-4 col-md-6 col-centered">
|
||||
<h1>Join a room!</h1>
|
||||
<button type="button" class="btn btn-success" onclick="joinRoom()">Join Room</button>
|
||||
<nav id="nav-join" class="navbar navbar-default" hidden>
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#"><span class="arciform">openVidu getaroom</span></a>
|
||||
<a class="navbar-brand nav-icon" href="https://github.com/OpenVidu/openvidu-tutorials/tree/master/openvidu-getaroom" target="_blank"><i class="fa fa-github" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Session page template -->
|
||||
<div id="session" style="display: none;">
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<button type="button" class="btn btn-danger" onclick="leaveRoom()">Leave Room</button>
|
||||
<nav id="nav-session" class="navbar navbar-default" hidden>
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a href="http://www.openvidu.io/" target="_blank"><img src="resources/images/openvidu_globe_bg_transp_cropped.png"/></a>
|
||||
<button id="leave-room" type="button" class="btn btn-danger" onclick="leaveRoom()">Leave Room</button>
|
||||
<form>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Some path" id="copy-input">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="copy-button" data-toggle="tooltip" data-placement="button" title="Copy to Clipboard">Share the URL</button>
|
||||
</span>
|
||||
<button class="btn btn-default" type="button" id="copy-button" data-toggle="tooltip" data-placement="button" title="Copy to Clipboard">Share the URL</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<button id="mute-video" type="button" class="btn btn-primary float-right mute-button" onclick="muteVideo()">
|
||||
<span class="glyphicon glyphicon-facetime-video"></span> <span class="hidden-xs">Video</span>
|
||||
</button>
|
||||
<span class="glyphicon glyphicon-facetime-video"></span> <span class="hidden-xs">Video</span>
|
||||
</button>
|
||||
<button id="mute-audio" type="button" class="btn btn-primary float-right mute-button" onclick="muteAudio()">
|
||||
<span class="glyphicon glyphicon-volume-up"></span> <span class="hidden-xs">Audio</span>
|
||||
</button>
|
||||
<span class="glyphicon glyphicon-volume-up"></span> <span class="hidden-xs">Audio</span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
<div id="videos" class="row no-margin">
|
||||
<div id="publisher"></div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div id="main-container" class="container">
|
||||
|
||||
<!-- Join page template -->
|
||||
<div id="join" class="row no-margin" hidden>
|
||||
<div class="jumbotron col-lg-4 col-md-6 col-centered">
|
||||
<div id="img-div"><img src="resources/images/openvidu_grey_bg_transp_cropped.png" /></div>
|
||||
<h1 class="arciform">getaroom</h1>
|
||||
<button type="button" class="btn btn-success" onclick="joinRoom()">Go!</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Session page template -->
|
||||
<div id="session" hidden>
|
||||
|
||||
<div id="videos" class="row no-margin">
|
||||
<div id="publisher"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="text-muted arciform">openVidu © 2017</div>
|
||||
<a href="http://www.openvidu.io/" target="_blank"><img src="resources/images/openvidu_globe_bg_transp_cropped.png"/></a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
openvidu-getaroom/web/resources/fonts/Arciform.eot
Normal file
BIN
openvidu-getaroom/web/resources/fonts/Arciform.eot
Normal file
Binary file not shown.
2408
openvidu-getaroom/web/resources/fonts/Arciform.svg
Normal file
2408
openvidu-getaroom/web/resources/fonts/Arciform.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 131 KiB |
BIN
openvidu-getaroom/web/resources/fonts/Arciform.ttf
Normal file
BIN
openvidu-getaroom/web/resources/fonts/Arciform.ttf
Normal file
Binary file not shown.
BIN
openvidu-getaroom/web/resources/fonts/Arciform.woff
Normal file
BIN
openvidu-getaroom/web/resources/fonts/Arciform.woff
Normal file
Binary file not shown.
BIN
openvidu-getaroom/web/resources/images/favicon.ico
Normal file
BIN
openvidu-getaroom/web/resources/images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@ -1,3 +1,207 @@
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
nav {
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
background-color: #4d4d4d !important;
|
||||
border-color: #4d4d4d !important;
|
||||
border-top-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
padding: 5px 15px 5px 15px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
nav a {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
nav i.fa {
|
||||
font-size: 40px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
nav a:hover {
|
||||
color: #a9a9a9 !important;
|
||||
}
|
||||
|
||||
nav i.fa:hover {
|
||||
font-size: 40px;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
|
||||
.vertical-center {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
|
||||
.horizontal-center {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
color: #0088aa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: #0088aa;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(0, 136, 170, 0.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(0, 136, 170, 0.6);
|
||||
}
|
||||
|
||||
input.btn {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background-color: #0088aa !important;
|
||||
border-color: #0088aa;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
background-color: #4d4d4d;
|
||||
}
|
||||
|
||||
.footer .text-muted {
|
||||
margin: 20px 0;
|
||||
float: left;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.footer img {
|
||||
height: 35px;
|
||||
float: right;
|
||||
margin: 12px 0;
|
||||
-webkit-transition: all 0.1s ease-in-out;
|
||||
-moz-transition: all 0.1s ease-in-out;
|
||||
-o-transition: all 0.1s ease-in-out;
|
||||
transition: all 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.footer img:hover {
|
||||
-webkit-filter: grayscale(0.5);
|
||||
filter: grayscale(0.5);
|
||||
}
|
||||
|
||||
#join h1 {
|
||||
color: #4d4d4d;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#img-div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#img-div img {
|
||||
height: 15%;
|
||||
}
|
||||
|
||||
#join label {
|
||||
color: #0088aa;
|
||||
}
|
||||
|
||||
#join input.btn {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#session-header {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#session-title {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#buttonLeaveSession {
|
||||
float: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#video-container video {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#video-container div {
|
||||
float: left;
|
||||
width: 50%;
|
||||
position: relative;
|
||||
margin-left: -50%;
|
||||
}
|
||||
|
||||
#video-container p {
|
||||
display: inline-block;
|
||||
background: #f8f8f8;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: #777777;
|
||||
font-weight: bold;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
#main-video p {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
background: #f8f8f8;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
font-size: 22px;
|
||||
color: #777777;
|
||||
font-weight: bold;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
#session img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: inline-block;
|
||||
object-fit: contain;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
#session #video-container img {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 50%;
|
||||
cursor: pointer;
|
||||
object-fit: cover;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
|
||||
.arciform {
|
||||
font-family: Arciform;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Arciform';
|
||||
src: url('/resources/fonts/Arciform.eot'); /* IE9 Compat Modes */
|
||||
src: url('/resources/fonts/Arciform.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('/resources/fonts/Arciform.woff') format('woff'), /* Modern Browsers */
|
||||
url('/resources/fonts/Arciform.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/resources/fonts/Arciform.svg#svgFontName') format('svg'); /* Legacy iOS */
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
@ -14,7 +218,6 @@ div#session {
|
||||
height: 100%;
|
||||
background-color: #000000;
|
||||
position: relative;
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.col-centered {
|
||||
@ -50,6 +253,7 @@ div#session {
|
||||
min-height: 200px;
|
||||
flex-wrap: wrap;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
video {
|
||||
@ -118,14 +322,34 @@ span.glyphicon {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
nav {
|
||||
height: 50px;
|
||||
margin: 0;
|
||||
nav#nav-session {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
nav div.container {
|
||||
nav#nav-session div.container {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8
|
||||
padding-bottom: 8;
|
||||
}
|
||||
|
||||
nav#nav-session img {
|
||||
height: 35px;
|
||||
float: left;
|
||||
-webkit-transition: all 0.1s ease-in-out;
|
||||
-moz-transition: all 0.1s ease-in-out;
|
||||
-o-transition: all 0.1s ease-in-out;
|
||||
transition: all 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
nav#nav-session img:hover {
|
||||
-webkit-filter: grayscale(0.5);
|
||||
filter: grayscale(0.5);
|
||||
}
|
||||
|
||||
#leave-room {
|
||||
float: right;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
form {
|
||||
@ -139,6 +363,7 @@ form {
|
||||
|
||||
.mute-button {
|
||||
margin-right: 5px;
|
||||
background: #0088aa;
|
||||
}
|
||||
|
||||
button {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user