Added openvidu-browser exception events to tutorials
This commit is contained in:
parent
7f228075af
commit
25c9e3c30d
@ -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.
|
||||
|
||||
@ -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 ---
|
||||
|
||||
|
||||
@ -17,6 +17,11 @@ function joinSession() {
|
||||
}
|
||||
});
|
||||
|
||||
// On every asynchronous exception...
|
||||
session.on('exception', (exception) => {
|
||||
console.warn(exception);
|
||||
});
|
||||
|
||||
getToken(mySessionId).then(token => {
|
||||
|
||||
session.connect(token)
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 ---
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 => {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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) ---
|
||||
|
||||
|
||||
@ -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) ---
|
||||
|
||||
|
||||
@ -132,6 +132,11 @@ export default class App extends Component<Props> {
|
||||
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
|
||||
|
||||
@ -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) ---
|
||||
|
||||
|
||||
@ -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) ---
|
||||
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user