diff --git a/openvidu-webcomponent/web/app.css b/openvidu-webcomponent/web/app.css new file mode 100644 index 00000000..3ec0e9ce --- /dev/null +++ b/openvidu-webcomponent/web/app.css @@ -0,0 +1,19 @@ + +:root { + --ov-primary-color: #303030; + --ov-secondary-color: #3e3f3f; + --ov-secondary-light-color: #e6e6e6; + --ov-tertiary-color: #598eff; + --ov-warn-color: #EB5144; + --ov-accent-color: #ffae35; + + --ov-text-color: #ffffff; + + --ov-panel-text-color: #1d1d1d; + --ov-panel-background: #ffffff; + + --ov-buttons-radius: 50%; + --ov-leave-button-radius: 10px; + --ov-video-radius: 5px; + --ov-panel-radius: 5px; + } \ No newline at end of file diff --git a/openvidu-webcomponent/web/app.js b/openvidu-webcomponent/web/app.js index 58974bbf..d3fc9d6e 100644 --- a/openvidu-webcomponent/web/app.js +++ b/openvidu-webcomponent/web/app.js @@ -1,13 +1,9 @@ -$(document).ready(() => { + +$(document).ready(async() => { var webComponent = document.querySelector('openvidu-webcomponent'); var form = document.getElementById('main'); - if(webComponent.getAttribute("openvidu-secret") != undefined && webComponent.getAttribute("openvidu-server-url") != undefined ){ - form.style.display = 'none'; - webComponent.style.display = 'block'; - } - - webComponent.addEventListener('sessionCreated', (event) => { + webComponent.addEventListener('onSessionCreated', (event) => { var session = event.detail; // You can see the session documentation here @@ -27,55 +23,74 @@ $(document).ready(() => { session.on('sessionDisconnected', (event) => { console.warn("sessionDisconnected event"); - document.body.style.backgroundColor = "white"; form.style.display = 'block'; webComponent.style.display = 'none'; }); session.on('exception', (exception) => { - console.warn(exception); + console.error(exception); }); }); - webComponent.addEventListener('publisherCreated', (event) => { - var publisher = event.detail; + webComponent.addEventListener('onJoinButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarLeaveButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarCameraButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarMicrophoneButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarScreenshareButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarParticipantsPanelButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarChatPanelButtonClicked', (event) => {}); + webComponent.addEventListener('onToolbarFullscreenButtonClicked', (event) => {}); + webComponent.addEventListener('onParticipantCreated', (event) => {}); - // You can see the publisher documentation here - // https://docs.openvidu.io/en/stable/api/openvidu-browser/classes/publisher.html - - publisher?.on('streamCreated', (e) => { - console.warn("Publisher streamCreated", e); - }); - - publisher?.on('streamPlaying', (e) => { - console.warn("Publisher streamPlaying", e); - }); - - document.body.style.backgroundColor = "gray"; - form.style.display = 'none'; - webComponent.style.display = 'block'; - }); - - - webComponent.addEventListener('error', (event) => { - console.log('Error event', event.detail); - }); }); async function joinSession() { + //Getting form inputvalue var sessionName = document.getElementById('sessionName').value; - var user = document.getElementById('user').value; - var webComponent = document.querySelector('openvidu-webcomponent'); - var tokens = []; + var participantName = document.getElementById('user').value; + + // Requesting tokens + var tokens = {webcam: await getToken(sessionName), screen: await getToken(sessionName)}; + + //Getting the webcomponent element + var webComponent = document.querySelector('openvidu-webcomponent'); + + hideForm(); + + // Displaying webcomponent + webComponent.style.display = 'block'; + + // webComponent.participantName = participantName; + + // You can see the UI parameters documentation here + // https://docs.openvidu.io/en/stable/api/openvidu-angular/components/OpenviduWebComponentComponent.html#inputs + + // webComponent.toolbarScreenshareButton = false; + // webComponent.minimal = true; + // webComponent.prejoin = true; + + // webComponent.videoMuted = false; + // webComponent.audioMuted = false; + + // webComponent.toolbarScreenshareButton = true; + // webComponent.toolbarFullscreenButton = true; + // webComponent.toolbarLeaveButton = true; + // webComponent.toolbarChatPanelButton = true; + // webComponent.toolbarParticipantsPanelButton = true; + // webComponent.toolbarDisplayLogo = true; + // webComponent.toolbarDisplaySessionName = true; + // webComponent.streamDisplayParticipantName = true; + // webComponent.streamDisplayAudioDetection = true; + // webComponent.streamSettingsButton = true; + // webComponent.participantPanelItemMuteButton = true; + + webComponent.tokens = tokens; +} + +function hideForm() { + var form = document.getElementById('main'); + form.style.display = 'none'; - if(webComponent.getAttribute("openvidu-secret") != undefined && webComponent.getAttribute("openvidu-server-url") != undefined ){ - location.reload(); - }else { - var token1 = await getToken(sessionName) - var token2 = await getToken(sessionName); - tokens.push(token1, token2); - webComponent.sessionConfig = { sessionName, user, tokens }; - } } /** diff --git a/openvidu-webcomponent/web/assets/images/logo.png b/openvidu-webcomponent/web/assets/images/logo.png new file mode 100644 index 00000000..4c2bfc85 Binary files /dev/null and b/openvidu-webcomponent/web/assets/images/logo.png differ diff --git a/openvidu-webcomponent/web/assets/images/openvidu_globe.png b/openvidu-webcomponent/web/assets/images/openvidu_globe.png deleted file mode 100644 index e0309e62..00000000 Binary files a/openvidu-webcomponent/web/assets/images/openvidu_globe.png and /dev/null differ diff --git a/openvidu-webcomponent/web/assets/images/openvidu_logo.png b/openvidu-webcomponent/web/assets/images/openvidu_logo.png deleted file mode 100644 index a1c8b2d7..00000000 Binary files a/openvidu-webcomponent/web/assets/images/openvidu_logo.png and /dev/null differ diff --git a/openvidu-webcomponent/web/assets/images/poster.png b/openvidu-webcomponent/web/assets/images/poster.png deleted file mode 100644 index 1ac9a2b4..00000000 Binary files a/openvidu-webcomponent/web/assets/images/poster.png and /dev/null differ diff --git a/openvidu-webcomponent/web/index.html b/openvidu-webcomponent/web/index.html index 8700a3cf..a5fa035d 100644 --- a/openvidu-webcomponent/web/index.html +++ b/openvidu-webcomponent/web/index.html @@ -10,6 +10,7 @@ + @@ -33,8 +34,7 @@ - - + \ No newline at end of file