openvidu/openvidu-browser/lib/OpenVidu/Stream.d.ts

164 lines
3.7 KiB
TypeScript
Raw Normal View History

import { Connection } from './Connection';
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 { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions';
2018-06-01 14:39:38 +02:00
import EventEmitter = require('wolfy87-eventemitter');
2018-04-26 15:33:47 +02:00
/**
2018-06-01 14:39:38 +02:00
* Represents each one of the media streams available in OpenVidu Server for certain session.
* Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access
* to one of them (sending and receiving it, respectively)
2018-04-26 15:33:47 +02:00
*/
export declare class Stream {
/**
* The Connection object that is publishing the stream
*/
connection: Connection;
/**
2018-06-01 14:39:38 +02:00
* Frame rate of the video in frames per second. This property is only defined if the [[Publisher]] of
* the stream was initialized passing a _frameRate_ property on [[OpenVidu.initPublisher]] method
2018-04-26 15:33:47 +02:00
*/
frameRate?: number;
/**
* Whether the stream has a video track or not
*/
hasVideo: boolean;
/**
* Whether the stream has an audio track or not
*/
hasAudio: boolean;
/**
* Unique identifier of the stream
*/
streamId: string;
/**
2018-06-01 14:39:38 +02:00
* `"CAMERA"` or `"SCREEN"`. *undefined* if stream is audio-only
2018-04-26 15:33:47 +02:00
*/
typeOfVideo?: string;
/**
2018-06-01 14:39:38 +02:00
* StreamManager object ([[Publisher]] or [[Subscriber]]) in charge of displaying this stream in the DOM
2018-04-26 15:33:47 +02:00
*/
2018-06-01 14:39:38 +02:00
streamManager: StreamManager;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
ee: EventEmitter;
private webRtcPeer;
private mediaStream;
private webRtcStats;
private isSubscribeToRemote;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
isLocalStreamReadyToPublish: boolean;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
isLocalStreamPublished: boolean;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
session: Session;
/**
* @hidden
*/
inboundStreamOpts: InboundStreamOptions;
/**
* @hidden
*/
outboundStreamOpts: OutboundStreamOptions;
/**
* @hidden
*/
speechEvent: any;
/**
* @hidden
*/
constructor(session: Session, options: InboundStreamOptions | OutboundStreamOptions | {});
/**
* @hidden
*/
getMediaStream(): MediaStream;
/**
* @hidden
*/
setMediaStream(mediaStream: MediaStream): void;
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
updateMediaStreamInVideos(): void;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
getWebRtcPeer(): any;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
getRTCPeerConnection(): RTCPeerConnection;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
2018-06-01 14:39:38 +02:00
subscribeToMyRemote(value: boolean): void;
2018-04-26 15:33:47 +02:00
/**
* @hidden
*/
setOutboundStreamOptions(outboundStreamOpts: OutboundStreamOptions): void;
/**
* @hidden
*/
subscribe(): Promise<any>;
/**
* @hidden
*/
publish(): Promise<any>;
/**
* @hidden
*/
disposeWebRtcPeer(): void;
/**
* @hidden
*/
disposeMediaStream(): void;
/**
* @hidden
*/
displayMyRemote(): boolean;
/**
* @hidden
*/
isSendAudio(): boolean;
/**
* @hidden
*/
isSendVideo(): boolean;
/**
* @hidden
*/
isSendScreen(): boolean;
/**
* @hidden
*/
setSpeechEventIfNotExists(): void;
/**
* @hidden
*/
enableSpeakingEvents(): void;
/**
* @hidden
*/
enableOnceSpeakingEvents(): void;
/**
* @hidden
*/
disableSpeakingEvents(): void;
private initWebRtcPeerSend;
private initWebRtcPeerReceive;
private processSdpAnswer;
private initWebRtcStats;
private stopWebRtcStats;
2018-06-01 14:39:38 +02:00
/**
* @hidden
*/
isLocal(): boolean;
2018-04-26 15:33:47 +02:00
}