mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: fix typo. Add sample codes to Events
parent
dbf8a84981
commit
5a5fcc4d5e
|
@ -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)).
|
* 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.
|
* 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.
|
* 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.
|
* 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)).
|
* 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)).
|
||||||
|
|
|
@ -21,6 +21,16 @@ import { StreamManagerEventMap } from './StreamManagerEventMap';
|
||||||
/**
|
/**
|
||||||
* Events dispatched by [[Publisher]] object. Manage event listeners with
|
* Events dispatched by [[Publisher]] object. Manage event listeners with
|
||||||
* [[Publisher.on]], [[Publisher.once]] and [[Publisher.off]] methods.
|
* [[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 {
|
export interface PublisherEventMap extends StreamManagerEventMap {
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,16 @@ import { StreamPropertyChangedEvent } from '../StreamPropertyChangedEvent';
|
||||||
/**
|
/**
|
||||||
* Events dispatched by [[Session]] object. Manage event listeners with
|
* Events dispatched by [[Session]] object. Manage event listeners with
|
||||||
* [[Session.on]], [[Session.once]] and [[Session.off]] methods.
|
* [[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 {
|
export interface SessionEventMap extends EventMap {
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,16 @@ import { VideoElementEvent } from '../VideoElementEvent';
|
||||||
/**
|
/**
|
||||||
* Events dispatched by [[StreamManager]] object. Manage event listeners with
|
* Events dispatched by [[StreamManager]] object. Manage event listeners with
|
||||||
* [[StreamManager.on]], [[StreamManager.once]] and [[StreamManager.off]] methods.
|
* [[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 {
|
export interface StreamManagerEventMap extends EventMap {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue