diff --git a/openvidu-getaroom/web/app.js b/openvidu-getaroom/web/app.js index 8e47cade..5b5f8c0e 100644 --- a/openvidu-getaroom/web/app.js +++ b/openvidu-getaroom/web/app.js @@ -21,18 +21,19 @@ window.addEventListener('load', function () { }); // Disconnect participant on browser's window closed -window.onbeforeunload = function () { - session.disconnect() -}; +window.addEventListener('beforeunload', function () { + session.disconnect(); +}); function joinRoom(sessionId) { - // If the user is joining to a new room + if (!sessionId) { + // If the user is joining to a new room var sessionId = '#' + randomString(); } - // As insecure OpenVidu, the user's token will be a random id + // As insecure OpenVidu, the user's token can be a random string var userId = randomString(); // --- 1) Get an OpenVidu object and init a session with a sessionId --- @@ -105,10 +106,10 @@ function joinRoom(sessionId) { function leaveRoom() { - // 6) Leave the session by calling 'disconnect' method over the Session object + // --- 6) Leave the session by calling 'disconnect' method over the Session object --- session.disconnect(); + showJoinHideSession(); - window.location.href = window.location.origin; } diff --git a/openvidu-insecure-angular/src/app/app.component.css b/openvidu-insecure-angular/src/app/app.component.css index 251d4786..92b6e6b3 100644 --- a/openvidu-insecure-angular/src/app/app.component.css +++ b/openvidu-insecure-angular/src/app/app.component.css @@ -1,11 +1,23 @@ -#publisher { - float: left; - width: 20%; - margin: 10px; +.stream-container { + padding: 0; } -#subscriber { - float: left; - width: 20%; - margin: 10px; +#session { + padding-top: 70px; + height: 100vh; + height: 100%; + width: 100%; +} + +#session-header { + margin-bottom: 20px; +} + +#session-title { + display: inline-block; +} + +#buttonLeaveSession { + float: right; + margin-top: 20px; } \ No newline at end of file diff --git a/openvidu-insecure-angular/src/app/app.component.html b/openvidu-insecure-angular/src/app/app.component.html index 21461de9..72f9d964 100644 --- a/openvidu-insecure-angular/src/app/app.component.html +++ b/openvidu-insecure-angular/src/app/app.component.html @@ -1,31 +1,36 @@ -
{{this.getNicknameTag()}}
+ +{{this.getNicknameTag()}}