openvidu-browser RpcBuilder import in OpenVidu.ts change to 'require'
This commit is contained in:
parent
6939ca3a9c
commit
3066662ef4
@ -79,5 +79,5 @@ export declare class LocalRecorder {
|
||||
* @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not:
|
||||
*/
|
||||
uploadAsMultipartfile(endpoint: string, headers?: any): Promise<any>;
|
||||
private onStopDefault();
|
||||
private onStopDefault;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var MediaElement = (function () {
|
||||
function MediaElement() {
|
||||
}
|
||||
MediaElement.prototype.on = function (type, handler) {
|
||||
throw new Error("Method not implemented.");
|
||||
};
|
||||
MediaElement.prototype.once = function (type, handler) {
|
||||
throw new Error("Method not implemented.");
|
||||
};
|
||||
MediaElement.prototype.off = function (type, handler) {
|
||||
throw new Error("Method not implemented.");
|
||||
};
|
||||
return MediaElement;
|
||||
}());
|
||||
exports.MediaElement = MediaElement;
|
||||
//# sourceMappingURL=MediaElement.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"MediaElement.js","sourceRoot":"","sources":["../../src/OpenVidu/MediaElement.ts"],"names":[],"mappings":";;AAuBA;IAAA;IAaA,CAAC;IAXG,yBAAE,GAAF,UAAG,IAAY,EAAE,OAA+B;QAC5C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,2BAAI,GAAJ,UAAK,IAAY,EAAE,OAA+B;QAC9C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,0BAAG,GAAH,UAAI,IAAY,EAAE,OAA8C;QAC5D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACL,mBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,oCAAY"}
|
||||
81
openvidu-browser/lib/OpenVidu/MediaManager.d.ts
vendored
81
openvidu-browser/lib/OpenVidu/MediaManager.d.ts
vendored
@ -1,81 +0,0 @@
|
||||
import { Stream } from './Stream';
|
||||
import { EventDispatcher } from '../OpenViduInternal/Interfaces/Public/EventDispatcher';
|
||||
import { Event } from '../OpenViduInternal/Events/Event';
|
||||
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
|
||||
import EventEmitter = require('wolfy87-eventemitter');
|
||||
/**
|
||||
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
|
||||
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
|
||||
*
|
||||
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
|
||||
*/
|
||||
export declare class MediaManager implements EventDispatcher {
|
||||
/**
|
||||
* The Stream represented in the DOM by the MediaManager
|
||||
*/
|
||||
stream: Stream;
|
||||
/**
|
||||
* Whether the MediaManager is representing in the DOM a local Stream ([[Publisher]]) or a remote Stream ([[Subscriber]])
|
||||
*/
|
||||
remote: boolean;
|
||||
/**
|
||||
* The DOM HTMLElement assigned as target element when initializing the MediaManager. This property is defined when [[OpenVidu.initPublisher]]
|
||||
* or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter. It is undefined when [[OpenVidu.initPublisher]]
|
||||
* or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter or when the MediaManager hass been
|
||||
* created by calling [[Stream.addVideoElement]]
|
||||
*/
|
||||
targetElement?: HTMLElement;
|
||||
/**
|
||||
* The DOM HTMLVideoElement displaying the MediaManager's stream
|
||||
*/
|
||||
video: HTMLVideoElement;
|
||||
/**
|
||||
* `id` attribute of the DOM HTMLVideoElement displaying the MediaManager's stream
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
isVideoElementCreated: boolean;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
protected ee: EventEmitter;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
protected customEe: EventEmitter;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
constructor(stream: Stream, targetElement?: HTMLElement | string);
|
||||
/**
|
||||
* See [[EventDispatcher.on]]
|
||||
*/
|
||||
on(type: string, handler: (event: Event) => void): EventDispatcher;
|
||||
/**
|
||||
* See [[EventDispatcher.once]]
|
||||
*/
|
||||
once(type: string, handler: (event: Event) => void): MediaManager;
|
||||
/**
|
||||
* See [[EventDispatcher.off]]
|
||||
*/
|
||||
off(type: string, handler?: (event: Event) => void): MediaManager;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
insertVideo(targetElement?: HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
insertVideoWithMode(insertMode: VideoInsertMode): void;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
removeVideo(): void;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
addOnCanPlayEvent(): void;
|
||||
private mirrorVideo();
|
||||
}
|
||||
@ -1,242 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var VideoElementEvent_1 = require("../OpenViduInternal/Events/VideoElementEvent");
|
||||
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
|
||||
var EventEmitter = require("wolfy87-eventemitter");
|
||||
var StreamManager = (function () {
|
||||
function StreamManager(stream, targetElement) {
|
||||
var _this = this;
|
||||
this.videos = [];
|
||||
this.isVideoElementCreated = false;
|
||||
this.ee = new EventEmitter();
|
||||
this.customEe = new EventEmitter();
|
||||
this.stream = stream;
|
||||
this.stream.streamManager = this;
|
||||
if (typeof targetElement === 'string') {
|
||||
var e = document.getElementById(targetElement);
|
||||
if (!!e) {
|
||||
this.targetElement = e;
|
||||
}
|
||||
}
|
||||
else if (targetElement instanceof HTMLElement) {
|
||||
this.targetElement = targetElement;
|
||||
}
|
||||
else if (!!this.targetElement) {
|
||||
console.warn("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
|
||||
}
|
||||
this.customEe.on('video-removed', function (element) {
|
||||
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]);
|
||||
});
|
||||
}
|
||||
StreamManager.prototype.on = function (type, handler) {
|
||||
var _this = this;
|
||||
this.ee.on(type, function (event) {
|
||||
if (event) {
|
||||
console.info("Event '" + type + "' triggered", event);
|
||||
}
|
||||
else {
|
||||
console.info("Event '" + type + "' triggered");
|
||||
}
|
||||
handler(event);
|
||||
});
|
||||
if (type === 'videoElementCreated') {
|
||||
if (!!this.stream && this.isVideoElementCreatedAsync) {
|
||||
this.isVideoElementCreated = false;
|
||||
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoElementCreated')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.on('video-element-created', function (element) {
|
||||
_this.id = element.id;
|
||||
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type === 'videoPlaying') {
|
||||
if (!this.stream.displayMyRemote() && !!this.video &&
|
||||
this.video.currentTime > 0 &&
|
||||
this.video.paused === false &&
|
||||
this.video.ended === false &&
|
||||
this.video.readyState === 4) {
|
||||
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoPlaying')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.on('video-is-playing', function (element) {
|
||||
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
StreamManager.prototype.once = function (type, handler) {
|
||||
var _this = this;
|
||||
this.ee.once(type, function (event) {
|
||||
if (event) {
|
||||
console.info("Event '" + type + "' triggered once", event);
|
||||
}
|
||||
else {
|
||||
console.info("Event '" + type + "' triggered once");
|
||||
}
|
||||
handler(event);
|
||||
});
|
||||
if (type === 'videoElementCreated') {
|
||||
if (!!this.stream && this.isVideoElementCreated) {
|
||||
this.isVideoElementCreated = false;
|
||||
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0], this, 'videoElementCreated')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.once('video-element-created', function (element) {
|
||||
_this.id = element.id;
|
||||
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type === 'videoPlaying') {
|
||||
if (!this.stream.displayMyRemote() && this.video &&
|
||||
this.video.currentTime > 0 &&
|
||||
this.video.paused === false &&
|
||||
this.video.ended === false &&
|
||||
this.video.readyState === 4) {
|
||||
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.once('video-is-playing', function (element) {
|
||||
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
StreamManager.prototype.off = function (type, handler) {
|
||||
if (!handler) {
|
||||
this.ee.removeAllListeners(type);
|
||||
}
|
||||
else {
|
||||
this.ee.off(type, handler);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
StreamManager.prototype.addVideoElement = function (video) {
|
||||
this.initializeVideoProperties(video);
|
||||
video.srcObject = this.stream.getMediaStream();
|
||||
video.autoplay = true;
|
||||
video.muted = this.stream.isLocal() ? true : false;
|
||||
this.remote = !this.stream.isLocal();
|
||||
streamManager.id = video.id;
|
||||
};
|
||||
StreamManager.prototype.createVideoElement = function (targetElement, insertMode) {
|
||||
var tar;
|
||||
if (typeof targetElement === 'string') {
|
||||
var e = document.getElementById(targetElement);
|
||||
if (!!e) {
|
||||
tar = e;
|
||||
}
|
||||
else {
|
||||
console.error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (targetElement instanceof HTMLElement) {
|
||||
tar = targetElement;
|
||||
}
|
||||
else if (!!this.targetElement) {
|
||||
console.error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
|
||||
return;
|
||||
}
|
||||
this.insertVideo(tar, insertMode);
|
||||
};
|
||||
StreamManager.prototype.insertVideo = function (targetElement, insertMode) {
|
||||
if (!!targetElement) {
|
||||
var video = document.createElement('video');
|
||||
this.initializeVideoProperties(video);
|
||||
this.targetElement = targetElement;
|
||||
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
|
||||
this.insertVideoElementWithMode(video, insMode);
|
||||
this.videos.push(video);
|
||||
this.stream.session.videos[this.stream.connection.connectionId].push(video);
|
||||
this.customEe.emitEvent('video-element-created', [{
|
||||
element: video
|
||||
}]);
|
||||
this.isVideoElementCreated = true;
|
||||
}
|
||||
if (this.stream.isLocal()) {
|
||||
this.stream.isLocalStreamReadyToPublish = true;
|
||||
this.stream.ee.emitEvent('stream-ready-to-publish', []);
|
||||
}
|
||||
};
|
||||
StreamManager.prototype.initializeVideoProperties = function (video) {
|
||||
video.srcObject = this.stream.getMediaStream();
|
||||
video.autoplay = true;
|
||||
video.controls = false;
|
||||
if (!video.id) {
|
||||
video.id = (this.stream.isLocal() ? 'local-' : 'remote-') + 'video-' + this.stream.streamId;
|
||||
}
|
||||
if (this.stream.isLocal() && !this.stream.displayMyRemote()) {
|
||||
video.muted = true;
|
||||
if (this.stream.outboundStreamOpts.publisherProperties.mirror) {
|
||||
this.mirrorVideo(video);
|
||||
}
|
||||
this.addOnCanPlayLocalVideoEvent(video);
|
||||
}
|
||||
};
|
||||
StreamManager.prototype.insertVideoElementWithMode = function (video, insertMode) {
|
||||
if (!!this.targetElement) {
|
||||
switch (insertMode) {
|
||||
case VideoInsertMode_1.VideoInsertMode.AFTER:
|
||||
this.targetElement.parentNode.insertBefore(video, this.targetElement.nextSibling);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.APPEND:
|
||||
this.targetElement.appendChild(video);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.BEFORE:
|
||||
this.targetElement.parentNode.insertBefore(video, this.targetElement);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.PREPEND:
|
||||
this.targetElement.insertBefore(video, this.targetElement.childNodes[0]);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.REPLACE:
|
||||
this.targetElement.parentNode.replaceChild(video, this.targetElement);
|
||||
break;
|
||||
default:
|
||||
this.insertVideoElementWithMode(video, VideoInsertMode_1.VideoInsertMode.APPEND);
|
||||
}
|
||||
}
|
||||
};
|
||||
StreamManager.prototype.removeVideos = function () {
|
||||
var _this = this;
|
||||
this.videos.forEach(function (video) {
|
||||
video.parentNode.removeChild(video);
|
||||
_this.customEe.emitEvent('video-removed', [video]);
|
||||
});
|
||||
this.videos = [];
|
||||
delete this.stream.session.videos[this.stream.connection.connectionId];
|
||||
};
|
||||
StreamManager.prototype.addOnCanPlayLocalVideoEvent = function (video) {
|
||||
var _this = this;
|
||||
video.oncanplay = function () {
|
||||
if (_this.stream.isLocal() && _this.stream.displayMyRemote()) {
|
||||
console.info("Your own remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
|
||||
_this.customEe.emitEvent('remote-video-is-playing', [{
|
||||
element: video
|
||||
}]);
|
||||
}
|
||||
else if (!_this.stream.isLocal() && !_this.stream.displayMyRemote()) {
|
||||
console.info("Remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
|
||||
_this.customEe.emitEvent('video-is-playing', [{
|
||||
element: video
|
||||
}]);
|
||||
}
|
||||
};
|
||||
};
|
||||
StreamManager.prototype.updateMediaStream = function (mediaStream) {
|
||||
this.videos.forEach(function (video) {
|
||||
video.srcObject = mediaStream;
|
||||
});
|
||||
};
|
||||
StreamManager.prototype.mirrorVideo = function (video) {
|
||||
video.style.transform = 'rotateY(180deg)';
|
||||
video.style.webkitTransform = 'rotateY(180deg)';
|
||||
};
|
||||
return StreamManager;
|
||||
}());
|
||||
exports.StreamManager = StreamManager;
|
||||
//# sourceMappingURL=MediaManager.js.map
|
||||
File diff suppressed because one or more lines are too long
8
openvidu-browser/lib/OpenVidu/OpenVidu.d.ts
vendored
8
openvidu-browser/lib/OpenVidu/OpenVidu.d.ts
vendored
@ -152,8 +152,8 @@ export declare class OpenVidu {
|
||||
* @hidden
|
||||
*/
|
||||
getRecorder(): boolean;
|
||||
private disconnectCallback();
|
||||
private reconnectingCallback();
|
||||
private reconnectedCallback();
|
||||
private isRoomAvailable();
|
||||
private disconnectCallback;
|
||||
private reconnectingCallback;
|
||||
private reconnectedCallback;
|
||||
private isRoomAvailable;
|
||||
}
|
||||
|
||||
@ -21,9 +21,9 @@ var Publisher_1 = require("./Publisher");
|
||||
var Session_1 = require("./Session");
|
||||
var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError");
|
||||
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
|
||||
var RpcBuilder = require("../OpenViduInternal/KurentoUtils/kurento-jsonrpc");
|
||||
var screenSharingAuto = require("../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto");
|
||||
var screenSharing = require("../OpenViduInternal/ScreenSharing/Screen-Capturing");
|
||||
var RpcBuilder = require("../OpenViduInternal/KurentoUtils/kurento-jsonrpc");
|
||||
var platform = require("platform");
|
||||
/**
|
||||
* Entrypoint of OpenVidu Browser library.
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
openvidu-browser/lib/OpenVidu/Publisher.d.ts
vendored
4
openvidu-browser/lib/OpenVidu/Publisher.d.ts
vendored
@ -66,6 +66,6 @@ export declare class Publisher extends StreamManager {
|
||||
* @hidden
|
||||
*/
|
||||
reestablishStreamPlayingEvent(): void;
|
||||
private setPermissionDialogTimer(waitTime);
|
||||
private clearPermissionDialogTimer(startTime, waitTime);
|
||||
private setPermissionDialogTimer;
|
||||
private clearPermissionDialogTimer;
|
||||
}
|
||||
|
||||
10
openvidu-browser/lib/OpenVidu/Session.d.ts
vendored
10
openvidu-browser/lib/OpenVidu/Session.d.ts
vendored
@ -223,9 +223,9 @@ export declare class Session implements EventDispatcher {
|
||||
* @hidden
|
||||
*/
|
||||
leave(forced: boolean, reason: string): void;
|
||||
private connectAux(token);
|
||||
private stringClientMetadata(metadata);
|
||||
private getConnection(connectionId, errorMessage);
|
||||
private getRemoteConnection(connectionId, errorMessage);
|
||||
private processToken(token);
|
||||
private connectAux;
|
||||
private stringClientMetadata;
|
||||
private getConnection;
|
||||
private getRemoteConnection;
|
||||
private processToken;
|
||||
}
|
||||
|
||||
10
openvidu-browser/lib/OpenVidu/Stream.d.ts
vendored
10
openvidu-browser/lib/OpenVidu/Stream.d.ts
vendored
@ -151,11 +151,11 @@ export declare class Stream {
|
||||
* @hidden
|
||||
*/
|
||||
disableSpeakingEvents(): void;
|
||||
private initWebRtcPeerSend();
|
||||
private initWebRtcPeerReceive();
|
||||
private processSdpAnswer(sdpAnswer);
|
||||
private initWebRtcStats();
|
||||
private stopWebRtcStats();
|
||||
private initWebRtcPeerSend;
|
||||
private initWebRtcPeerReceive;
|
||||
private processSdpAnswer;
|
||||
private initWebRtcStats;
|
||||
private stopWebRtcStats;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
|
||||
@ -119,6 +119,6 @@ export declare class StreamManager implements EventDispatcher {
|
||||
* @hidden
|
||||
*/
|
||||
updateMediaStream(mediaStream: MediaStream): void;
|
||||
private pushNewStreamManagerVideo(streamManagerVideo);
|
||||
private mirrorVideo(video);
|
||||
private pushNewStreamManagerVideo;
|
||||
private mirrorVideo;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2,5 +2,5 @@ export declare enum LocalRecorderState {
|
||||
READY = "READY",
|
||||
RECORDING = "RECORDING",
|
||||
PAUSED = "PAUSED",
|
||||
FINISHED = "FINISHED",
|
||||
FINISHED = "FINISHED"
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ export declare enum OpenViduErrorName {
|
||||
/**
|
||||
* _Not in use yet_
|
||||
*/
|
||||
GENERIC_ERROR = "GENERIC_ERROR",
|
||||
GENERIC_ERROR = "GENERIC_ERROR"
|
||||
}
|
||||
/**
|
||||
* Simple object to identify runtime errors on the client side
|
||||
|
||||
@ -21,5 +21,5 @@ export declare enum VideoInsertMode {
|
||||
/**
|
||||
* Video replaces target element
|
||||
*/
|
||||
REPLACE = "REPLACE",
|
||||
REPLACE = "REPLACE"
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
import { Event } from './Event';
|
||||
import { Stream } from '../../OpenVidu/Stream';
|
||||
/**
|
||||
* Defines the following events:
|
||||
* - `mediaStreamSet`: dispatched by [[Stream]]
|
||||
*
|
||||
* This is useful if you decide to manage the DOM video elements on your own instead of letting OpenVidu take care of them (passing _null_ or _undefined_ as `targetElement` on [[OpenVidu.initPublisher]] or [[Session.subscribe]])
|
||||
*/
|
||||
export declare class MediaStreamSetEvent extends Event {
|
||||
/**
|
||||
* The [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) object recently initialized in the [[Stream]] object. You can directly set `HTMLMediaElement.srcObject = MediaStreamEvent.mediaStream;`
|
||||
*/
|
||||
mediaStream: MediaStream;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
constructor(mediaStream: MediaStream, target: Stream);
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
callDefaultBehaviour(): void;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
/*
|
||||
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Event_1 = require("./Event");
|
||||
/**
|
||||
* Defines the following events:
|
||||
* - `mediaStreamSet`: dispatched by [[Stream]]
|
||||
*
|
||||
* This is useful if you decide to manage the DOM video elements on your own instead of letting OpenVidu take care of them (passing _null_ or _undefined_ as `targetElement` on [[OpenVidu.initPublisher]] or [[Session.subscribe]])
|
||||
*/
|
||||
var MediaStreamSetEvent = /** @class */ (function (_super) {
|
||||
__extends(MediaStreamSetEvent, _super);
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
function MediaStreamSetEvent(mediaStream, target) {
|
||||
var _this = _super.call(this, false, target, 'mediaStreamSet') || this;
|
||||
_this.mediaStream = mediaStream;
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
// tslint:disable-next-line:no-empty
|
||||
MediaStreamSetEvent.prototype.callDefaultBehaviour = function () { };
|
||||
return MediaStreamSetEvent;
|
||||
}(Event_1.Event));
|
||||
exports.MediaStreamSetEvent = MediaStreamSetEvent;
|
||||
//# sourceMappingURL=MediaStreamSetEvent.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"MediaStreamSetEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/MediaStreamSetEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAIhC;;;;;GAKG;AACH;IAAyC,uCAAK;IAO1C;;OAEG;IACH,6BAAY,WAAwB,EAAE,MAAc;QAApD,YACI,kBAAM,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,SAEzC;QADG,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;;IACnC,CAAC;IAED;;OAEG;IACH,oCAAoC;IACpC,kDAAoB,GAApB,cAAyB,CAAC;IAE9B,0BAAC;AAAD,CAAC,AArBD,CAAyC,aAAK,GAqB7C;AArBY,kDAAmB"}
|
||||
@ -1,17 +0,0 @@
|
||||
import { Event } from './Event';
|
||||
import { Session } from '../..';
|
||||
export declare class SessionDisconnectEvent extends Event {
|
||||
/**
|
||||
* - "disconnect"
|
||||
* - "networkDisconnect"
|
||||
*/
|
||||
reason: string;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
constructor(target: Session, reason: string);
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
callDefaultBehaviour(): void;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
"use strict";
|
||||
/*
|
||||
* (C) Copyright 2017-2018 OpenVidu (http://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Event_1 = require("./Event");
|
||||
var SessionDisconnectEvent = /** @class */ (function (_super) {
|
||||
__extends(SessionDisconnectEvent, _super);
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
function SessionDisconnectEvent(target, reason) {
|
||||
var _this = _super.call(this, true, target, 'sessionDisconnected') || this;
|
||||
_this.reason = reason;
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
SessionDisconnectEvent.prototype.callDefaultBehaviour = function () {
|
||||
console.info("Calling default behaviour upon '" + this.type + "' event dispatched by 'Session'");
|
||||
var session = this.target;
|
||||
// Dispose and delete all remote Connections
|
||||
for (var connectionId in session.remoteConnections) {
|
||||
if (!!session.remoteConnections[connectionId].stream) {
|
||||
session.remoteConnections[connectionId].stream.disposeWebRtcPeer();
|
||||
session.remoteConnections[connectionId].stream.disposeMediaStream();
|
||||
session.remoteConnections[connectionId].stream.removeVideo();
|
||||
delete session.remoteStreamsCreated[session.remoteConnections[connectionId].stream.streamId];
|
||||
session.remoteConnections[connectionId].dispose();
|
||||
}
|
||||
delete session.remoteConnections[connectionId];
|
||||
}
|
||||
};
|
||||
return SessionDisconnectEvent;
|
||||
}(Event_1.Event));
|
||||
exports.SessionDisconnectEvent = SessionDisconnectEvent;
|
||||
//# sourceMappingURL=SessionDisconnectEvent.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"SessionDisconnectEvent.js","sourceRoot":"","sources":["../../../src/OpenViduInternal/Events/SessionDisconnectEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,iCAAgC;AAGhC;IAA4C,0CAAK;IAQ7C;;OAEG;IACH,gCAAY,MAAe,EAAE,MAAc;QAA3C,YACI,kBAAM,IAAI,EAAE,MAAM,EAAE,qBAAqB,CAAC,SAE7C;QADG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED;;OAEG;IACH,qDAAoB,GAApB;QAEI,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC,CAAC;QAEjG,IAAM,OAAO,GAAY,IAAI,CAAC,MAAM,CAAC;QAErC,4CAA4C;QAC5C,GAAG,CAAC,CAAC,IAAM,YAAY,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;YACnD,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACnD,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACnE,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACpE,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC7D,OAAO,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC7F,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACtD,CAAC;YACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAEL,6BAAC;AAAD,CAAC,AAtCD,CAA4C,aAAK,GAsChD;AAtCY,wDAAsB"}
|
||||
@ -1,23 +0,0 @@
|
||||
import { EventDispatcher } from './EventDispatcher';
|
||||
import { Stream } from '../../../OpenVidu/Stream';
|
||||
/**
|
||||
* Interface representing a media element of the DOM. Can be local ([[Publisher]]) or remote ([[Subscriber]])
|
||||
*/
|
||||
export interface MediaElement extends EventDispatcher {
|
||||
/**
|
||||
* DOM id of the MediaElement's video
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Wheter the MediaElement refers to a local stream ([[Publisher]]) or a remote stream ([[Subscriber]])
|
||||
*/
|
||||
remote: boolean;
|
||||
/**
|
||||
* The [[Stream]] of the MediaElement
|
||||
*/
|
||||
stream: Stream;
|
||||
/**
|
||||
* HTML DOM element in which the MediaElement's video has been inserted
|
||||
*/
|
||||
element: HTMLElement;
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
/*
|
||||
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
exports.__esModule = true;
|
||||
//# sourceMappingURL=MediaElement.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"MediaElement.js","sourceRoot":"","sources":["../../../../src/OpenViduInternal/Interfaces/Public/MediaElement.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|
||||
@ -1,75 +0,0 @@
|
||||
import { Stream } from '../../../OpenVidu/Stream';
|
||||
import { EventDispatcher } from './EventDispatcher';
|
||||
import { Event } from '../../Events/Event';
|
||||
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
|
||||
import EventEmitter = require('wolfy87-eventemitter');
|
||||
/**
|
||||
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
|
||||
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
|
||||
*
|
||||
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
|
||||
*/
|
||||
export declare class MediaManager implements EventDispatcher {
|
||||
/**
|
||||
* The Stream represented in the DOM by the MediaManager
|
||||
*/
|
||||
stream: Stream;
|
||||
/**
|
||||
* Whether the MediaManager is representing in the DOM a local Stream ([[Publisher]]) or a remote Stream ([[Subscriber]])
|
||||
*/
|
||||
remote: boolean;
|
||||
/**
|
||||
* The DOM HTMLElement assigned as targetElement when initializing the MediaManager. This property is defined when [[OpenVidu.initPublisher]]
|
||||
* or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter. It is undefined when [[OpenVidu.initPublisher]]
|
||||
* or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter or when the MediaManager hass been
|
||||
* created by calling [[Stream.addVideoElement]]
|
||||
*/
|
||||
targetElement?: HTMLElement;
|
||||
/**
|
||||
* The DOM HTMLVideoElement displaying the MediaManager's stream
|
||||
*/
|
||||
video: HTMLVideoElement;
|
||||
/**
|
||||
* `id` attribute of the DOM HTMLVideoElement displaying the MediaManager's stream
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
isVideoElementCreated: boolean;
|
||||
protected ee: EventEmitter;
|
||||
protected customEe: EventEmitter;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
constructor(stream: Stream, targetElement?: HTMLElement | string);
|
||||
/**
|
||||
* See [[EventDispatcher.on]]
|
||||
*/
|
||||
on(type: string, handler: (event: Event) => void): EventDispatcher;
|
||||
/**
|
||||
* See [[EventDispatcher.once]]
|
||||
*/
|
||||
once(type: string, handler: (event: Event) => void): MediaManager;
|
||||
/**
|
||||
* See [[EventDispatcher.off]]
|
||||
*/
|
||||
off(type: string, handler?: (event: Event) => void): MediaManager;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
insertVideo(targetElement?: HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
insertVideoWithMode(insertMode: VideoInsertMode): void;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
removeVideo(): void;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
addOnCanPlayEvent(): void;
|
||||
private mirrorVideo();
|
||||
}
|
||||
@ -1,261 +0,0 @@
|
||||
"use strict";
|
||||
/*
|
||||
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
exports.__esModule = true;
|
||||
var VideoInsertMode_1 = require("../../Enums/VideoInsertMode");
|
||||
var VideoElementEvent_1 = require("../../Events/VideoElementEvent");
|
||||
var EventEmitter = require("wolfy87-eventemitter");
|
||||
/**
|
||||
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any Publisher and Subscriber object, as well as
|
||||
* any extra representation in the DOM you assign to some Stream by calling [[Stream.addVideoElement]].
|
||||
*
|
||||
* The use of this interface is useful when you don't need to differentiate between streams and just want to directly manage videos
|
||||
*/
|
||||
var MediaManager = /** @class */ (function () {
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
function MediaManager(stream, targetElement) {
|
||||
var _this = this;
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
this.isVideoElementCreated = false;
|
||||
this.ee = new EventEmitter();
|
||||
this.customEe = new EventEmitter();
|
||||
this.stream = stream;
|
||||
this.stream.mediaManagers.push(this);
|
||||
if (typeof targetElement === 'string') {
|
||||
var e = document.getElementById(targetElement);
|
||||
if (!!e) {
|
||||
this.targetElement = e;
|
||||
}
|
||||
}
|
||||
else if (targetElement instanceof HTMLElement) {
|
||||
this.targetElement = targetElement;
|
||||
}
|
||||
if (!this.targetElement) {
|
||||
console.warn("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
|
||||
}
|
||||
this.customEe.on('video-removed', function (element) {
|
||||
_this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(element, _this, 'videoElementDestroyed')]);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* See [[EventDispatcher.on]]
|
||||
*/
|
||||
MediaManager.prototype.on = function (type, handler) {
|
||||
var _this = this;
|
||||
this.ee.on(type, function (event) {
|
||||
if (event) {
|
||||
console.info("Event '" + type + "' triggered", event);
|
||||
}
|
||||
else {
|
||||
console.info("Event '" + type + "' triggered");
|
||||
}
|
||||
handler(event);
|
||||
});
|
||||
if (type === 'videoElementCreated') {
|
||||
if (!!this.stream && this.isVideoElementCreated) {
|
||||
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoElementCreated')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.on('video-element-created', function (element) {
|
||||
_this.id = element.id;
|
||||
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type === 'videoPlaying') {
|
||||
if (!this.stream.displayMyRemote() && !!this.video &&
|
||||
this.video.currentTime > 0 &&
|
||||
this.video.paused === false &&
|
||||
this.video.ended === false &&
|
||||
this.video.readyState === 4) {
|
||||
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.once('video-is-playing', function (element) {
|
||||
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* See [[EventDispatcher.once]]
|
||||
*/
|
||||
MediaManager.prototype.once = function (type, handler) {
|
||||
var _this = this;
|
||||
this.ee.once(type, function (event) {
|
||||
if (event) {
|
||||
console.info("Event '" + type + "' triggered once", event);
|
||||
}
|
||||
else {
|
||||
console.info("Event '" + type + "' triggered once");
|
||||
}
|
||||
handler(event);
|
||||
});
|
||||
if (type === 'videoElementCreated') {
|
||||
if (!!this.stream && this.isVideoElementCreated) {
|
||||
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoElementCreated')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.once('video-element-created', function (element) {
|
||||
_this.id = element.id;
|
||||
_this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoElementCreated')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type === 'videoPlaying') {
|
||||
if (!this.stream.displayMyRemote() && this.video &&
|
||||
this.video.currentTime > 0 &&
|
||||
this.video.paused === false &&
|
||||
this.video.ended === false &&
|
||||
this.video.readyState === 4) {
|
||||
this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.video, this, 'videoPlaying')]);
|
||||
}
|
||||
else {
|
||||
this.customEe.once('video-is-playing', function (element) {
|
||||
_this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(element.element, _this, 'videoPlaying')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* See [[EventDispatcher.off]]
|
||||
*/
|
||||
MediaManager.prototype.off = function (type, handler) {
|
||||
if (!handler) {
|
||||
this.ee.removeAllListeners(type);
|
||||
}
|
||||
else {
|
||||
this.ee.off(type, handler);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
MediaManager.prototype.insertVideo = function (targetElement, insertMode) {
|
||||
var _this = this;
|
||||
if (!!targetElement) {
|
||||
this.video = document.createElement('video');
|
||||
this.video.id = (this.stream.isLocal() ? 'local-' : 'remote-') + 'video-' + this.stream.streamId;
|
||||
this.video.autoplay = true;
|
||||
this.video.controls = false;
|
||||
this.video.srcObject = this.stream.getMediaStream();
|
||||
if (this.stream.isLocal() && !this.stream.displayMyRemote()) {
|
||||
this.video.muted = true;
|
||||
if (this.stream.outboundStreamOpts.publisherProperties.mirror) {
|
||||
this.mirrorVideo();
|
||||
}
|
||||
this.video.oncanplay = function () {
|
||||
console.info("Local 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
|
||||
_this.customEe.emitEvent('video-is-playing', [{
|
||||
element: _this.video
|
||||
}]);
|
||||
};
|
||||
}
|
||||
else {
|
||||
this.video.title = this.stream.streamId;
|
||||
}
|
||||
this.targetElement = targetElement;
|
||||
var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;
|
||||
this.insertVideoWithMode(insMode);
|
||||
this.customEe.emitEvent('video-element-created', [{
|
||||
element: this.video
|
||||
}]);
|
||||
this.isVideoElementCreated = true;
|
||||
}
|
||||
this.stream.isReadyToPublish = true;
|
||||
this.customEe.emitEvent('stream-ready-to-publish');
|
||||
return this.video;
|
||||
};
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
MediaManager.prototype.insertVideoWithMode = function (insertMode) {
|
||||
if (!!this.targetElement) {
|
||||
switch (insertMode) {
|
||||
case VideoInsertMode_1.VideoInsertMode.AFTER:
|
||||
this.targetElement.parentNode.insertBefore(this.video, this.targetElement.nextSibling);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.APPEND:
|
||||
this.targetElement.appendChild(this.video);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.BEFORE:
|
||||
this.targetElement.parentNode.insertBefore(this.video, this.targetElement);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.PREPEND:
|
||||
this.targetElement.insertBefore(this.video, this.targetElement.childNodes[0]);
|
||||
break;
|
||||
case VideoInsertMode_1.VideoInsertMode.REPLACE:
|
||||
this.targetElement.parentNode.replaceChild(this.video, this.targetElement);
|
||||
break;
|
||||
default:
|
||||
this.insertVideoWithMode(VideoInsertMode_1.VideoInsertMode.APPEND);
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
MediaManager.prototype.removeVideo = function () {
|
||||
if (!!this.video) {
|
||||
var videoDOM = document.getElementById(this.id);
|
||||
if (!!videoDOM) {
|
||||
videoDOM.parentNode.removeChild(videoDOM);
|
||||
this.customEe.emitEvent('video-removed', [this.video]);
|
||||
}
|
||||
delete this.video;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
MediaManager.prototype.addOnCanPlayEvent = function () {
|
||||
var _this = this;
|
||||
if (!!this.video) {
|
||||
// let thumbnailId = this.video.thumb;
|
||||
this.video.oncanplay = function () {
|
||||
if (_this.stream.isLocal() && _this.stream.displayMyRemote()) {
|
||||
console.info("Your own remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
|
||||
_this.customEe.emitEvent('remote-video-is-playing', [{
|
||||
element: _this.video
|
||||
}]);
|
||||
}
|
||||
else if (!_this.stream.isLocal() && !_this.stream.displayMyRemote()) {
|
||||
console.info("Remote 'Stream' with id [" + _this.stream.streamId + '] video is now playing');
|
||||
_this.customEe.emitEvent('video-is-playing', [{
|
||||
element: _this.video
|
||||
}]);
|
||||
}
|
||||
// show(thumbnailId);
|
||||
// this.hideSpinner(this.streamId);
|
||||
};
|
||||
}
|
||||
};
|
||||
MediaManager.prototype.mirrorVideo = function () {
|
||||
this.video.style.transform = 'rotateY(180deg)';
|
||||
this.video.style.webkitTransform = 'rotateY(180deg)';
|
||||
};
|
||||
return MediaManager;
|
||||
}());
|
||||
exports.MediaManager = MediaManager;
|
||||
//# sourceMappingURL=MediaManager.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -1,3 +0,0 @@
|
||||
import { PublisherProperties } from './Interfaces/Public/PublisherProperties';
|
||||
export declare function solveIfCallback(methodName: string, completionHandler: ((error: Error | undefined) => void) | undefined, promise: Promise<any>): Promise<any>;
|
||||
export declare function adaptPublisherProperties(properties: any): PublisherProperties;
|
||||
@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
/*
|
||||
* (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
exports.__esModule = true;
|
||||
var VideoInsertMode_1 = require("./Enums/VideoInsertMode");
|
||||
function solveIfCallback(methodName, completionHandler, promise) {
|
||||
if (!!completionHandler) {
|
||||
console.warn("DEPRECATION WANING: In future releases the 'completionHandler' parameter will be removed from method '" + methodName + "'. Refactor your callbacks to Promise API (see https://openvidu.io/api/openvidu-browser/index.html)");
|
||||
}
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (!!completionHandler && typeof completionHandler === 'function') {
|
||||
promise.then(function () {
|
||||
completionHandler(undefined);
|
||||
})["catch"](function (error) {
|
||||
completionHandler(error);
|
||||
});
|
||||
}
|
||||
else {
|
||||
promise.then(function () {
|
||||
return resolve();
|
||||
})["catch"](function (error) {
|
||||
return reject(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.solveIfCallback = solveIfCallback;
|
||||
function adaptPublisherProperties(properties) {
|
||||
if ('audio' in properties ||
|
||||
'video' in properties ||
|
||||
'audioActive' in properties ||
|
||||
'videoActive' in properties ||
|
||||
'quality' in properties ||
|
||||
'screen' in properties) {
|
||||
console.warn("DEPRECATION WANING: In future releases the properties passed to 'OpenVidu.initPublisher' method must match PublisherProperties interface (see https://openvidu.io/api/openvidu-browser/interfaces/publisherproperties.html)");
|
||||
}
|
||||
var scr = (typeof properties.screen !== 'undefined' && properties.screen === true);
|
||||
var res = '';
|
||||
if (typeof properties.quality === 'string') {
|
||||
switch (properties.quality) {
|
||||
case 'LOW':
|
||||
res = '320x240';
|
||||
break;
|
||||
case 'MEDIUM':
|
||||
res = '640x480';
|
||||
break;
|
||||
case 'HIGH':
|
||||
res = '1280x720';
|
||||
break;
|
||||
}
|
||||
}
|
||||
var publisherProperties = {
|
||||
audioSource: (typeof properties.audio !== 'undefined' && properties.audio === false) ? false : ((typeof properties.audioSource !== 'undefined') ? properties.audioSource : undefined),
|
||||
frameRate: (typeof properties.frameRate !== 'undefined') ? properties.frameRate : undefined,
|
||||
insertMode: (typeof properties.insertMode !== 'undefined') ? properties.insertMode : VideoInsertMode_1.VideoInsertMode.APPEND,
|
||||
mirror: (typeof properties.mirror !== 'undefined') ? properties.mirror : true,
|
||||
publishAudio: (typeof properties.audioActive !== 'undefined' && properties.audioActive === false) ? false : (typeof properties.publishAudio !== 'undefined') ? properties.publishAudio : true,
|
||||
publishVideo: (typeof properties.videoActive !== 'undefined' && properties.videoActive === false) ? false : (typeof properties.publishVideo !== 'undefined') ? properties.publishVideo : true,
|
||||
resolution: !!res ? res : ((typeof properties.resolution !== 'undefined') ? properties.resolution : '640x480'),
|
||||
videoSource: scr ? 'screen' : ((typeof properties.video !== 'undefined' && properties.video === false) ? false : ((typeof properties.videoSource !== 'undefined') ? properties.videoSource : undefined))
|
||||
};
|
||||
return publisherProperties;
|
||||
}
|
||||
exports.adaptPublisherProperties = adaptPublisherProperties;
|
||||
//# sourceMappingURL=VersionAdapter.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"VersionAdapter.js","sourceRoot":"","sources":["../../src/OpenViduInternal/VersionAdapter.ts"],"names":[],"mappings":"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"}
|
||||
@ -9,7 +9,7 @@ export declare class WebRtcStats {
|
||||
isEnabled(): boolean;
|
||||
initWebRtcStats(): void;
|
||||
stopWebRtcStats(): void;
|
||||
private sendStatsToHttpEndpoint(instrumentation);
|
||||
private standardizeReport(response);
|
||||
private getStatsAgnostic(pc, successCb, failureCb);
|
||||
private sendStatsToHttpEndpoint;
|
||||
private standardizeReport;
|
||||
private getStatsAgnostic;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
366
openvidu-browser/package-lock.json
generated
366
openvidu-browser/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,52 +1,52 @@
|
||||
{
|
||||
"author": "OpenVidu",
|
||||
"author": "OpenVidu",
|
||||
"dependencies": {
|
||||
"@types/node": "^9.6.7",
|
||||
"@types/platform": "^1.3.1",
|
||||
"freeice": "2.2.0",
|
||||
"hark": "1.2.0",
|
||||
"inherits": "2.0.3",
|
||||
"merge": "1.2.0",
|
||||
"platform": "^1.3.5",
|
||||
"sdp-translator": "0.1.24",
|
||||
"ua-parser-js": "0.7.18",
|
||||
"uuid": "3.2.1",
|
||||
"webrtc-adapter": "6.1.5",
|
||||
"@types/node": "10.3.0",
|
||||
"@types/platform": "1.3.1",
|
||||
"freeice": "2.2.0",
|
||||
"hark": "1.2.0",
|
||||
"inherits": "2.0.3",
|
||||
"merge": "1.2.0",
|
||||
"platform": "^1.3.5",
|
||||
"sdp-translator": "0.1.24",
|
||||
"ua-parser-js": "0.7.18",
|
||||
"uuid": "3.2.1",
|
||||
"webrtc-adapter": "6.2.1",
|
||||
"wolfy87-eventemitter": "5.2.4"
|
||||
},
|
||||
"description": "OpenVidu Browser",
|
||||
},
|
||||
"description": "OpenVidu Browser",
|
||||
"devDependencies": {
|
||||
"browserify": "16.1.1",
|
||||
"grunt": "1.0.2",
|
||||
"grunt-autoprefixer": "3.0.4",
|
||||
"grunt-cli": "1.2.0",
|
||||
"grunt-contrib-copy": "1.0.0",
|
||||
"grunt-contrib-sass": "1.0.0",
|
||||
"grunt-contrib-uglify": "3.3.0",
|
||||
"grunt-contrib-watch": "1.1.0",
|
||||
"grunt-string-replace": "1.3.1",
|
||||
"grunt-ts": "6.0.0-beta.19",
|
||||
"tsify": "4.0.0",
|
||||
"tslint": "5.10.0",
|
||||
"typedoc": "0.11.1",
|
||||
"typedoc-plugin-sourcefile-url": "1.0.3",
|
||||
"typescript": "2.8.3",
|
||||
"uglify-js": "3.3.25"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"main": "lib/index.js",
|
||||
"name": "openvidu-browser",
|
||||
"browserify": "16.2.2",
|
||||
"grunt": "1.0.3",
|
||||
"grunt-autoprefixer": "3.0.4",
|
||||
"grunt-cli": "1.2.0",
|
||||
"grunt-contrib-copy": "1.0.0",
|
||||
"grunt-contrib-sass": "1.0.0",
|
||||
"grunt-contrib-uglify": "3.3.0",
|
||||
"grunt-contrib-watch": "1.1.0",
|
||||
"grunt-string-replace": "1.3.1",
|
||||
"grunt-ts": "6.0.0-beta.19",
|
||||
"tsify": "4.0.0",
|
||||
"tslint": "5.10.0",
|
||||
"typedoc": "0.11.1",
|
||||
"typedoc-plugin-sourcefile-url": "1.0.3",
|
||||
"typescript": "2.9.1",
|
||||
"uglify-js": "3.4.0"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"main": "lib/index.js",
|
||||
"name": "openvidu-browser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"type": "git",
|
||||
"url": "git://github.com/OpenVidu/openvidu"
|
||||
},
|
||||
},
|
||||
"scripts": {
|
||||
"browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
|
||||
"browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
|
||||
"build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
|
||||
"docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser",
|
||||
"browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
|
||||
"browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
|
||||
"build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
|
||||
"docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"version": "2.1.0"
|
||||
}
|
||||
@ -25,10 +25,10 @@ import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/Publi
|
||||
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
|
||||
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
|
||||
|
||||
import * as RpcBuilder from '../OpenViduInternal/KurentoUtils/kurento-jsonrpc';
|
||||
import * as screenSharingAuto from '../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto';
|
||||
import * as screenSharing from '../OpenViduInternal/ScreenSharing/Screen-Capturing';
|
||||
|
||||
import RpcBuilder = require('../OpenViduInternal/KurentoUtils/kurento-jsonrpc');
|
||||
import platform = require('platform');
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user