diff --git a/openvidu-filters/web/app.js b/openvidu-filters/web/app.js index 2a0a5f8a..8c53f0ff 100644 --- a/openvidu-filters/web/app.js +++ b/openvidu-filters/web/app.js @@ -64,6 +64,11 @@ function joinSession() { removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-getaroom/web/app.js b/openvidu-getaroom/web/app.js index 9285239f..9f288206 100644 --- a/openvidu-getaroom/web/app.js +++ b/openvidu-getaroom/web/app.js @@ -63,6 +63,11 @@ function joinRoom() { updateLayout(); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- diff --git a/openvidu-hark-events/web/app.js b/openvidu-hark-events/web/app.js index f91c1101..ac722da4 100644 --- a/openvidu-hark-events/web/app.js +++ b/openvidu-hark-events/web/app.js @@ -17,6 +17,11 @@ function joinSession() { } }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + getToken(mySessionId).then(token => { session.connect(token) diff --git a/openvidu-insecure-angular/src/app/app.component.ts b/openvidu-insecure-angular/src/app/app.component.ts index 2a41db41..ea326fdc 100644 --- a/openvidu-insecure-angular/src/app/app.component.ts +++ b/openvidu-insecure-angular/src/app/app.component.ts @@ -72,6 +72,11 @@ export class AppComponent implements OnDestroy { this.deleteSubscriber(event.stream.streamManager); }); + // On every asynchronous exception... + this.session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-insecure-js/web/app.js b/openvidu-insecure-js/web/app.js index 7b687e09..08bf6bc8 100644 --- a/openvidu-insecure-js/web/app.js +++ b/openvidu-insecure-js/web/app.js @@ -40,6 +40,11 @@ function joinSession() { removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- diff --git a/openvidu-insecure-react/src/App.js b/openvidu-insecure-react/src/App.js index 0c4ceeb0..b460499a 100644 --- a/openvidu-insecure-react/src/App.js +++ b/openvidu-insecure-react/src/App.js @@ -109,6 +109,11 @@ class App extends Component { this.deleteSubscriber(event.stream.streamManager); }); + // On every asynchronous exception... + mySession.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-insecure-vue/src/App.vue b/openvidu-insecure-vue/src/App.vue index fe970a7c..67fac2a6 100644 --- a/openvidu-insecure-vue/src/App.vue +++ b/openvidu-insecure-vue/src/App.vue @@ -90,6 +90,11 @@ export default { } }); + // On every asynchronous exception... + this.session.on('exception', ({ exception }) => { + console.warn(exception); + }); + // --- Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-ionic-capacitor/src/app/app.component.ts b/openvidu-ionic-capacitor/src/app/app.component.ts index c606cb1b..667ddcd7 100644 --- a/openvidu-ionic-capacitor/src/app/app.component.ts +++ b/openvidu-ionic-capacitor/src/app/app.component.ts @@ -93,6 +93,11 @@ export class AppComponent implements OnDestroy { this.deleteSubscriber(event.stream.streamManager); }); + // On every asynchronous exception... + this.session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-ionic/src/app/app.component.ts b/openvidu-ionic/src/app/app.component.ts index c606cb1b..667ddcd7 100644 --- a/openvidu-ionic/src/app/app.component.ts +++ b/openvidu-ionic/src/app/app.component.ts @@ -93,6 +93,11 @@ export class AppComponent implements OnDestroy { this.deleteSubscriber(event.stream.streamManager); }); + // On every asynchronous exception... + this.session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. diff --git a/openvidu-ipcameras/src/main/resources/templates/index.html b/openvidu-ipcameras/src/main/resources/templates/index.html index 8abc63cf..c7d98706 100644 --- a/openvidu-ipcameras/src/main/resources/templates/index.html +++ b/openvidu-ipcameras/src/main/resources/templates/index.html @@ -86,6 +86,11 @@ }); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // Connect to session. We will receive all necessary events when success session.connect(token) .catch(error => { diff --git a/openvidu-js-java/src/main/resources/static/app.js b/openvidu-js-java/src/main/resources/static/app.js index 912e571d..44ed3720 100644 --- a/openvidu-js-java/src/main/resources/static/app.js +++ b/openvidu-js-java/src/main/resources/static/app.js @@ -41,6 +41,11 @@ function joinSession() { removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- @@ -177,7 +182,7 @@ function removeUser() { httpPostRequest( 'api-sessions/remove-user', {sessionName: sessionName, token: token}, - 'User couldn\'t be removed from session', + 'User couldn\'t be removed from session', (response) => { console.warn("You have been removed from session " + sessionName); } diff --git a/openvidu-js-node/public/app.js b/openvidu-js-node/public/app.js index 648fa1d6..a45ace77 100644 --- a/openvidu-js-node/public/app.js +++ b/openvidu-js-node/public/app.js @@ -41,9 +41,14 @@ function joinSession() { removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- - + var nickName = $("#nickName").val(); session.connect(token, { clientData: nickName }) .then(() => { @@ -177,7 +182,7 @@ function removeUser() { httpPostRequest( 'api-sessions/remove-user', {sessionName: sessionName, token: token}, - 'User couldn\'t be removed from session', + 'User couldn\'t be removed from session', (response) => { console.warn("You have been removed from session " + sessionName); } diff --git a/openvidu-mvc-java/src/main/resources/templates/session.html b/openvidu-mvc-java/src/main/resources/templates/session.html index 60be1b90..5a1c6ed2 100644 --- a/openvidu-mvc-java/src/main/resources/templates/session.html +++ b/openvidu-mvc-java/src/main/resources/templates/session.html @@ -109,6 +109,11 @@ removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- diff --git a/openvidu-mvc-node/views/session.ejs b/openvidu-mvc-node/views/session.ejs index 5b6307dd..c147b4fd 100644 --- a/openvidu-mvc-node/views/session.ejs +++ b/openvidu-mvc-node/views/session.ejs @@ -108,6 +108,11 @@ removeUserData(event.stream.connection); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- diff --git a/openvidu-react-native/App.js b/openvidu-react-native/App.js index d34d71ce..a68178ad 100644 --- a/openvidu-react-native/App.js +++ b/openvidu-react-native/App.js @@ -132,6 +132,11 @@ export default class App extends Component { this.deleteSubscriber(event.stream); }); + // On every asynchronous exception... + mySession.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session with a valid user token --- // 'getToken' method is simulating what your server-side should do. // 'token' parameter should be retrieved and returned by your own backend diff --git a/openvidu-recording-java/src/main/resources/static/app.js b/openvidu-recording-java/src/main/resources/static/app.js index 8fd38e5b..55378f83 100644 --- a/openvidu-recording-java/src/main/resources/static/app.js +++ b/openvidu-recording-java/src/main/resources/static/app.js @@ -82,6 +82,11 @@ function joinSession() { pushEvent(event); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- diff --git a/openvidu-recording-node/public/app.js b/openvidu-recording-node/public/app.js index 8fd38e5b..55378f83 100644 --- a/openvidu-recording-node/public/app.js +++ b/openvidu-recording-node/public/app.js @@ -82,6 +82,11 @@ function joinSession() { pushEvent(event); }); + // On every asynchronous exception... + session.on('exception', (exception) => { + console.warn(exception); + }); + // --- 4) Connect to the session passing the retrieved token and some more data from // the client (in this case a JSON with the nickname chosen by the user) --- diff --git a/openvidu-webcomponent/web/app.js b/openvidu-webcomponent/web/app.js index 9f310164..58974bbf 100644 --- a/openvidu-webcomponent/web/app.js +++ b/openvidu-webcomponent/web/app.js @@ -31,6 +31,10 @@ $(document).ready(() => { form.style.display = 'block'; webComponent.style.display = 'none'; }); + + session.on('exception', (exception) => { + console.warn(exception); + }); }); webComponent.addEventListener('publisherCreated', (event) => {