openvidu-browser: platform library imported in all required classes

pull/173/head
pabloFuente 2018-12-04 09:55:00 +01:00
parent d7b5b41ed8
commit 0e80c9b626
8 changed files with 14 additions and 10 deletions

View File

@ -17,6 +17,8 @@
import { Stream } from './Stream'; import { Stream } from './Stream';
import { LocalRecorderState } from '../OpenViduInternal/Enums/LocalRecorderState'; import { LocalRecorderState } from '../OpenViduInternal/Enums/LocalRecorderState';
import platform = require('platform');
/** /**
* @hidden * @hidden
@ -37,10 +39,8 @@ export class LocalRecorder {
private mediaRecorder: any; private mediaRecorder: any;
private chunks: any[] = []; private chunks: any[] = [];
private blob: Blob; private blob: Blob;
private count = 0;
private id: string; private id: string;
private videoPreviewSrc: string; private videoPreviewSrc: string;
private htmlParentElementId: string;
private videoPreview: HTMLVideoElement; private videoPreview: HTMLVideoElement;
/** /**
@ -207,14 +207,11 @@ export class LocalRecorder {
} }
if (typeof parentElement === 'string') { if (typeof parentElement === 'string') {
this.htmlParentElementId = parentElement;
const parentElementDom = document.getElementById(parentElement); const parentElementDom = document.getElementById(parentElement);
if (parentElementDom) { if (parentElementDom) {
this.videoPreview = parentElementDom.appendChild(this.videoPreview); this.videoPreview = parentElementDom.appendChild(this.videoPreview);
} }
} else { } else {
this.htmlParentElementId = parentElement.id;
this.videoPreview = parentElement.appendChild(this.videoPreview); this.videoPreview = parentElement.appendChild(this.videoPreview);
} }
@ -231,7 +228,6 @@ export class LocalRecorder {
const f = () => { const f = () => {
delete this.blob; delete this.blob;
this.chunks = []; this.chunks = [];
this.count = 0;
delete this.mediaRecorder; delete this.mediaRecorder;
this.state = LocalRecorderState.READY; this.state = LocalRecorderState.READY;
}; };

View File

@ -31,7 +31,6 @@ import * as screenSharing from '../OpenViduInternal/ScreenSharing/Screen-Capturi
import RpcBuilder = require('../OpenViduInternal/KurentoUtils/kurento-jsonrpc'); import RpcBuilder = require('../OpenViduInternal/KurentoUtils/kurento-jsonrpc');
import platform = require('platform'); import platform = require('platform');
platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1; platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1;
/** /**

View File

@ -28,6 +28,9 @@ import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent'
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError'; import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode'; import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import platform = require('platform');
platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1;
/** /**
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method * Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method
*/ */

View File

@ -41,7 +41,7 @@ import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/Open
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode'; import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter'); import EventEmitter = require('wolfy87-eventemitter');
import platform = require('platform');
/** /**
* Represents a video call. It can also be seen as a videoconference room where multiple users can connect. * Represents a video call. It can also be seen as a videoconference room where multiple users can connect.

View File

@ -27,10 +27,12 @@ import { WebRtcPeer, WebRtcPeerSendonly, WebRtcPeerRecvonly, WebRtcPeerSendrecv
import { WebRtcStats } from '../OpenViduInternal/WebRtcStats/WebRtcStats'; import { WebRtcStats } from '../OpenViduInternal/WebRtcStats/WebRtcStats';
import { PublisherSpeakingEvent } from '../OpenViduInternal/Events/PublisherSpeakingEvent'; import { PublisherSpeakingEvent } from '../OpenViduInternal/Events/PublisherSpeakingEvent';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent'; import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import EventEmitter = require('wolfy87-eventemitter'); import EventEmitter = require('wolfy87-eventemitter');
import hark = require('hark'); import hark = require('hark');
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError'; import platform = require('platform');
platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1;
/** /**

View File

@ -24,7 +24,8 @@ import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent'
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode'; import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import EventEmitter = require('wolfy87-eventemitter'); import EventEmitter = require('wolfy87-eventemitter');
import platform = require('platform');
platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1;
/** /**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object. * Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object.

View File

@ -17,6 +17,8 @@
import freeice = require('freeice'); import freeice = require('freeice');
import uuid = require('uuid'); import uuid = require('uuid');
import platform = require('platform');
platform['isIonicIos'] = (platform.product === 'iPhone' || platform.product === 'iPad') && platform.ua!!.indexOf('Safari') === -1;
export interface WebRtcPeerConfiguration { export interface WebRtcPeerConfiguration {
mediaConstraints: { mediaConstraints: {

View File

@ -18,6 +18,7 @@
// tslint:disable:no-string-literal // tslint:disable:no-string-literal
import { Stream } from '../../OpenVidu/Stream'; import { Stream } from '../../OpenVidu/Stream';
import platform = require('platform');
export class WebRtcStats { export class WebRtcStats {