2018-07-11 11:47:53 +02:00
|
|
|
/// <reference types="node" />
|
2018-05-08 13:01:34 +02:00
|
|
|
import { OpenVidu } from './OpenVidu';
|
|
|
|
import { Session } from './Session';
|
2018-06-01 14:39:38 +02:00
|
|
|
import { StreamManager } from './StreamManager';
|
2018-04-26 15:33:47 +02:00
|
|
|
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
|
|
|
|
import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties';
|
2018-06-01 14:39:38 +02:00
|
|
|
import { Event } from '../OpenViduInternal/Events/Event';
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
export declare class Publisher extends StreamManager {
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* Whether the Publisher has been granted access to the requested input devices or not
|
|
|
|
*/
|
|
|
|
accessAllowed: boolean;
|
|
|
|
/**
|
2018-06-01 14:39:38 +02:00
|
|
|
* Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)
|
2018-04-26 15:33:47 +02:00
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
isSubscribedToRemote: boolean;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* The [[Session]] to which the Publisher belongs
|
|
|
|
*/
|
|
|
|
session: Session;
|
2018-06-01 14:39:38 +02:00
|
|
|
private accessDenied;
|
2018-04-26 15:33:47 +02:00
|
|
|
private properties;
|
|
|
|
private permissionDialogTimeout;
|
2018-07-11 11:47:53 +02:00
|
|
|
/**
|
2018-10-09 16:39:57 +02:00
|
|
|
* @hidden
|
2018-07-11 11:47:53 +02:00
|
|
|
*/
|
|
|
|
openvidu: OpenVidu;
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
videoReference: HTMLVideoElement;
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
screenShareResizeInterval: NodeJS.Timer;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
constructor(targEl: string | HTMLElement, properties: PublisherProperties, openvidu: OpenVidu);
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect
|
2018-07-11 11:47:53 +02:00
|
|
|
*
|
|
|
|
* #### Events dispatched
|
|
|
|
*
|
|
|
|
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
|
|
|
|
* The [[Publisher]] object of the local participant will also dispatch the exact same event
|
|
|
|
*
|
|
|
|
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
|
|
|
|
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
|
|
|
|
*
|
|
|
|
* See [[StreamPropertyChangedEvent]] to learn more.
|
|
|
|
*
|
2018-04-26 15:33:47 +02:00
|
|
|
* @param value `true` to publish the audio stream, `false` to unpublish it
|
|
|
|
*/
|
|
|
|
publishAudio(value: boolean): void;
|
|
|
|
/**
|
|
|
|
* Publish or unpublish the video stream (if available). Calling this method twice in a row passing same value will have no effect
|
2018-07-11 11:47:53 +02:00
|
|
|
*
|
|
|
|
* #### Events dispatched
|
|
|
|
*
|
|
|
|
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
|
|
|
|
* The [[Publisher]] object of the local participant will also dispatch the exact same event
|
|
|
|
*
|
|
|
|
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
|
|
|
|
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
|
|
|
|
*
|
|
|
|
* See [[StreamPropertyChangedEvent]] to learn more.
|
|
|
|
*
|
2018-04-26 15:33:47 +02:00
|
|
|
* @param value `true` to publish the video stream, `false` to unpublish it
|
|
|
|
*/
|
|
|
|
publishVideo(value: boolean): void;
|
|
|
|
/**
|
2018-07-11 11:47:53 +02:00
|
|
|
* Call this method before [[Session.publish]] if you prefer to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
|
2018-04-26 15:33:47 +02:00
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
subscribeToRemote(value?: boolean): void;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* See [[EventDispatcher.on]]
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
on(type: string, handler: (event: Event) => void): EventDispatcher;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* See [[EventDispatcher.once]]
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
once(type: string, handler: (event: Event) => void): Publisher;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
initialize(): Promise<any>;
|
2018-06-01 14:39:38 +02:00
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
reestablishStreamPlayingEvent(): void;
|
2018-06-04 14:33:57 +02:00
|
|
|
private setPermissionDialogTimer;
|
|
|
|
private clearPermissionDialogTimer;
|
2018-04-26 15:33:47 +02:00
|
|
|
}
|