openvidu-browser
Advanced tools
Comparing version 1.0.3-beta.3 to 1.0.4-beta.3
@@ -15,3 +15,3 @@ import { SessionInternal } from '../OpenViduInternal/SessionInternal'; | ||
connect(token: string, callback: any): any; | ||
connect(token: string, metadata: string, callback: any): any; | ||
connect(token: string, metadata: any, callback: any): any; | ||
disconnect(): void; | ||
@@ -18,0 +18,0 @@ publish(publisher: Publisher): void; |
@@ -36,7 +36,7 @@ "use strict"; | ||
// Early configuration to deactivate automatic subscription to streams | ||
if (typeof param2 == "string") { | ||
if (param3) { | ||
this.session.configure({ | ||
sessionId: this.session.getSessionId(), | ||
participantId: param1, | ||
metadata: param2, | ||
metadata: this.session.stringClientMetadata(param2), | ||
subscribeToStreams: false | ||
@@ -43,0 +43,0 @@ }); |
@@ -60,2 +60,4 @@ import { Stream } from './Stream'; | ||
removeParticipantSpeaking(participantId: any): void; | ||
stringClientMetadata(metadata: any): string; | ||
private randomToken(); | ||
} |
@@ -58,2 +58,5 @@ "use strict"; | ||
else { | ||
if (!token) { | ||
token = _this.randomToken(); | ||
} | ||
var joinParams = { | ||
@@ -447,2 +450,13 @@ token: token, | ||
}; | ||
SessionInternal.prototype.stringClientMetadata = function (metadata) { | ||
if (!(typeof metadata === 'string')) { | ||
return JSON.stringify(metadata); | ||
} | ||
else { | ||
return metadata; | ||
} | ||
}; | ||
SessionInternal.prototype.randomToken = function () { | ||
return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2); | ||
}; | ||
return SessionInternal; | ||
@@ -449,0 +463,0 @@ }()); |
{ | ||
"name": "openvidu-browser", | ||
"version": "1.0.3-beta.3", | ||
"version": "1.0.4-beta.3", | ||
"description": "OpenVidu Browser", | ||
@@ -25,3 +25,9 @@ "main": "lib/OpenVidu/index.js", | ||
"sdp-translator": "^0.1.15" | ||
}, | ||
"devDependencies": { | ||
"typescript": "2.5.2", | ||
"browserify": "14.4.0", | ||
"tsify": "3.0.1", | ||
"uglify-js": "3.0.15" | ||
} | ||
} |
@@ -47,11 +47,11 @@ import { SessionInternal, SessionOptions } from '../OpenViduInternal/SessionInternal'; | ||
connect(token: string, callback: any); | ||
connect(token: string, metadata: string, callback: any); | ||
connect(token: string, metadata: any, callback: any); | ||
connect(param1, param2, param3?) { | ||
// Early configuration to deactivate automatic subscription to streams | ||
if (typeof param2 == "string") { | ||
if (param3) { | ||
this.session.configure({ | ||
sessionId: this.session.getSessionId(), | ||
participantId: param1, | ||
metadata: param2, | ||
metadata: this.session.stringClientMetadata(param2), | ||
subscribeToStreams: false | ||
@@ -58,0 +58,0 @@ }); |
@@ -85,2 +85,6 @@ import { Stream } from './Stream'; | ||
if (!token) { | ||
token = this.randomToken(); | ||
} | ||
let joinParams = { | ||
@@ -545,2 +549,15 @@ token: token, | ||
} | ||
stringClientMetadata(metadata): string { | ||
if (!(typeof metadata === 'string')) { | ||
return JSON.stringify(metadata); | ||
} else { | ||
return metadata; | ||
} | ||
} | ||
private randomToken(): string { | ||
return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4307422
40401
4