From 7969cff66d5f9ac7ff04d1a7bdbce7238741b374 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 18 Aug 2022 12:28:10 +0200 Subject: [PATCH] Change all APPLICATION_SERVER_URL to http://localhost:5000/ --- openvidu-angular/src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- .../src/app/app.component.ts | 2 +- openvidu-filters/web/app.js | 195 ++++++++---------- openvidu-hello-world/web/app.js | 2 +- openvidu-ionic/src/app/app.component.ts | 2 +- openvidu-js-screen-share/web/app.js | 2 +- openvidu-js/web/app.js | 2 +- openvidu-library-react/src/App.js | 2 +- openvidu-react/src/App.js | 2 +- openvidu-virtual-background/web/app.js | 2 +- openvidu-vue/src/App.vue | 2 +- openvidu-webcomponent/web/app.js | 2 +- 25 files changed, 108 insertions(+), 135 deletions(-) diff --git a/openvidu-angular/src/app/app.component.ts b/openvidu-angular/src/app/app.component.ts index 9198d7d8..acad8618 100644 --- a/openvidu-angular/src/app/app.component.ts +++ b/openvidu-angular/src/app/app.component.ts @@ -10,7 +10,7 @@ import { OpenVidu, Publisher, Session, StreamEvent, StreamManager, Subscriber } }) export class AppComponent implements OnDestroy { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; // OpenVidu objects OV: OpenVidu; diff --git a/openvidu-components/openvidu-additional-panels/src/app/app.component.ts b/openvidu-components/openvidu-additional-panels/src/app/app.component.ts index c3040a77..dae8a3dc 100644 --- a/openvidu-components/openvidu-additional-panels/src/app/app.component.ts +++ b/openvidu-components/openvidu-additional-panels/src/app/app.component.ts @@ -49,7 +49,7 @@ import { TokenModel, PanelService, PanelType } from "openvidu-angular"; }) export class AppComponent { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "toolbar-additionalbtn-directive-example"; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-activities-panel/src/app/app.component.ts b/openvidu-components/openvidu-custom-activities-panel/src/app/app.component.ts index a779a53b..d084114f 100644 --- a/openvidu-components/openvidu-custom-activities-panel/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-activities-panel/src/app/app.component.ts @@ -30,7 +30,7 @@ import { TokenModel } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "activities-panel-directive-example"; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-chat-panel/src/app/app.component.ts b/openvidu-components/openvidu-custom-chat-panel/src/app/app.component.ts index cb80de5d..007088fe 100644 --- a/openvidu-components/openvidu-custom-chat-panel/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-chat-panel/src/app/app.component.ts @@ -35,7 +35,7 @@ import { Session, SignalOptions } from "openvidu-browser"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "chat-panel-directive-example"; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-layout/src/app/app.component.ts b/openvidu-components/openvidu-custom-layout/src/app/app.component.ts index 7a8897e1..7e13799c 100644 --- a/openvidu-components/openvidu-custom-layout/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-layout/src/app/app.component.ts @@ -35,7 +35,7 @@ import { TokenModel, ParticipantService, ParticipantAbstractModel } from "openvi }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'layout-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-panels/src/app/app.component.ts b/openvidu-components/openvidu-custom-panels/src/app/app.component.ts index 84920b7d..3e43a50c 100644 --- a/openvidu-components/openvidu-custom-panels/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-panels/src/app/app.component.ts @@ -33,7 +33,7 @@ import { TokenModel } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "panel-directive-example"; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-participant-panel-item-elements/src/app/app.component.ts b/openvidu-components/openvidu-custom-participant-panel-item-elements/src/app/app.component.ts index 43c9eb2e..bf5aad56 100644 --- a/openvidu-components/openvidu-custom-participant-panel-item-elements/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-participant-panel-item-elements/src/app/app.component.ts @@ -23,7 +23,7 @@ import { TokenModel, OpenViduService } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "participants-panel-directive-example"; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-participant-panel-item/src/app/app.component.ts b/openvidu-components/openvidu-custom-participant-panel-item/src/app/app.component.ts index 00d8de19..52941767 100644 --- a/openvidu-components/openvidu-custom-participant-panel-item/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-participant-panel-item/src/app/app.component.ts @@ -22,7 +22,7 @@ import { TokenModel } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'participants-panel-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-participants-panel/src/app/app.component.ts b/openvidu-components/openvidu-custom-participants-panel/src/app/app.component.ts index 8693b818..79d6a5f7 100644 --- a/openvidu-components/openvidu-custom-participants-panel/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-participants-panel/src/app/app.component.ts @@ -34,7 +34,7 @@ import { ParticipantAbstractModel, ParticipantService, TokenModel } from "openvi }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'participants-panel-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-stream/src/app/app.component.ts b/openvidu-components/openvidu-custom-stream/src/app/app.component.ts index 1a35f552..d6ffdf4b 100644 --- a/openvidu-components/openvidu-custom-stream/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-stream/src/app/app.component.ts @@ -25,7 +25,7 @@ import { TokenModel } from 'openvidu-angular'; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'toolbar-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-toolbar/src/app/app.component.ts b/openvidu-components/openvidu-custom-toolbar/src/app/app.component.ts index cfa8a6c5..c7d5285e 100644 --- a/openvidu-components/openvidu-custom-toolbar/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-toolbar/src/app/app.component.ts @@ -17,7 +17,7 @@ import { OpenViduService, TokenModel } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'toolbar-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-custom-ui/src/app/app.component.ts b/openvidu-components/openvidu-custom-ui/src/app/app.component.ts index 69939134..1ac2af24 100644 --- a/openvidu-components/openvidu-custom-ui/src/app/app.component.ts +++ b/openvidu-components/openvidu-custom-ui/src/app/app.component.ts @@ -11,7 +11,7 @@ import { TokenModel } from "openvidu-angular"; }) export class AppComponent { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'openvidu-custom-ui'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-toggle-hand/src/app/app.component.ts b/openvidu-components/openvidu-toggle-hand/src/app/app.component.ts index aceb5f0b..90b54e02 100644 --- a/openvidu-components/openvidu-toggle-hand/src/app/app.component.ts +++ b/openvidu-components/openvidu-toggle-hand/src/app/app.component.ts @@ -31,7 +31,7 @@ enum SignalApp { }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; tokens: { webcam: string; screen: string }; hasHandRaised: boolean = false; diff --git a/openvidu-components/openvidu-toolbar-buttons/src/app/app.component.ts b/openvidu-components/openvidu-toolbar-buttons/src/app/app.component.ts index 1a9271e8..59ace5ba 100644 --- a/openvidu-components/openvidu-toolbar-buttons/src/app/app.component.ts +++ b/openvidu-components/openvidu-toolbar-buttons/src/app/app.component.ts @@ -22,7 +22,7 @@ import { TokenModel, OpenViduService, ParticipantService } from "openvidu-angula }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = 'toolbar-additionalbtn-directive-example'; tokens!: TokenModel; diff --git a/openvidu-components/openvidu-toolbar-panel-buttons/src/app/app.component.ts b/openvidu-components/openvidu-toolbar-panel-buttons/src/app/app.component.ts index 12465a4e..a712cd5d 100644 --- a/openvidu-components/openvidu-toolbar-panel-buttons/src/app/app.component.ts +++ b/openvidu-components/openvidu-toolbar-panel-buttons/src/app/app.component.ts @@ -17,7 +17,7 @@ import { TokenModel } from "openvidu-angular"; }) export class AppComponent implements OnInit { - APPLICATION_SERVER_URL = window.location.protocol + '//' + window.location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; sessionId = "toolbar-additionalPanelbtn"; tokens!: TokenModel; diff --git a/openvidu-filters/web/app.js b/openvidu-filters/web/app.js index 5bb3b47c..67429073 100644 --- a/openvidu-filters/web/app.js +++ b/openvidu-filters/web/app.js @@ -1,12 +1,8 @@ -// OpenVidu variables var OV; var session; var publisher; - -// Application variables var role = 'PUBLISHER'; // ['SUBSCRIBER', 'PUBLISHER', 'MODERATOR'] -var selectedStreamManager; // Our Publisher or any Subscriber (see https://openvidu.io/api/openvidu-browser/classes/streammanager.html) - +var selectedStreamManager; // Our Publisher or any Subscriber (see https://docs.openvidu.io/en/stable/api/openvidu-browser/classes/StreamManager.html) /* OPENVIDU METHODS */ @@ -59,7 +55,6 @@ function joinSession() { // On every Stream destroyed... session.on('streamDestroyed', event => { - // Delete the HTML element with the user's nickname. HTML videos are automatically removed from DOM removeUserData(event.stream.connection); }); @@ -76,86 +71,85 @@ function joinSession() { // First param is the token got from the OpenVidu deployment. Second param can be retrieved by every user on event // 'streamCreated' (property Stream.connection.data), and will be appended to DOM as the user's nickname - session.connect(token, { clientData: myUserName }) - .then(() => { + session.connect(token, { clientData: myUserName }).then(() => { - // --- 5) Set page layout for active call --- + // --- 5) Set page layout for active call --- - $('#session-title').text(mySessionId); - $('#join').hide(); - $('#session').show(); + $('#session-title').text(mySessionId); + $('#join').hide(); + $('#session').show(); - // --- 6) Get your own camera stream with the desired properties --- + // --- 6) Get your own camera stream with the desired properties --- - if (role !== 'SUBSCRIBER') { - var publisherProperties = { - audioSource: undefined, // The source of audio. If undefined default microphone - videoSource: undefined, // The source of video. If undefined default webcam - publishAudio: true, // Whether you want to start publishing with your audio unmuted or not - publishVideo: true, // Whether you want to start publishing with your video enabled or not - resolution: '1280x720', // The resolution of your video - frameRate: 30, // The frame rate of your video - insertMode: 'APPEND', // How the video is inserted in the target element 'video-container' - mirror: false // Whether to mirror your local video or not - }; + if (role !== 'SUBSCRIBER') { + var publisherProperties = { + audioSource: undefined, // The source of audio. If undefined default microphone + videoSource: undefined, // The source of video. If undefined default webcam + publishAudio: true, // Whether you want to start publishing with your audio unmuted or not + publishVideo: true, // Whether you want to start publishing with your video enabled or not + resolution: '1280x720', // The resolution of your video + frameRate: 30, // The frame rate of your video + insertMode: 'APPEND', // How the video is inserted in the target element 'video-container' + mirror: false // Whether to mirror your local video or not + }; - // If the filter should be enabled from the beginning of the publishing - if (startWithFilterEnabled) { - publisherProperties.filter = { - type: 'GStreamerFilter', - options: { "command": "videobalance saturation=0.0" } - } + // If the filter should be enabled from the beginning of the publishing + if (startWithFilterEnabled) { + publisherProperties.filter = { + type: 'GStreamerFilter', + options: { "command": "videobalance saturation=0.0" } } + } - publisher = OV.initPublisher('video-container', publisherProperties); + publisher = OV.initPublisher('video-container', publisherProperties); - // --- 7) Specify the actions when events take place in our publisher --- + // --- 7) Specify the actions when events take place in our publisher --- - // When our HTML video has been added to DOM... - publisher.on('videoElementCreated', function (event) { - appendUserData(event.element, publisher); - initMainVideo(publisher, myUserName); - }); - // When our video has started playing... - publisher.on('streamPlaying', function (event) { - $('#spinner-' + publisher.stream.connection.connectionId).remove(); - $('#filter-btns').show(); - $('#buttonApplyFilter').prop('value', 'Apply filter to your stream'); - $('#buttonRemoveFilter').prop('value', 'Remove filter of your stream'); - $('#buttonApplyFilter').prop('disabled', false); - $('#buttonRemoveFilter').prop('disabled', false); - if (startWithFilterEnabled) { + // When our HTML video has been added to DOM... + publisher.on('videoElementCreated', function (event) { + appendUserData(event.element, publisher); + initMainVideo(publisher, myUserName); + }); + // When our video has started playing... + publisher.on('streamPlaying', function (event) { + $('#spinner-' + publisher.stream.connection.connectionId).remove(); + $('#filter-btns').show(); + $('#buttonApplyFilter').prop('value', 'Apply filter to your stream'); + $('#buttonRemoveFilter').prop('value', 'Remove filter of your stream'); + $('#buttonApplyFilter').prop('disabled', false); + $('#buttonRemoveFilter').prop('disabled', false); + if (startWithFilterEnabled) { + showRemoveFilterButtons(); + } else { + showApplyFilterButtons(); + } + }); + + // Listen to your filter being applied or removed to update the filter control buttons + publisher.on('streamPropertyChanged', function (event) { + // If the changed property is the filter and the current selected streamManager is our publisher + if (publisher === selectedStreamManager && event.changedProperty === 'filter') { + if (!!event.newValue) { showRemoveFilterButtons(); } else { showApplyFilterButtons(); } - }); + } + }); - // Listen to your filter being applied or removed to update the filter control buttons - publisher.on('streamPropertyChanged', function (event) { - // If the changed property is the filter and the current selected streamManager is our publisher - if (publisher === selectedStreamManager && event.changedProperty === 'filter') { - if (!!event.newValue) { - showRemoveFilterButtons(); - } else { - showApplyFilterButtons(); - } - } - }); + // --- 8) Publish your stream, indicating you want to receive your remote stream to see the filters --- + publisher.subscribeToRemote(); + session.publish(publisher); - // --- 8) Publish your stream, indicating you want to receive your remote stream to see the filters --- - publisher.subscribeToRemote(); - session.publish(publisher); - - } else { - // Show a message warning the subscriber cannot publish - $('#main-video video').css("background", "url('resources/images/subscriber-msg.jpg') round"); - $('#filter-btns').hide(); - } - }) - .catch(error => { - console.log('There was an error connecting to the session:', error.code, error.message); - }); + } else { + // Show a message warning the subscriber cannot publish + $('#main-video video').css("background", "url('resources/images/subscriber-msg.jpg') round"); + $('#filter-btns').hide(); + } + }) + .catch(error => { + console.log('There was an error connecting to the session:', error.code, error.message); + }); }); } @@ -175,6 +169,10 @@ function leaveSession() { $('#session').hide(); } +window.onbeforeunload = function () { + if (session) session.disconnect(); +}; + // --- Filter related methods --- @@ -258,10 +256,6 @@ window.addEventListener('load', function () { $('[data-toggle="tooltip"]').tooltip({ container: 'body', trigger: 'hover' }); }); -window.onbeforeunload = function () { - if (session) session.disconnect(); -}; - function generateParticipantInfo() { $('#sessionId').val("SessionA"); $('#userName').val("Participant" + Math.floor(Math.random() * 100)); @@ -381,66 +375,45 @@ function initMainVideo(streamManager, userData) { * more about the integration of OpenVidu in your application server. */ -var OPENVIDU_SERVER_URL = "https://" + location.hostname + ":4443"; -var OPENVIDU_SERVER_SECRET = "MY_SECRET"; +var APPLICATION_SERVER_URL = "http://localhost:5000/"; -function getToken(mySessionId, role) { - return createSession(mySessionId).then(sessionId => createToken(sessionId, role)); +function getToken(mySessionId) { + return createSession(mySessionId).then(sessionId => createToken(sessionId)); } - -function createSession(sessionId) { // See https://docs.openvidu.io/en/stable/reference-docs/REST-API/#post-openviduapisessions +function createSession(sessionId) { return new Promise((resolve, reject) => { $.ajax({ type: "POST", - url: OPENVIDU_SERVER_URL + "/openvidu/api/sessions", + url: APPLICATION_SERVER_URL + "api/sessions", data: JSON.stringify({ customSessionId: sessionId }), - headers: { - "Authorization": "Basic " + btoa("OPENVIDUAPP:" + OPENVIDU_SERVER_SECRET), - "Content-Type": "application/json" - }, - success: response => resolve(response.id), - error: (error) => { - if (error.status === 409) { - resolve(sessionId); - } else { - console.warn('No connection to OpenVidu Server. This may be a certificate error at ' + OPENVIDU_SERVER_URL); - if (window.confirm('No connection to OpenVidu Server. This may be a certificate error at \"' + OPENVIDU_SERVER_URL + '\"\n\nClick OK to navigate and accept it. ' + - 'If no certificate warning is shown, then check that your OpenVidu Server is up and running at "' + OPENVIDU_SERVER_URL + '"')) { - location.assign(OPENVIDU_SERVER_URL + '/accept-certificate'); - } - } - } + headers: { "Content-Type": "application/json" }, + success: response => resolve(response), // The sessionId + error: (error) => reject(error) }); }); } - -function createToken(sessionId, role) { // See https://docs.openvidu.io/en/stable/reference-docs/REST-API/#post-openviduapisessionsltsession_idgtconnection +function createToken(sessionId, role) { var openviduRole; var jsonBody = { role: role, kurentoOptions: {} }; - if (openviduRole !== 'SUBSCRIBER') { // Only the PUBLISHERS and MODERATORS need to configure the ability of applying filters jsonBody.kurentoOptions = { allowedFilters: ['FaceOverlayFilter', 'ChromaFilter', 'GStreamerFilter'] } } - return new Promise((resolve, reject) => { $.ajax({ - type: "POST", - url: OPENVIDU_SERVER_URL + "/openvidu/api/sessions/" + sessionId + "/connection", + type: 'POST', + url: APPLICATION_SERVER_URL + 'api/sessions/' + sessionId + '/connections', data: JSON.stringify(jsonBody), - headers: { - "Authorization": "Basic " + btoa("OPENVIDUAPP:" + OPENVIDU_SERVER_SECRET), - "Content-Type": "application/json" - }, - success: response => resolve(response.token), - error: error => reject(error) + headers: { "Content-Type": "application/json" }, + success: (response) => resolve(response), // The token + error: (error) => reject(error) }); }); -} +} \ No newline at end of file diff --git a/openvidu-hello-world/web/app.js b/openvidu-hello-world/web/app.js index 41b09671..12ad092c 100644 --- a/openvidu-hello-world/web/app.js +++ b/openvidu-hello-world/web/app.js @@ -57,7 +57,7 @@ window.onbeforeunload = function () { * more about the integration of OpenVidu in your application server. */ -var APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +var APPLICATION_SERVER_URL = "http://localhost:5000/"; function getToken(mySessionId) { return createSession(mySessionId).then(sessionId => createToken(sessionId)); diff --git a/openvidu-ionic/src/app/app.component.ts b/openvidu-ionic/src/app/app.component.ts index a4008708..96c54283 100644 --- a/openvidu-ionic/src/app/app.component.ts +++ b/openvidu-ionic/src/app/app.component.ts @@ -22,7 +22,7 @@ import { }) export class AppComponent implements OnDestroy { - APPLICATION_SERVER_URL = location.protocol + '//' + location.hostname + ':5000/'; + APPLICATION_SERVER_URL = 'http://localhost:5000/'; ANDROID_PERMISSIONS = [ this.androidPermissions.PERMISSION.CAMERA, diff --git a/openvidu-js-screen-share/web/app.js b/openvidu-js-screen-share/web/app.js index 35b2283d..ec54eb66 100644 --- a/openvidu-js-screen-share/web/app.js +++ b/openvidu-js-screen-share/web/app.js @@ -262,7 +262,7 @@ function initMainVideo(videoElement, userData) { * more about the integration of OpenVidu in your application server. */ - var APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; + var APPLICATION_SERVER_URL = "http://localhost:5000/"; function getToken(mySessionId) { return createSession(mySessionId).then(sessionId => createToken(sessionId)); diff --git a/openvidu-js/web/app.js b/openvidu-js/web/app.js index 4b01cb55..810e961f 100644 --- a/openvidu-js/web/app.js +++ b/openvidu-js/web/app.js @@ -192,7 +192,7 @@ function initMainVideo(videoElement, userData) { * more about the integration of OpenVidu in your application server. */ -var APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +var APPLICATION_SERVER_URL = "http://localhost:5000/"; function getToken(mySessionId) { return createSession(mySessionId).then(sessionId => createToken(sessionId)); diff --git a/openvidu-library-react/src/App.js b/openvidu-library-react/src/App.js index 685d4fe4..8a2f8aa7 100644 --- a/openvidu-library-react/src/App.js +++ b/openvidu-library-react/src/App.js @@ -7,7 +7,7 @@ import axios from 'axios'; class App extends Component { constructor(props) { super(props); - this.APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; + this.APPLICATION_SERVER_URL = "http://localhost:5000/"; this.state = { mySessionId: 'SessionA', myUserName: 'OpenVidu_User_' + Math.floor(Math.random() * 100), diff --git a/openvidu-react/src/App.js b/openvidu-react/src/App.js index 13fcca6a..bc894ce7 100644 --- a/openvidu-react/src/App.js +++ b/openvidu-react/src/App.js @@ -5,7 +5,7 @@ import React, { Component } from 'react'; import './App.css'; import UserVideoComponent from './UserVideoComponent'; -const APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +const APPLICATION_SERVER_URL = "http://localhost:5000/"; class App extends Component { diff --git a/openvidu-virtual-background/web/app.js b/openvidu-virtual-background/web/app.js index 2002774b..302dcaac 100644 --- a/openvidu-virtual-background/web/app.js +++ b/openvidu-virtual-background/web/app.js @@ -296,7 +296,7 @@ function imageVirtualBackgroundButtons() { * more about the integration of OpenVidu in your application server. */ -var APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +var APPLICATION_SERVER_URL = "http://localhost:5000/"; function getToken(mySessionId) { return createSession(mySessionId).then(sessionId => createToken(sessionId)); diff --git a/openvidu-vue/src/App.vue b/openvidu-vue/src/App.vue index 3e14372f..7d2519ed 100644 --- a/openvidu-vue/src/App.vue +++ b/openvidu-vue/src/App.vue @@ -49,7 +49,7 @@ import UserVideo from "./components/UserVideo"; axios.defaults.headers.post["Content-Type"] = "application/json"; -const APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +const APPLICATION_SERVER_URL = "http://localhost:5000/"; export default { name: "App", diff --git a/openvidu-webcomponent/web/app.js b/openvidu-webcomponent/web/app.js index d0bde143..81bece7e 100644 --- a/openvidu-webcomponent/web/app.js +++ b/openvidu-webcomponent/web/app.js @@ -111,7 +111,7 @@ function hideForm() { * more about the integration of OpenVidu in your application server. */ -var APPLICATION_SERVER_URL = window.location.protocol + "//" + window.location.hostname + ":5000/"; +var APPLICATION_SERVER_URL = "http://localhost:5000/"; function getToken(mySessionId) { return createSession(mySessionId).then(sessionId => createToken(sessionId));