openvidu-browser: fix typo. Add sample codes to Events

pull/672/merge
pabloFuente 2022-08-04 16:57:04 +02:00
parent dbf8a84981
commit 5a5fcc4d5e
4 changed files with 31 additions and 1 deletions

View File

@ -193,7 +193,7 @@ export class Session extends EventDispatcher {
* and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `sessionDisconnected` to avoid this behavior and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more.
*
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).

View File

@ -21,6 +21,16 @@ import { StreamManagerEventMap } from './StreamManagerEventMap';
/**
* Events dispatched by [[Publisher]] object. Manage event listeners with
* [[Publisher.on]], [[Publisher.once]] and [[Publisher.off]] methods.
*
* Example:
*
* ```javascript
* publisher.on('accessDenied', () => {
* console.error('Camera access has been denied!');
* }
*
* publisher.off('accessDenied');
* ```
*/
export interface PublisherEventMap extends StreamManagerEventMap {

View File

@ -30,6 +30,16 @@ import { StreamPropertyChangedEvent } from '../StreamPropertyChangedEvent';
/**
* Events dispatched by [[Session]] object. Manage event listeners with
* [[Session.on]], [[Session.once]] and [[Session.off]] methods.
*
* Example:
*
* ```javascript
* session.on('connectionCreated', (event) => {
* console.log('Connection ' + event.connection.connectionId + ' created');
* }
*
* session.off('connectionDestroyed');
* ```
*/
export interface SessionEventMap extends EventMap {

View File

@ -24,6 +24,16 @@ import { VideoElementEvent } from '../VideoElementEvent';
/**
* Events dispatched by [[StreamManager]] object. Manage event listeners with
* [[StreamManager.on]], [[StreamManager.once]] and [[StreamManager.off]] methods.
*
* Example:
*
* ```javascript
* streamManager.on('videoElementCreated', (event) => {
* console.log('New video element created:', event.element);
* }
*
* streamManager.off('videoElementCreated');
* ```
*/
export interface StreamManagerEventMap extends EventMap {