customSessionId static files

pull/73/head
pabloFuente 2018-05-03 11:48:57 +02:00
parent 0578753263
commit 52d4c64e76
32 changed files with 393 additions and 415 deletions

View File

@ -142,7 +142,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L203">OpenVidu/OpenVidu.ts:203</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L217">OpenVidu/OpenVidu.ts:217</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -165,7 +165,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L320">OpenVidu/OpenVidu.ts:320</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L334">OpenVidu/OpenVidu.ts:334</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -187,7 +187,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L221">OpenVidu/OpenVidu.ts:221</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L235">OpenVidu/OpenVidu.ts:235</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -209,7 +209,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L290">OpenVidu/OpenVidu.ts:290</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L304">OpenVidu/OpenVidu.ts:304</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -278,7 +278,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L194">OpenVidu/OpenVidu.ts:194</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L208">OpenVidu/OpenVidu.ts:208</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -312,7 +312,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L74">OpenVidu/OpenVidu.ts:74</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L88">OpenVidu/OpenVidu.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -343,7 +343,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L75">OpenVidu/OpenVidu.ts:75</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L89">OpenVidu/OpenVidu.ts:89</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -377,7 +377,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L76">OpenVidu/OpenVidu.ts:76</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L90">OpenVidu/OpenVidu.ts:90</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -435,7 +435,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L77">OpenVidu/OpenVidu.ts:77</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L91">OpenVidu/OpenVidu.ts:91</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -506,7 +506,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L165">OpenVidu/OpenVidu.ts:165</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L179">OpenVidu/OpenVidu.ts:179</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -528,7 +528,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L166">OpenVidu/OpenVidu.ts:166</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L180">OpenVidu/OpenVidu.ts:180</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -548,13 +548,14 @@ OV.getUserMedia({
<a name="initsession" class="tsd-anchor"></a>
<h3>init<wbr>Session</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">init<wbr>Session<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="session.html" class="tsd-signature-type">Session</a></li>
<li class="tsd-signature tsd-kind-icon">init<wbr>Session<span class="tsd-signature-symbol">(</span>sessionId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="session.html" class="tsd-signature-type">Session</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L68">OpenVidu/OpenVidu.ts:68</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L64">OpenVidu/OpenVidu.ts:64</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -562,12 +563,30 @@ OV.getUserMedia({
<p>Returns a session with id <code>sessionId</code></p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <a href="session.html" class="tsd-signature-type">Session</a></h4>
</li>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L73">OpenVidu/OpenVidu.ts:73</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<hr>
<h2 id="deprecated">DEPRECATED</h2>
</div>
<p><em>No <code>sessionId</code> is required. Now every necessary information is received in <a href="session.html#connect">Session.connect</a></em></p>
<hr>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>sessionId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Session unique ID generated in openvidu-server</p>
<div class="lead">
<p>Session unique ID generated in openvidu-server</p>
</div>
</div>
</li>
</ul>
@ -585,7 +604,7 @@ OV.getUserMedia({
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L335">OpenVidu/OpenVidu.ts:335</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/OpenVidu.ts#L349">OpenVidu/OpenVidu.ts:349</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">

View File

@ -167,7 +167,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L90">OpenVidu/Session.ts:90</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L88">OpenVidu/Session.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -203,7 +203,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L91">OpenVidu/Session.ts:91</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L89">OpenVidu/Session.ts:89</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -242,7 +242,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L101">OpenVidu/Session.ts:101</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L99">OpenVidu/Session.ts:99</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -280,7 +280,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L180">OpenVidu/Session.ts:180</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L181">OpenVidu/Session.ts:181</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -316,7 +316,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L524">OpenVidu/Session.ts:524</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L525">OpenVidu/Session.ts:525</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -365,7 +365,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L466">OpenVidu/Session.ts:466</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L467">OpenVidu/Session.ts:467</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -414,7 +414,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L495">OpenVidu/Session.ts:495</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L496">OpenVidu/Session.ts:496</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -463,7 +463,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L319">OpenVidu/Session.ts:319</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L320">OpenVidu/Session.ts:320</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -498,7 +498,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L402">OpenVidu/Session.ts:402</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L403">OpenVidu/Session.ts:403</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -523,7 +523,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L411">OpenVidu/Session.ts:411</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L412">OpenVidu/Session.ts:412</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -562,7 +562,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L184">OpenVidu/Session.ts:184</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L185">OpenVidu/Session.ts:185</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -599,7 +599,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L185">OpenVidu/Session.ts:185</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L186">OpenVidu/Session.ts:186</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -639,7 +639,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L186">OpenVidu/Session.ts:186</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L187">OpenVidu/Session.ts:187</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -702,7 +702,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L187">OpenVidu/Session.ts:187</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L188">OpenVidu/Session.ts:188</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -778,7 +778,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L251">OpenVidu/Session.ts:251</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L252">OpenVidu/Session.ts:252</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -800,7 +800,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L252">OpenVidu/Session.ts:252</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L253">OpenVidu/Session.ts:253</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -829,7 +829,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L369">OpenVidu/Session.ts:369</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L370">OpenVidu/Session.ts:370</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -865,7 +865,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L284">OpenVidu/Session.ts:284</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/OpenVidu/Session.ts#L285">OpenVidu/Session.ts:285</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">

View File

@ -8,18 +8,32 @@ import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/Publi
*/
export declare class OpenVidu {
private session;
private wsUri;
private secret;
private recorder;
private jsonRpcClient;
/**
* @hidden
*/
wsUri: string;
/**
* @hidden
*/
secret: string;
/**
* @hidden
*/
recorder: boolean;
/**
* @hidden
*/
advancedConfiguration: OpenViduAdvancedConfiguration;
constructor();
initSession(): Session;
/**
* Returns a session with id `sessionId`
* @param sessionId Session unique ID generated in openvidu-server
* ---
* ## DEPRECATED
*
* _No `sessionId` is required. Now every necessary information is received in [[Session.connect]]_
*
* ---
*/
initSession(sessionId: string): Session;
initPublisher(targetElement: string | HTMLElement): Publisher;
@ -106,10 +120,6 @@ export declare class OpenVidu {
* - `publisherSpeakingEventsOptions`: custom configuration for the [[PublisherSpeakingEvent]] feature
*/
setAdvancedConfiguration(configuration: OpenViduAdvancedConfiguration): void;
/**
* @hidden
*/
getUrlWithoutSecret(url: string): string;
/**
* @hidden
*/
@ -122,10 +132,6 @@ export declare class OpenVidu {
* @hidden
*/
closeWs(): void;
/**
* @hidden
*/
processOpenViduUrl(url: string): void;
/**
* @hidden
*/
@ -150,7 +156,4 @@ export declare class OpenVidu {
private reconnectingCallback();
private reconnectedCallback();
private isRoomAvailable();
private getSecretFromUrl(url);
private getRecorderFromUrl(url);
private getFinalWsUrl(url);
}

View File

@ -24,21 +24,19 @@ var RpcBuilder = require("../OpenViduInternal/KurentoUtils/kurento-jsonrpc");
var screenSharingAuto = require("../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto");
var screenSharing = require("../OpenViduInternal/ScreenSharing/Screen-Capturing");
var platform = require("platform");
/**
* @hidden
*/
var SECRET_PARAM = '?secret=';
/**
* @hidden
*/
var RECORDER_PARAM = '&recorder=';
/**
* Entrypoint of OpenVidu Browser library.
* Use it to initialize objects of type [[Session]], [[Publisher]] and [[LocalRecorder]]
*/
var OpenVidu = /** @class */ (function () {
function OpenVidu() {
/**
* @hidden
*/
this.secret = '';
/**
* @hidden
*/
this.recorder = false;
/**
* @hidden
@ -51,7 +49,10 @@ var OpenVidu = /** @class */ (function () {
* @param sessionId Session unique ID generated in openvidu-server
*/
OpenVidu.prototype.initSession = function (sessionId) {
this.session = new __1.Session(sessionId, this);
if (!!sessionId) {
console.warn("DEPRECATION WANING: In future releases 'OpenVidu.initSession' method won't require a parameter. Remove it (see http://openvidu.io/api/openvidu-browser/interfaces/publisherproperties.html)");
}
this.session = new __1.Session(this);
return this.session;
};
/**
@ -282,18 +283,6 @@ var OpenVidu = /** @class */ (function () {
this.advancedConfiguration = configuration;
};
/* Hidden methods */
/**
* @hidden
*/
OpenVidu.prototype.getUrlWithoutSecret = function (url) {
if (!url) {
console.error('sessionId is not defined');
}
if (url.indexOf(SECRET_PARAM) !== -1) {
url = url.substring(0, url.lastIndexOf(SECRET_PARAM));
}
return url;
};
/**
* @hidden
*/
@ -459,20 +448,6 @@ var OpenVidu = /** @class */ (function () {
OpenVidu.prototype.closeWs = function () {
this.jsonRpcClient.close();
};
/**
* @hidden
*/
OpenVidu.prototype.processOpenViduUrl = function (url) {
var secret = this.getSecretFromUrl(url);
var recorder = this.getRecorderFromUrl(url);
if (!!secret) {
this.secret = secret;
}
if (!!recorder) {
this.recorder = recorder;
}
this.wsUri = this.getFinalWsUrl(url);
};
/**
* @hidden
*/
@ -546,39 +521,6 @@ var OpenVidu = /** @class */ (function () {
return false;
}
};
OpenVidu.prototype.getSecretFromUrl = function (url) {
var secret = '';
if (url.indexOf(SECRET_PARAM) !== -1) {
var endOfSecret = url.lastIndexOf(RECORDER_PARAM);
if (endOfSecret !== -1) {
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, endOfSecret);
}
else {
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length);
}
}
return secret;
};
OpenVidu.prototype.getRecorderFromUrl = function (url) {
var recorder = '';
if (url.indexOf(RECORDER_PARAM) !== -1) {
recorder = url.substring(url.lastIndexOf(RECORDER_PARAM) + RECORDER_PARAM.length, url.length);
}
return Boolean(recorder).valueOf();
};
OpenVidu.prototype.getFinalWsUrl = function (url) {
url = this.getUrlWithoutSecret(url).substring(0, url.lastIndexOf('/')) + '/room';
if (url.indexOf('.ngrok.io') !== -1) {
// OpenVidu server URL referes to a ngrok IP: secure wss protocol and delete port of URL
url = url.replace('ws://', 'wss://');
var regex = /\.ngrok\.io:\d+/;
url = url.replace(regex, '.ngrok.io');
}
else if ((url.indexOf('localhost') !== -1) || (url.indexOf('127.0.0.1') !== -1)) {
// OpenVidu server URL referes to localhost IP
}
return url;
};
return OpenVidu;
}());
exports.OpenVidu = OpenVidu;

File diff suppressed because one or more lines are too long

View File

@ -291,7 +291,7 @@ var Publisher = /** @class */ (function () {
// Ask independently for audio stream and video stream. If the user asks for both of them and one is blocked, the method still
// success only with the allowed input. This is not the desierd behaviour: if any of them is blocked, access should be denied
var constraintsAux = {};
var timeForDialogEvent = 1000;
var timeForDialogEvent = 1250;
if (_this.stream.isSendVideo()) {
constraintsAux.audio = false;
constraintsAux.video = constraints.video;

View File

@ -49,7 +49,7 @@ export declare class Session implements EventDispatcher {
/**
* @hidden
*/
constructor(sessionId: string, openvidu: OpenVidu);
constructor(openvidu: OpenVidu);
connect(token: string): Promise<any>;
connect(token: string, metadata: any): Promise<any>;
/**
@ -214,4 +214,5 @@ export declare class Session implements EventDispatcher {
private stringClientMetadata(metadata);
private getConnection(connectionId, errorMessage);
private getRemoteConnection(connectionId, errorMessage);
private processToken(token);
}

View File

@ -36,7 +36,7 @@ var Session = /** @class */ (function () {
/**
* @hidden
*/
function Session(sessionId, openvidu) {
function Session(openvidu) {
// This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification
/**
* @hidden
@ -52,8 +52,6 @@ var Session = /** @class */ (function () {
this.speakingEventsEnabled = false;
this.ee = new EventEmitter();
this.openvidu = openvidu;
this.sessionId = this.openvidu.getUrlWithoutSecret(sessionId);
this.openvidu.processOpenViduUrl(sessionId);
}
/**
* Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when
@ -87,6 +85,7 @@ var Session = /** @class */ (function () {
// DEPRECATED WARNING
return VersionAdapter_1.solveIfCallback('Session.connect', (!!param3 && (typeof param3 === 'function')) ? param3 : ((typeof metadata === 'function') ? metadata : ''),
/*return */ new Promise(function (resolve, reject) {
_this.processToken(token);
if (_this.openvidu.checkSystemRequirements()) {
// Early configuration to deactivate automatic subscription to streams
_this.options = {
@ -605,7 +604,7 @@ var Session = /** @class */ (function () {
Session.prototype.onLostConnection = function () {
if (!this.connection) {
console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');
var url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/room')[0];
var url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];
if (window.confirm('If you are not debugging, this is probably a certificate error at \"' + url + '\"\n\nClick OK to navigate and accept it')) {
location.assign(url + '/accept-certificate');
}
@ -656,27 +655,32 @@ var Session = /** @class */ (function () {
var _this = this;
forced = !!forced;
console.info('Leaving Session (forced=' + forced + ')');
if (!!this.connection && !this.connection.disposed && !forced) {
this.openvidu.sendRequest('leaveRoom', function (error, response) {
if (error) {
console.error(error);
}
_this.openvidu.closeWs();
});
if (!!this.connection) {
if (!this.connection.disposed && !forced) {
this.openvidu.sendRequest('leaveRoom', function (error, response) {
if (error) {
console.error(error);
}
_this.openvidu.closeWs();
});
}
else {
this.openvidu.closeWs();
}
if (!!this.connection.stream) {
// Make Publisher object dispatch 'streamDestroyed' event (if there's a local stream)
this.connection.stream.disposeWebRtcPeer();
this.connection.stream.emitEvent('stream-destroyed-by-disconnect', [reason]);
}
if (!this.connection.disposed) {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)
var sessionDisconnectEvent = new SessionDisconnectedEvent_1.SessionDisconnectedEvent(this, reason);
this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
sessionDisconnectEvent.callDefaultBehaviour();
}
}
else {
this.openvidu.closeWs();
}
if (!!this.connection.stream) {
// Make Publisher object dispatch 'streamDestroyed' event (if there's a local stream)
this.connection.stream.disposeWebRtcPeer();
this.connection.stream.emitEvent('stream-destroyed-by-disconnect', [reason]);
}
if (!this.connection.disposed) {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)
var sessionDisconnectEvent = new SessionDisconnectedEvent_1.SessionDisconnectedEvent(this, reason);
this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
sessionDisconnectEvent.callDefaultBehaviour();
console.warn('You were not connected to the session ' + this.sessionId);
}
};
/* Private methods */
@ -696,36 +700,41 @@ var Session = /** @class */ (function () {
recorder: _this.openvidu.getRecorder()
};
_this.openvidu.sendRequest('joinRoom', joinParams, function (error, response) {
// Initialize local Connection object with values returned by openvidu-server
_this.connection = new __1.Connection(_this);
_this.connection.connectionId = response.id;
_this.connection.data = response.metadata;
// Initialize remote Connections with value returned by openvidu-server
var events = {
connections: new Array(),
streams: new Array()
};
var existingParticipants = response.value;
existingParticipants.forEach(function (participant) {
var connection = new __1.Connection(_this, participant);
_this.remoteConnections[connection.connectionId] = connection;
events.connections.push(connection);
if (!!connection.stream) {
_this.remoteStreamsCreated[connection.stream.streamId] = true;
events.streams.push(connection.stream);
}
});
// Own 'connectionCreated' event
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', _this.connection, '')]);
// One 'connectionCreated' event for each existing connection in the session
events.connections.forEach(function (connection) {
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);
});
// One 'streamCreated' event for each active stream in the session
events.streams.forEach(function (stream) {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);
});
resolve();
if (!!error) {
reject(error);
}
else {
// Initialize local Connection object with values returned by openvidu-server
_this.connection = new __1.Connection(_this);
_this.connection.connectionId = response.id;
_this.connection.data = response.metadata;
// Initialize remote Connections with value returned by openvidu-server
var events_1 = {
connections: new Array(),
streams: new Array()
};
var existingParticipants = response.value;
existingParticipants.forEach(function (participant) {
var connection = new __1.Connection(_this, participant);
_this.remoteConnections[connection.connectionId] = connection;
events_1.connections.push(connection);
if (!!connection.stream) {
_this.remoteStreamsCreated[connection.stream.streamId] = true;
events_1.streams.push(connection.stream);
}
});
// Own 'connectionCreated' event
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', _this.connection, '')]);
// One 'connectionCreated' event for each existing connection in the session
events_1.connections.forEach(function (connection) {
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);
});
// One 'streamCreated' event for each active stream in the session
events_1.streams.forEach(function (stream) {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);
});
resolve();
}
});
}
});
@ -773,6 +782,19 @@ var Session = /** @class */ (function () {
}
});
};
Session.prototype.processToken = function (token) {
var url = new URL(token);
this.sessionId = url.searchParams.get('sessionId');
var secret = url.searchParams.get('secret');
var recorder = url.searchParams.get('recorder');
if (!!secret) {
this.openvidu.secret = secret;
}
if (!!recorder) {
this.openvidu.recorder = true;
}
this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';
};
return Session;
}());
exports.Session = Session;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -152,7 +152,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L53">OpenVidu.ts:53</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L55">OpenVidu.ts:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -167,7 +167,11 @@
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="session.html" class="tsd-signature-type">Session</a><span class="tsd-signature-symbol">&gt;</span></h4>
<p>A Promise that is resolved to the <a href="session.html">Session</a> if success and rejected with an Error object if not</p>
<p>A Promise that is resolved to the <a href="session.html">Session</a> if success and rejected with an Error object if not.
This Error object has as <code>message</code> property with the following values:</p>
<ul>
<li><code>409</code>: you are trying to assign an already-in-use custom sessionId to the session. See <a href="../interfaces/sessionproperties.html#customsessionid">SessionProperties.customSessionId</a></li>
</ul>
</li>
</ul>
</section>
@ -181,7 +185,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L306">OpenVidu.ts:306</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L308">OpenVidu.ts:308</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -216,7 +220,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L207">OpenVidu.ts:207</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L209">OpenVidu.ts:209</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -251,7 +255,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L252">OpenVidu.ts:252</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L254">OpenVidu.ts:254</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -276,7 +280,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L66">OpenVidu.ts:66</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L68">OpenVidu.ts:68</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -306,7 +310,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L67">OpenVidu.ts:67</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L69">OpenVidu.ts:69</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -344,7 +348,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L68">OpenVidu.ts:68</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L70">OpenVidu.ts:70</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -386,7 +390,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L159">OpenVidu.ts:159</a></li>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/OpenVidu.ts#L161">OpenVidu.ts:161</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">

View File

@ -82,6 +82,7 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="sessionproperties.html#customsessionid" class="tsd-kind-icon">custom<wbr>Session<wbr>Id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="sessionproperties.html#defaultcustomlayout" class="tsd-kind-icon">default<wbr>Custom<wbr>Layout</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="sessionproperties.html#defaultrecordinglayout" class="tsd-kind-icon">default<wbr>Recording<wbr>Layout</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="sessionproperties.html#mediamode" class="tsd-kind-icon">media<wbr>Mode</a></li>
@ -93,6 +94,23 @@
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="customsessionid" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> custom<wbr>Session<wbr>Id</h3>
<div class="tsd-signature tsd-kind-icon">custom<wbr>Session<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/SessionProperties.ts#L52">SessionProperties.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Fix the sessionId that will be assigned to the session with this parameter. You can take advantage of this property
to facilitate the mapping between OpenVidu Server &#39;session&#39; entities and your own &#39;session&#39; entities.
If this parameter is undefined or an empty string, OpenVidu Server will generate a random sessionId for you.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="defaultcustomlayout" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> default<wbr>Custom<wbr>Layout</h3>
@ -197,6 +215,9 @@
<li class="current tsd-kind-interface">
<a href="sessionproperties.html" class="tsd-kind-icon">Session<wbr>Properties</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="sessionproperties.html#customsessionid" class="tsd-kind-icon">custom<wbr>Session<wbr>Id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="sessionproperties.html#defaultcustomlayout" class="tsd-kind-icon">default<wbr>Custom<wbr>Layout</a>
</li>

View File

@ -18,7 +18,9 @@ export declare class OpenVidu {
/**
* Creates an OpenVidu session. You can call [[Session.getSessionId]] in the resolved promise to retrieve the `sessionId`
*
* @returns A Promise that is resolved to the [[Session]] if success and rejected with an Error object if not
* @returns A Promise that is resolved to the [[Session]] if success and rejected with an Error object if not.
* This Error object has as `message` property with the following values:
* - `409`: you are trying to assign an already-in-use custom sessionId to the session. See [[SessionProperties.customSessionId]]
*/
createSession(properties?: SessionProperties): Promise<Session>;
startRecording(sessionId: string): Promise<Recording>;

View File

@ -35,7 +35,9 @@ var OpenVidu = /** @class */ (function () {
/**
* Creates an OpenVidu session. You can call [[Session.getSessionId]] in the resolved promise to retrieve the `sessionId`
*
* @returns A Promise that is resolved to the [[Session]] if success and rejected with an Error object if not
* @returns A Promise that is resolved to the [[Session]] if success and rejected with an Error object if not.
* This Error object has as `message` property with the following values:
* - `409`: you are trying to assign an already-in-use custom sessionId to the session. See [[SessionProperties.customSessionId]]
*/
OpenVidu.prototype.createSession = function (properties) {
var _this = this;
@ -317,11 +319,11 @@ var OpenVidu = /** @class */ (function () {
};
OpenVidu.prototype.setHostnameAndPort = function () {
var urlSplitted = this.urlOpenViduServer.split(':');
if (urlSplitted.length === 3) {
if (urlSplitted.length === 3) { // URL has format: http:// + hostname + :port
this.hostname = this.urlOpenViduServer.split(':')[1].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[2].replace(/\//g, ''));
}
else if (urlSplitted.length === 2) {
else if (urlSplitted.length === 2) { // URL has format: hostname + :port
this.hostname = this.urlOpenViduServer.split(':')[0].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[1].replace(/\//g, ''));
}

File diff suppressed because one or more lines are too long

View File

@ -104,7 +104,8 @@ var Session = /** @class */ (function () {
mediaMode: !!_this.properties.mediaMode ? _this.properties.mediaMode : MediaMode_1.MediaMode.ROUTED,
recordingMode: !!_this.properties.recordingMode ? _this.properties.recordingMode : RecordingMode_1.RecordingMode.MANUAL,
defaultRecordingLayout: !!_this.properties.defaultRecordingLayout ? _this.properties.defaultRecordingLayout : RecordingLayout_1.RecordingLayout.BEST_FIT,
defaultCustomLayout: !!_this.properties.defaultCustomLayout ? _this.properties.defaultCustomLayout : ''
defaultCustomLayout: !!_this.properties.defaultCustomLayout ? _this.properties.defaultCustomLayout : '',
customSessionId: !!_this.properties.customSessionId ? _this.properties.customSessionId : ''
});
var options = {
hostname: _this.hostname,

View File

@ -1 +1 @@
{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,yCAAwC;AACxC,+CAA8C;AAC9C,qDAAoD;AACpD,iDAAgD;AAIhD;;GAEG;AACH,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B;IAQI,iBAAoB,QAAgB,EAAU,IAAY,EAAU,SAAiB,EAAE,UAA8B;QAAjG,aAAQ,GAAR,QAAQ,CAAQ;QAAU,SAAI,GAAJ,IAAI,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QACjF,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACzB,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QACjC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,8BAAY,GAAnB;QACI,MAAM,CAAC,IAAI,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1",
"typedoc-plugin-sourcefile-url": "^1.0.3",
"typescript": "2.7.2",
"typescript": "2.8.3",
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.2.0",

View File

@ -0,0 +1,3 @@
#!/bin/sh
cd frontend
ng build --output-path ../../main/resources/static

View File

@ -11,7 +11,7 @@ import { MatDialogRef } from '@angular/material';
<form #dialogForm (ngSubmit)="testVideo()">
<mat-dialog-content>
<mat-input-container>
<input matInput name="secret" type="password" [(ngModel)]="secret">
<input matInput name="secret" type="password" [(ngModel)]="secret" required>
</mat-input-container>
</mat-dialog-content>
<mat-dialog-actions>

View File

@ -111,83 +111,85 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.restService.getOpenViduPublicUrl()
.then((url => {
this.openviduPublicUrl = url.replace('https://', 'wss://').replace('http://', 'ws://');
this.connectToSession(this.openviduPublicUrl + 'testSession?secret=' + secret);
this.connectToSession(this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}))
.catch(error => {
console.error(error);
});
} else {
this.connectToSession(this.openviduPublicUrl + 'testSession?secret=' + secret);
this.connectToSession(this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}
}
});
}
connectToSession(mySessionId: string) {
connectToSession(token: string) {
this.msgChain = [];
const OV = new OpenVidu();
this.session = OV.initSession(mySessionId);
this.session = OV.initSession();
this.testStatus = 'CONNECTING';
this.testButton = 'Testing...';
this.session.connect(null).then(() => {
this.session.connect(token)
.then(() => {
this.testStatus = 'CONNECTED';
this.testStatus = 'CONNECTED';
const publisherRemote = OV.initPublisher('mirrored-video', {
publishAudio: true,
publishVideo: true,
resolution: '640x480'
},
e => {
if (!!e) {
console.error(e);
const publisherRemote = OV.initPublisher('mirrored-video', {
publishAudio: true,
publishVideo: true,
resolution: '640x480'
},
e => {
if (!!e) {
console.error(e);
}
}
}
);
);
publisherRemote.on('accessAllowed', () => {
this.msgChain.push('Camera access allowed');
});
publisherRemote.on('accessDenied', () => {
this.endTestVideo();
this.msgChain.push('Camera access denied');
});
publisherRemote.on('videoElementCreated', (video) => {
this.showSpinner = true;
this.msgChain.push('Video element created');
});
publisherRemote.on('remoteVideoPlaying', (video) => {
this.msgChain.push('Remote video playing');
this.testButton = 'End test';
this.testStatus = 'PLAYING';
this.showSpinner = false;
});
publisherRemote.subscribeToRemote();
this.session.publish(publisherRemote);
}).catch(error => {
if (error.code === 401) { // User unauthorized error. OpenVidu security is active
this.endTestVideo();
let dialogRef: MatDialogRef<CredentialsDialogComponent>;
dialogRef = this.dialog.open(CredentialsDialogComponent);
dialogRef.componentInstance.myReference = dialogRef;
dialogRef.afterClosed().subscribe(secret => {
if (secret) {
this.connectToSession('wss://' + location.hostname + ':4443/testSession?secret=' + secret);
}
publisherRemote.on('accessAllowed', () => {
this.msgChain.push('Camera access allowed');
});
} else {
console.error(error);
}
});
publisherRemote.on('accessDenied', () => {
this.endTestVideo();
this.msgChain.push('Camera access denied');
});
publisherRemote.on('videoElementCreated', (video) => {
this.showSpinner = true;
this.msgChain.push('Video element created');
});
publisherRemote.on('remoteVideoPlaying', (video) => {
this.msgChain.push('Remote video playing');
this.testButton = 'End test';
this.testStatus = 'PLAYING';
this.showSpinner = false;
});
publisherRemote.subscribeToRemote();
this.session.publish(publisherRemote);
})
.catch(error => {
if (error.code === 401) { // User unauthorized error. OpenVidu security is active
this.endTestVideo();
let dialogRef: MatDialogRef<CredentialsDialogComponent>;
dialogRef = this.dialog.open(CredentialsDialogComponent);
dialogRef.componentInstance.myReference = dialogRef;
dialogRef.afterClosed().subscribe(secret => {
if (secret) {
this.connectToSession(this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}
});
} else {
console.error(error);
}
});
}
endTestVideo() {

View File

@ -48,9 +48,7 @@ export class LayoutBestFitComponent implements OnInit, OnDestroy {
ngOnInit() {
const OV = new OpenVidu();
const fullSessionId = 'wss://' + location.hostname + ':4443/' + this.sessionId + '?secret=' + this.secret + '&recorder=true';
this.session = OV.initSession(fullSessionId);
this.session = OV.initSession();
this.session.on('streamCreated', (event: StreamEvent) => {
const subscriber: Subscriber = this.session.subscribe(event.stream, '');
@ -63,7 +61,8 @@ export class LayoutBestFitComponent implements OnInit, OnDestroy {
this.openviduLayout.updateLayout();
});
this.session.connect(null)
const token = 'wss://' + location.hostname + ':4443?sessionId=' + this.sessionId + '&secret=' + this.secret + '&recorder=true';
this.session.connect(token)
.catch(error => {
console.error(error);
})

View File

@ -1 +1 @@
{"version":3,"sources":["webpack/bootstrap 61249b85238bdf352ff8"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 61249b85238bdf352ff8"],"sourceRoot":"webpack:///"}
{"version":3,"sources":["webpack/bootstrap c45ad824b5477488e221"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c45ad824b5477488e221"],"sourceRoot":"webpack:///"}

View File

@ -490,21 +490,19 @@ var RpcBuilder = __webpack_require__("../../../../openvidu-browser/lib/OpenViduI
var screenSharingAuto = __webpack_require__("../../../../openvidu-browser/lib/OpenViduInternal/ScreenSharing/Screen-Capturing-Auto.js");
var screenSharing = __webpack_require__("../../../../openvidu-browser/lib/OpenViduInternal/ScreenSharing/Screen-Capturing.js");
var platform = __webpack_require__("../../../../openvidu-browser/node_modules/platform/platform.js");
/**
* @hidden
*/
var SECRET_PARAM = '?secret=';
/**
* @hidden
*/
var RECORDER_PARAM = '&recorder=';
/**
* Entrypoint of OpenVidu Browser library.
* Use it to initialize objects of type [[Session]], [[Publisher]] and [[LocalRecorder]]
*/
var OpenVidu = /** @class */ (function () {
function OpenVidu() {
/**
* @hidden
*/
this.secret = '';
/**
* @hidden
*/
this.recorder = false;
/**
* @hidden
@ -517,7 +515,10 @@ var OpenVidu = /** @class */ (function () {
* @param sessionId Session unique ID generated in openvidu-server
*/
OpenVidu.prototype.initSession = function (sessionId) {
this.session = new __1.Session(sessionId, this);
if (!!sessionId) {
console.warn("DEPRECATION WANING: In future releases 'OpenVidu.initSession' method won't require a parameter. Remove it (see http://openvidu.io/api/openvidu-browser/interfaces/publisherproperties.html)");
}
this.session = new __1.Session(this);
return this.session;
};
/**
@ -748,18 +749,6 @@ var OpenVidu = /** @class */ (function () {
this.advancedConfiguration = configuration;
};
/* Hidden methods */
/**
* @hidden
*/
OpenVidu.prototype.getUrlWithoutSecret = function (url) {
if (!url) {
console.error('sessionId is not defined');
}
if (url.indexOf(SECRET_PARAM) !== -1) {
url = url.substring(0, url.lastIndexOf(SECRET_PARAM));
}
return url;
};
/**
* @hidden
*/
@ -925,20 +914,6 @@ var OpenVidu = /** @class */ (function () {
OpenVidu.prototype.closeWs = function () {
this.jsonRpcClient.close();
};
/**
* @hidden
*/
OpenVidu.prototype.processOpenViduUrl = function (url) {
var secret = this.getSecretFromUrl(url);
var recorder = this.getRecorderFromUrl(url);
if (!!secret) {
this.secret = secret;
}
if (!!recorder) {
this.recorder = recorder;
}
this.wsUri = this.getFinalWsUrl(url);
};
/**
* @hidden
*/
@ -1012,39 +987,6 @@ var OpenVidu = /** @class */ (function () {
return false;
}
};
OpenVidu.prototype.getSecretFromUrl = function (url) {
var secret = '';
if (url.indexOf(SECRET_PARAM) !== -1) {
var endOfSecret = url.lastIndexOf(RECORDER_PARAM);
if (endOfSecret !== -1) {
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, endOfSecret);
}
else {
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length);
}
}
return secret;
};
OpenVidu.prototype.getRecorderFromUrl = function (url) {
var recorder = '';
if (url.indexOf(RECORDER_PARAM) !== -1) {
recorder = url.substring(url.lastIndexOf(RECORDER_PARAM) + RECORDER_PARAM.length, url.length);
}
return Boolean(recorder).valueOf();
};
OpenVidu.prototype.getFinalWsUrl = function (url) {
url = this.getUrlWithoutSecret(url).substring(0, url.lastIndexOf('/')) + '/room';
if (url.indexOf('.ngrok.io') !== -1) {
// OpenVidu server URL referes to a ngrok IP: secure wss protocol and delete port of URL
url = url.replace('ws://', 'wss://');
var regex = /\.ngrok\.io:\d+/;
url = url.replace(regex, '.ngrok.io');
}
else if ((url.indexOf('localhost') !== -1) || (url.indexOf('127.0.0.1') !== -1)) {
// OpenVidu server URL referes to localhost IP
}
return url;
};
return OpenVidu;
}());
exports.OpenVidu = OpenVidu;
@ -1349,7 +1291,7 @@ var Publisher = /** @class */ (function () {
// Ask independently for audio stream and video stream. If the user asks for both of them and one is blocked, the method still
// success only with the allowed input. This is not the desierd behaviour: if any of them is blocked, access should be denied
var constraintsAux = {};
var timeForDialogEvent = 1000;
var timeForDialogEvent = 1250;
if (_this.stream.isSendVideo()) {
constraintsAux.audio = false;
constraintsAux.video = constraints.video;
@ -1578,7 +1520,7 @@ var Session = /** @class */ (function () {
/**
* @hidden
*/
function Session(sessionId, openvidu) {
function Session(openvidu) {
// This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification
/**
* @hidden
@ -1594,8 +1536,6 @@ var Session = /** @class */ (function () {
this.speakingEventsEnabled = false;
this.ee = new EventEmitter();
this.openvidu = openvidu;
this.sessionId = this.openvidu.getUrlWithoutSecret(sessionId);
this.openvidu.processOpenViduUrl(sessionId);
}
/**
* Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when
@ -1629,6 +1569,7 @@ var Session = /** @class */ (function () {
// DEPRECATED WARNING
return VersionAdapter_1.solveIfCallback('Session.connect', (!!param3 && (typeof param3 === 'function')) ? param3 : ((typeof metadata === 'function') ? metadata : ''),
/*return */ new Promise(function (resolve, reject) {
_this.processToken(token);
if (_this.openvidu.checkSystemRequirements()) {
// Early configuration to deactivate automatic subscription to streams
_this.options = {
@ -2147,7 +2088,7 @@ var Session = /** @class */ (function () {
Session.prototype.onLostConnection = function () {
if (!this.connection) {
console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');
var url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/room')[0];
var url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];
if (window.confirm('If you are not debugging, this is probably a certificate error at \"' + url + '\"\n\nClick OK to navigate and accept it')) {
location.assign(url + '/accept-certificate');
}
@ -2198,27 +2139,32 @@ var Session = /** @class */ (function () {
var _this = this;
forced = !!forced;
console.info('Leaving Session (forced=' + forced + ')');
if (!!this.connection && !this.connection.disposed && !forced) {
this.openvidu.sendRequest('leaveRoom', function (error, response) {
if (error) {
console.error(error);
}
_this.openvidu.closeWs();
});
if (!!this.connection) {
if (!this.connection.disposed && !forced) {
this.openvidu.sendRequest('leaveRoom', function (error, response) {
if (error) {
console.error(error);
}
_this.openvidu.closeWs();
});
}
else {
this.openvidu.closeWs();
}
if (!!this.connection.stream) {
// Make Publisher object dispatch 'streamDestroyed' event (if there's a local stream)
this.connection.stream.disposeWebRtcPeer();
this.connection.stream.emitEvent('stream-destroyed-by-disconnect', [reason]);
}
if (!this.connection.disposed) {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)
var sessionDisconnectEvent = new SessionDisconnectedEvent_1.SessionDisconnectedEvent(this, reason);
this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
sessionDisconnectEvent.callDefaultBehaviour();
}
}
else {
this.openvidu.closeWs();
}
if (!!this.connection.stream) {
// Make Publisher object dispatch 'streamDestroyed' event (if there's a local stream)
this.connection.stream.disposeWebRtcPeer();
this.connection.stream.emitEvent('stream-destroyed-by-disconnect', [reason]);
}
if (!this.connection.disposed) {
// Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)
var sessionDisconnectEvent = new SessionDisconnectedEvent_1.SessionDisconnectedEvent(this, reason);
this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
sessionDisconnectEvent.callDefaultBehaviour();
console.warn('You were not connected to the session ' + this.sessionId);
}
};
/* Private methods */
@ -2238,36 +2184,41 @@ var Session = /** @class */ (function () {
recorder: _this.openvidu.getRecorder()
};
_this.openvidu.sendRequest('joinRoom', joinParams, function (error, response) {
// Initialize local Connection object with values returned by openvidu-server
_this.connection = new __1.Connection(_this);
_this.connection.connectionId = response.id;
_this.connection.data = response.metadata;
// Initialize remote Connections with value returned by openvidu-server
var events = {
connections: new Array(),
streams: new Array()
};
var existingParticipants = response.value;
existingParticipants.forEach(function (participant) {
var connection = new __1.Connection(_this, participant);
_this.remoteConnections[connection.connectionId] = connection;
events.connections.push(connection);
if (!!connection.stream) {
_this.remoteStreamsCreated[connection.stream.streamId] = true;
events.streams.push(connection.stream);
}
});
// Own 'connectionCreated' event
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', _this.connection, '')]);
// One 'connectionCreated' event for each existing connection in the session
events.connections.forEach(function (connection) {
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);
});
// One 'streamCreated' event for each active stream in the session
events.streams.forEach(function (stream) {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);
});
resolve();
if (!!error) {
reject(error);
}
else {
// Initialize local Connection object with values returned by openvidu-server
_this.connection = new __1.Connection(_this);
_this.connection.connectionId = response.id;
_this.connection.data = response.metadata;
// Initialize remote Connections with value returned by openvidu-server
var events_1 = {
connections: new Array(),
streams: new Array()
};
var existingParticipants = response.value;
existingParticipants.forEach(function (participant) {
var connection = new __1.Connection(_this, participant);
_this.remoteConnections[connection.connectionId] = connection;
events_1.connections.push(connection);
if (!!connection.stream) {
_this.remoteStreamsCreated[connection.stream.streamId] = true;
events_1.streams.push(connection.stream);
}
});
// Own 'connectionCreated' event
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', _this.connection, '')]);
// One 'connectionCreated' event for each existing connection in the session
events_1.connections.forEach(function (connection) {
_this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);
});
// One 'streamCreated' event for each active stream in the session
events_1.streams.forEach(function (stream) {
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);
});
resolve();
}
});
}
});
@ -2315,6 +2266,19 @@ var Session = /** @class */ (function () {
}
});
};
Session.prototype.processToken = function (token) {
var url = new URL(token);
this.sessionId = url.searchParams.get('sessionId');
var secret = url.searchParams.get('secret');
var recorder = url.searchParams.get('recorder');
if (!!secret) {
this.openvidu.secret = secret;
}
if (!!recorder) {
this.openvidu.recorder = true;
}
this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';
};
return Session;
}());
exports.Session = Session;
@ -11508,7 +11472,7 @@ var CredentialsDialogComponent = (function () {
CredentialsDialogComponent = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({
selector: 'app-credentials-dialog',
template: "\n <div>\n <h1 mat-dialog-title>\n Insert your secret\n </h1>\n <form #dialogForm (ngSubmit)=\"testVideo()\">\n <mat-dialog-content>\n <mat-input-container>\n <input matInput name=\"secret\" type=\"password\" [(ngModel)]=\"secret\">\n </mat-input-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button mat-dialog-close>CANCEL</button>\n <button mat-button id=\"join-btn\" type=\"submit\">TEST</button>\n </mat-dialog-actions>\n </form>\n </div>\n ",
template: "\n <div>\n <h1 mat-dialog-title>\n Insert your secret\n </h1>\n <form #dialogForm (ngSubmit)=\"testVideo()\">\n <mat-dialog-content>\n <mat-input-container>\n <input matInput name=\"secret\" type=\"password\" [(ngModel)]=\"secret\" required>\n </mat-input-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button mat-dialog-close>CANCEL</button>\n <button mat-button id=\"join-btn\" type=\"submit\">TEST</button>\n </mat-dialog-actions>\n </form>\n </div>\n ",
styles: ["\n #quality-div {\n margin-top: 20px;\n }\n #join-div {\n margin-top: 25px;\n margin-bottom: 20px;\n }\n #quality-tag {\n display: block;\n }\n h5 {\n margin-bottom: 10px;\n text-align: left;\n }\n #joinWithVideo {\n margin-right: 50px;\n }\n mat-dialog-actions {\n display: block;\n }\n #join-btn {\n float: right;\n }\n "],
}),
__metadata("design:paramtypes", [])
@ -11640,26 +11604,27 @@ var DashboardComponent = (function () {
_this.restService.getOpenViduPublicUrl()
.then((function (url) {
_this.openviduPublicUrl = url.replace('https://', 'wss://').replace('http://', 'ws://');
_this.connectToSession(_this.openviduPublicUrl + 'testSession?secret=' + secret);
_this.connectToSession(_this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}))
.catch(function (error) {
console.error(error);
});
}
else {
_this.connectToSession(_this.openviduPublicUrl + 'testSession?secret=' + secret);
_this.connectToSession(_this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}
}
});
};
DashboardComponent.prototype.connectToSession = function (mySessionId) {
DashboardComponent.prototype.connectToSession = function (token) {
var _this = this;
this.msgChain = [];
var OV = new __WEBPACK_IMPORTED_MODULE_4_openvidu_browser__["OpenVidu"]();
this.session = OV.initSession(mySessionId);
this.session = OV.initSession();
this.testStatus = 'CONNECTING';
this.testButton = 'Testing...';
this.session.connect(null).then(function () {
this.session.connect(token)
.then(function () {
_this.testStatus = 'CONNECTED';
var publisherRemote = OV.initPublisher('mirrored-video', {
publishAudio: true,
@ -11689,7 +11654,8 @@ var DashboardComponent = (function () {
});
publisherRemote.subscribeToRemote();
_this.session.publish(publisherRemote);
}).catch(function (error) {
})
.catch(function (error) {
if (error.code === 401) {
_this.endTestVideo();
var dialogRef = void 0;
@ -11697,7 +11663,7 @@ var DashboardComponent = (function () {
dialogRef.componentInstance.myReference = dialogRef;
dialogRef.afterClosed().subscribe(function (secret) {
if (secret) {
_this.connectToSession('wss://' + location.hostname + ':4443/testSession?secret=' + secret);
_this.connectToSession(_this.openviduPublicUrl + '?sessionId=testSession&secret=' + secret);
}
});
}
@ -11814,8 +11780,7 @@ var LayoutBestFitComponent = (function () {
LayoutBestFitComponent.prototype.ngOnInit = function () {
var _this = this;
var OV = new __WEBPACK_IMPORTED_MODULE_2_openvidu_browser__["OpenVidu"]();
var fullSessionId = 'wss://' + location.hostname + ':4443/' + this.sessionId + '?secret=' + this.secret + '&recorder=true';
this.session = OV.initSession(fullSessionId);
this.session = OV.initSession();
this.session.on('streamCreated', function (event) {
var subscriber = _this.session.subscribe(event.stream, '');
_this.addRemoteStream(event.stream);
@ -11825,7 +11790,8 @@ var LayoutBestFitComponent = (function () {
_this.deleteRemoteStream(event.stream);
_this.openviduLayout.updateLayout();
});
this.session.connect(null)
var token = 'wss://' + location.hostname + ':4443?sessionId=' + this.sessionId + '&secret=' + this.secret + '&recorder=true';
this.session.connect(token)
.catch(function (error) {
console.error(error);
});

File diff suppressed because one or more lines are too long

View File

@ -385,26 +385,20 @@ public class OpenViduTestAppE2eTest {
OpenVidu OV = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET);
Session session = OV.createSession();
String sessionId = session.getSessionId();
List<WebElement> l1 = user.getDriver().findElements(By.className("secure-session-checkbox"));
for (WebElement el : l1) {
el.click();
}
List<WebElement> l2 = user.getDriver().findElements(By.className("sessionIdInput"));
List<WebElement> l2 = user.getDriver().findElements(By.className("tokenInput"));
for (WebElement el : l2) {
el.sendKeys(sessionId);
}
List<WebElement> l3 = user.getDriver().findElements(By.className("tokenInput"));
for (WebElement el : l3) {
String token = session.generateToken();
el.sendKeys(token);
}
List<WebElement> l4 = user.getDriver().findElements(By.className("join-btn"));
for (WebElement el : l4) {
List<WebElement> l3 = user.getDriver().findElements(By.className("join-btn"));
for (WebElement el : l3) {
el.sendKeys(Keys.ENTER);
}

View File

@ -71,7 +71,7 @@ public abstract class RoomClientFakeTest<W extends WebPage> extends OpenViduClie
TEST_PROTOCOL_DEFAULT).toUpperCase());
// might get overwritten by custom room apps
public static String appWsPath = "/room";
public static String appWsPath = "/openvidu";
public long JOIN_ROOM_TOTAL_TIMEOUT_IN_SECONDS = 30;
public long ACTIVE_LIVE_TOTAL_TIMEOUT_IN_SECONDS = 180;

View File

@ -135,8 +135,4 @@ mat-expansion-panel-header {
.secure-div mat-checkbox {
padding-right: 10px;
}
.secure-div mat-form-field {
max-width: 80px;
}

View File

@ -8,9 +8,6 @@
<div class="secure-div">
<mat-checkbox class="secure-session-checkbox" [disabled]="session" [(ngModel)]="secureSession" name="secureSession">SECURE</mat-checkbox>
<mat-form-field style="margin-right: 10px">
<input class="sessionIdInput" matInput placeholder="SESSIONID" name="sessionIdInput" [(ngModel)]="sessionIdInput" [disabled]="!secureSession">
</mat-form-field>
<mat-form-field>
<input class="tokenInput" matInput placeholder="TOKEN" name="tokenInput" [(ngModel)]="tokenInput" [disabled]="!secureSession">
</mat-form-field>

View File

@ -50,7 +50,6 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
secureSession = false;
clientData: string;
sessionName: string;
sessionIdInput: string;
tokenInput: string;
// Session options
@ -172,27 +171,24 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
this.leaveSession();
}
let sessionId;
let token;
if (this.secureSession) {
sessionId = this.sessionIdInput;
token = this.tokenInput;
} else {
sessionId = 'wss://'
+ this.removeHttps(this.openviduUrl)
+ this.sessionName + '?secret='
+ this.openviduSecret;
token = null;
token = 'wss://'
+ this.removeHttps(this.openviduUrl)
+ '?sessionId=' + this.sessionName
+ '&secret=' + this.openviduSecret;
}
this.joinSessionShared(sessionId, token);
this.joinSessionShared(token);
}
private joinSessionShared(sId, token): void {
private joinSessionShared(token): void {
this.OV = new OpenVidu();
this.session = this.OV.initSession(sId);
this.session = this.OV.initSession();
this.addSessionEvents(this.session);

View File

@ -19,6 +19,7 @@
<th>Default Recording Layout</th>
<th *ngIf="this.selectedDefaultRecordingLayout === 'CUSTOM'">Default Custom Layout</th>
<th>Media Mode</th>
<th>Custom sessionId</th>
</tr>
<tr id="tr-session-properties">
<td>
@ -47,6 +48,11 @@
</mat-option>
</mat-select>
</td>
<td>
<mat-form-field id="custom-session-id">
<input matInput placeholder="Custom sessionId" [(ngModel)]="customSessionId">
</mat-form-field>
</td>
</tr>
</table>
</div>

View File

@ -36,6 +36,7 @@ export class TestApirestComponent implements OnInit, OnDestroy {
selectedMediaMode = 'ROUTED';
customLayout = '';
customSessionId = '';
// API REST data collected
@ -76,7 +77,8 @@ export class TestApirestComponent implements OnInit, OnDestroy {
recordingMode: RecordingMode[this.selectedRecordingMode],
defaultRecordingLayout: RecordingLayout[this.selectedDefaultRecordingLayout],
defaultCustomLayout: this.customLayout,
mediaMode: MediaMode[this.selectedMediaMode]
mediaMode: MediaMode[this.selectedMediaMode],
customSessionId: this.customSessionId
})
.then((sessionId) => {
this.updateData();