mirror of https://github.com/OpenVidu/openvidu.git
'checkSystemRequirements()' method supported. adapter.js updated to 3.3.2
parent
153a19b626
commit
b726b9604f
|
@ -17,7 +17,7 @@
|
||||||
"kurento-jsonrpc": "5.1.3",
|
"kurento-jsonrpc": "5.1.3",
|
||||||
"wolfy87-eventemitter": "4.2.9",
|
"wolfy87-eventemitter": "4.2.9",
|
||||||
"@types/wolfy87-eventemitter": "4.2.31",
|
"@types/wolfy87-eventemitter": "4.2.31",
|
||||||
"webrtc-adapter": "3.2.0",
|
"webrtc-adapter": "3.3.2",
|
||||||
"kurento-utils": "6.6.1",
|
"kurento-utils": "6.6.1",
|
||||||
"uuid": "~2.0.1",
|
"uuid": "~2.0.1",
|
||||||
"sdp-translator": "^0.1.15"
|
"sdp-translator": "^0.1.15"
|
||||||
|
|
|
@ -19,6 +19,12 @@ import { OpenVidu } from '../OpenVidu/OpenVidu';
|
||||||
import { SessionTokBox } from './SessionTokBox';
|
import { SessionTokBox } from './SessionTokBox';
|
||||||
import { PublisherTokBox } from './PublisherTokBox';
|
import { PublisherTokBox } from './PublisherTokBox';
|
||||||
|
|
||||||
|
import * as adapter from 'webrtc-adapter';
|
||||||
|
|
||||||
|
if (window) {
|
||||||
|
window["adapter"] = adapter;
|
||||||
|
}
|
||||||
|
|
||||||
export class OpenViduTokBox {
|
export class OpenViduTokBox {
|
||||||
|
|
||||||
openVidu: OpenVidu;
|
openVidu: OpenVidu;
|
||||||
|
@ -31,17 +37,22 @@ export class OpenViduTokBox {
|
||||||
initSession(sessionId: string): SessionTokBox;
|
initSession(sessionId: string): SessionTokBox;
|
||||||
|
|
||||||
initSession(param1, param2?): any {
|
initSession(param1, param2?): any {
|
||||||
|
if (this.checkSystemRequirements()){
|
||||||
if (typeof param2 == "string") {
|
if (typeof param2 == "string") {
|
||||||
return new SessionTokBox(this.openVidu.initSession(param2), this);
|
return new SessionTokBox(this.openVidu.initSession(param2), this);
|
||||||
} else {
|
} else {
|
||||||
return new SessionTokBox(this.openVidu.initSession(param1), this);
|
return new SessionTokBox(this.openVidu.initSession(param1), this);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
alert("Browser not supported");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initPublisher(parentId: string, cameraOptions: any): PublisherTokBox;
|
initPublisher(parentId: string, cameraOptions: any): PublisherTokBox;
|
||||||
initPublisher(parentId: string, cameraOptions: any, callback: any): PublisherTokBox;
|
initPublisher(parentId: string, cameraOptions: any, callback: any): PublisherTokBox;
|
||||||
|
|
||||||
initPublisher(parentId: string, cameraOptions: any, callback?): PublisherTokBox {
|
initPublisher(parentId: string, cameraOptions: any, callback?): any {
|
||||||
|
if (this.checkSystemRequirements()){
|
||||||
if (!("audio" in cameraOptions && "data" in cameraOptions && "mediaConstraints" in cameraOptions &&
|
if (!("audio" in cameraOptions && "data" in cameraOptions && "mediaConstraints" in cameraOptions &&
|
||||||
"video" in cameraOptions && (Object.keys(cameraOptions).length === 4))) {
|
"video" in cameraOptions && (Object.keys(cameraOptions).length === 4))) {
|
||||||
cameraOptions = {
|
cameraOptions = {
|
||||||
|
@ -55,6 +66,18 @@ export class OpenViduTokBox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new PublisherTokBox(this.openVidu.initPublisherTagged(parentId, cameraOptions, callback));
|
return new PublisherTokBox(this.openVidu.initPublisherTagged(parentId, cameraOptions, callback));
|
||||||
|
} else {
|
||||||
|
alert("Browser not supported");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkSystemRequirements(): number {
|
||||||
|
let browser = adapter.browserDetails.browser;
|
||||||
|
let version = adapter.browserDetails.version;
|
||||||
|
if ((version == null) && ((browser != 'chrome') && (browser != 'firefox') && (browser != 'edge') && (browser != 'safari'))) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue