mirror of https://github.com/OpenVidu/openvidu.git
Security system improved: no openvidu.security env variable needed
parent
0dc031c0c8
commit
10d5b69057
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,8 @@ export class OpenViduInternal {
|
|||
private camera: Stream;
|
||||
private remoteStreams: Stream[] = [];
|
||||
|
||||
private secret: string;
|
||||
|
||||
constructor() { };
|
||||
|
||||
|
||||
|
@ -103,6 +105,14 @@ export class OpenViduInternal {
|
|||
this.wsUri = wsUri;
|
||||
}
|
||||
|
||||
getSecret() {
|
||||
return this.secret;
|
||||
}
|
||||
|
||||
setSecret(secret: string) {
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
getOpenViduServerURL() {
|
||||
return 'https://' + this.wsUri.split("wss://")[1].split("/room")[0];
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ import { OpenViduInternal } from './OpenViduInternal';
|
|||
import { Connection, ConnectionOptions } from './Connection';
|
||||
import EventEmitter = require('wolfy87-eventemitter');
|
||||
|
||||
const SECRET_PARAM = '?secret=';
|
||||
|
||||
export interface SessionOptions {
|
||||
sessionId: string;
|
||||
participantId: string;
|
||||
|
@ -15,6 +17,7 @@ export interface SessionOptions {
|
|||
export class SessionInternal {
|
||||
|
||||
private id: string;
|
||||
private sessionId: string;
|
||||
private ee = new EventEmitter();
|
||||
private streams = {};
|
||||
private participants = {};
|
||||
|
@ -24,27 +27,48 @@ export class SessionInternal {
|
|||
private subscribeToStreams: boolean;
|
||||
private updateSpeakerInterval: number;
|
||||
public thresholdSpeaker: number;
|
||||
private options: SessionOptions
|
||||
private options: SessionOptions;
|
||||
|
||||
constructor(private openVidu: OpenViduInternal, private sessionId: string) {
|
||||
constructor(private openVidu: OpenViduInternal, sessionId: string) {
|
||||
this.sessionId = this.getUrlWithoutSecret(sessionId);
|
||||
this.localParticipant = new Connection(this.openVidu, true, this);
|
||||
if (!this.openVidu.getWsUri()) {
|
||||
this.openVidu.setWsUri(this.checkNgrokUri(sessionId));
|
||||
this.processOpenViduUrl(sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
checkNgrokUri(sessionId: string): string {
|
||||
sessionId = sessionId.substring(0, sessionId.lastIndexOf('/')) + '/room';
|
||||
if (sessionId.indexOf(".ngrok.io") !== -1) {
|
||||
private processOpenViduUrl(url: string) {
|
||||
this.openVidu.setSecret(this.getSecretFromUrl(url));
|
||||
this.openVidu.setWsUri(this.getFinalUrl(url));
|
||||
}
|
||||
|
||||
private getSecretFromUrl(url: string): string {
|
||||
let secret = '';
|
||||
if (url.indexOf(SECRET_PARAM) !== -1) {
|
||||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length);
|
||||
}
|
||||
return secret;
|
||||
}
|
||||
|
||||
private getUrlWithoutSecret(url: string): string {
|
||||
if (url.indexOf(SECRET_PARAM) !== -1) {
|
||||
url = url.substring(0, url.lastIndexOf(SECRET_PARAM));
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private getFinalUrl(url: string): string {
|
||||
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
|
||||
sessionId = sessionId.replace("ws://", "wss://");
|
||||
url = url.replace("ws://", "wss://");
|
||||
let regex = /\.ngrok\.io:\d+/;
|
||||
sessionId = sessionId.replace(regex, ".ngrok.io");
|
||||
} else if ((sessionId.indexOf("localhost") !== -1) || (sessionId.indexOf("127.0.0.1") != -1)) {
|
||||
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 sessionId;
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,6 +86,7 @@ export class SessionInternal {
|
|||
token: token,
|
||||
session: this.sessionId,
|
||||
metadata: this.options.metadata,
|
||||
secret: this.openVidu.getSecret(),
|
||||
dataChannels: false
|
||||
}
|
||||
|
||||
|
|
|
@ -642,7 +642,7 @@ export class Stream {
|
|||
|
||||
this.elements.forEach(e => disposeElement(e));
|
||||
|
||||
this.videoElements.forEach(ve => disposeElement(ve));
|
||||
//this.videoElements.forEach(ve => disposeElement(ve.video));
|
||||
|
||||
disposeElement("progress-" + this.getId());
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ public class ProtocolElements {
|
|||
public static final String JOINROOM_TOKEN_PARAM = "token";
|
||||
public static final String JOINROOM_ROOM_PARAM = "session";
|
||||
public static final String JOINROOM_METADATA_PARAM = "metadata";
|
||||
public static final String JOINROOM_SECRET_PARAM = "secret";
|
||||
|
||||
public static final String JOINROOM_DATACHANNELS_PARAM = "dataChannels";
|
||||
public static final String JOINROOM_PEERID_PARAM = "id";
|
||||
public static final String JOINROOM_PEERSTREAMS_PARAM = "streams";
|
||||
|
|
|
@ -21,7 +21,7 @@ export class Session {
|
|||
public getSessionId(callback: Function) {
|
||||
|
||||
if (this.sessionId) {
|
||||
return this.sessionId;
|
||||
callback(this.sessionId);
|
||||
}
|
||||
|
||||
let options = {
|
||||
|
|
|
@ -2,34 +2,40 @@ import { NgModule } from '@angular/core';
|
|||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import {
|
||||
MdButtonModule,
|
||||
MdIconModule,
|
||||
MdCheckboxModule,
|
||||
MdCardModule,
|
||||
MdInputModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdTooltipModule,
|
||||
MdDialogModule
|
||||
MdDialogModule,
|
||||
MdSlideToggleModule
|
||||
} from '@angular/material';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserAnimationsModule,
|
||||
MdButtonModule,
|
||||
MdIconModule,
|
||||
MdCheckboxModule,
|
||||
MdCardModule,
|
||||
MdInputModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdTooltipModule,
|
||||
MdDialogModule
|
||||
MdDialogModule,
|
||||
MdSlideToggleModule
|
||||
],
|
||||
exports: [
|
||||
BrowserAnimationsModule,
|
||||
MdButtonModule,
|
||||
MdIconModule,
|
||||
MdCheckboxModule,
|
||||
MdCardModule,
|
||||
MdInputModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdTooltipModule,
|
||||
MdDialogModule
|
||||
MdDialogModule,
|
||||
MdSlideToggleModule
|
||||
],
|
||||
})
|
||||
export class AppMaterialModule { }
|
||||
|
|
|
@ -4,6 +4,7 @@ import { NgModule } from '@angular/core';
|
|||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import 'hammerjs';
|
||||
|
||||
import { routing } from './app.routing';
|
||||
import { AppMaterialModule } from 'app/app.material.module';
|
||||
|
|
|
@ -2,14 +2,18 @@
|
|||
|
||||
<div fxLayout="column" fxFlex="66%" fxFlexOrder="1" fxFlexOrder.xs="2">
|
||||
<md-card id="log">
|
||||
<md-card-title>Server events</md-card-title>
|
||||
<md-card-title>Server events
|
||||
<md-slide-toggle title="Lock Scroll" [(ngModel)]="lockScroll" style="float: right; margin-left: auto;">
|
||||
<md-icon>lock_outline</md-icon>
|
||||
</md-slide-toggle>
|
||||
</md-card-title>
|
||||
<md-divider></md-divider>
|
||||
<md-card-content #scrollMe id="log-content">
|
||||
<md-list>
|
||||
<md-list-item *ngFor="let i of info">
|
||||
<ul>
|
||||
<li *ngFor="let i of info">
|
||||
<p>{{i}}</p>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</li>
|
||||
</ul>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
|
@ -17,11 +21,12 @@
|
|||
<div fxLayout="column" fxFlex="33%" fxFlexOrder="2" fxFlexOrder.xs="1">
|
||||
<md-card id="video-loop">
|
||||
<md-card-title>Test the connection
|
||||
<button [class]="testStatus == 'DISCONNECTED' ? 'blue' : (testStatus == 'PLAYING' ? 'yellow' : 'disabled')" md-raised-button (click)="toggleTestVideo()" [disabled]="testStatus==='CONNECTING' || testStatus==='CONNECTED'">{{testButton}}</button></md-card-title>
|
||||
<button [class]="testStatus == 'DISCONNECTED' ? 'blue' : (testStatus == 'PLAYING' ? 'yellow' : 'disabled')" md-raised-button
|
||||
(click)="toggleTestVideo()" [disabled]="testStatus==='CONNECTING' || testStatus==='CONNECTED'">{{testButton}}</button></md-card-title>
|
||||
<md-card-content #scrollMe id="log-content">
|
||||
<div id="mirrored-video">
|
||||
<div *ngIf="showSpinner" id="loader">
|
||||
<div class="loader-1 center"><span></span></div>
|
||||
<div class="loader-1 center"><span></span></div>
|
||||
</div>
|
||||
<!--<md-spinner *ngIf="showSpinner" [color]="color"></md-spinner>-->
|
||||
<div *ngIf="session" id="tick-div">
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { Component, OnInit, AfterViewChecked, ViewChild, ElementRef, HostListener, OnDestroy } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild, ElementRef, HostListener, OnDestroy } from '@angular/core';
|
||||
import { MdDialog, MdDialogRef } from '@angular/material';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
import { InfoService } from '../../services/info.service';
|
||||
import { CredentialsService } from '../../services/credentials.service';
|
||||
|
||||
import { OpenVidu, Session } from 'openvidu-browser';
|
||||
import { CredentialsDialogComponent } from './credentials-dialog.component';
|
||||
|
@ -15,9 +14,10 @@ declare const $;
|
|||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.css'],
|
||||
})
|
||||
export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||
export class DashboardComponent implements OnInit, OnDestroy {
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
lockScroll = false;
|
||||
|
||||
infoSubscription: Subscription;
|
||||
info = [];
|
||||
|
@ -29,12 +29,12 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
tickClass = 'trigger';
|
||||
showSpinner = false;
|
||||
|
||||
constructor(private infoService: InfoService, private credentialsService: CredentialsService, public dialog: MdDialog) {
|
||||
|
||||
constructor(private infoService: InfoService, public dialog: MdDialog) {
|
||||
// Subscription to info updated event raised by InfoService
|
||||
this.infoSubscription = this.infoService.newInfo$.subscribe(
|
||||
info => {
|
||||
this.info.push(info);
|
||||
this.scrollToBottom();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,6 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
}
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
toggleTestVideo() {
|
||||
if (!this.session) {
|
||||
this.testVideo();
|
||||
|
@ -70,11 +66,19 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
}
|
||||
|
||||
testVideo() {
|
||||
let OV = new OpenVidu();
|
||||
this.connectToSession(OV, 'wss://' + location.hostname + ':8443/testSession', 'token');
|
||||
let dialogRef: MdDialogRef<CredentialsDialogComponent>;
|
||||
dialogRef = this.dialog.open(CredentialsDialogComponent);
|
||||
dialogRef.componentInstance.myReference = dialogRef;
|
||||
|
||||
dialogRef.afterClosed().subscribe(secret => {
|
||||
if (secret) {
|
||||
this.connectToSession('wss://' + location.hostname + ':8443/testSession?secret=' + secret);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
connectToSession(OV: OpenVidu, mySessionId: string, myToken: string) {
|
||||
connectToSession(mySessionId: string) {
|
||||
let OV = new OpenVidu();
|
||||
this.session = OV.initSession(mySessionId);
|
||||
|
||||
this.session.on('streamCreated', (event) => {
|
||||
|
@ -84,7 +88,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
this.testStatus = 'CONNECTING';
|
||||
this.testButton = 'Testing...';
|
||||
|
||||
this.session.connect(myToken, (error) => {
|
||||
this.session.connect('token', (error) => {
|
||||
if (!error) {
|
||||
|
||||
this.testStatus = 'CONNECTED';
|
||||
|
@ -118,18 +122,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
|
||||
dialogRef.afterClosed().subscribe(secret => {
|
||||
if (secret) {
|
||||
this.credentialsService.getSessionId(secret).subscribe(
|
||||
sessionId => {
|
||||
this.credentialsService.getToken(sessionId.id, secret).subscribe(
|
||||
token => {
|
||||
this.connectToSession(OV, sessionId.id, token.token);
|
||||
}
|
||||
)
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
this.connectToSession('wss://' + location.hostname + ':8443/testSession?secret=' + secret);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -145,13 +138,16 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
this.testStatus = 'DISCONNECTED';
|
||||
this.testButton = 'Test';
|
||||
this.showSpinner = false;
|
||||
this.info = [];
|
||||
}
|
||||
|
||||
scrollToBottom(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
if (!this.lockScroll) {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('[Error]:' + err.toString());
|
||||
console.error('[Error]:' + err.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http, Headers, RequestOptions } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
@Injectable()
|
||||
export class CredentialsService {
|
||||
|
||||
url: string;
|
||||
|
||||
constructor(private http: Http) {
|
||||
this.url = 'https://' + location.hostname + ':8443'
|
||||
}
|
||||
|
||||
getSessionId(secret: string) {
|
||||
let headers = new Headers({ 'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + secret) });
|
||||
let options = new RequestOptions({ headers });
|
||||
return this.http.post('api/sessions', options)
|
||||
.map(response => response.json())
|
||||
.catch(error => this.handleError(error));
|
||||
}
|
||||
|
||||
getToken(sessionId: string, secret: string) {
|
||||
let body = JSON.stringify({ "session": sessionId, "role": "PUBLISHER", "data": "" });
|
||||
let headers = new Headers({ 'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + secret), 'Content-Type': 'application/json' });
|
||||
let options = new RequestOptions({ headers });
|
||||
return this.http.post('api/tokens', body, options)
|
||||
.map(response => response.json())
|
||||
.catch(error => this.handleError(error));
|
||||
}
|
||||
|
||||
private handleError(error: any) {
|
||||
console.error(error);
|
||||
return Observable.throw('Server error (' + error.status + '): ' + error.text())
|
||||
}
|
||||
|
||||
}
|
|
@ -444,4 +444,8 @@ public class NotificationRoomManager {
|
|||
public String newRandomUserName(String token, String roomId){
|
||||
return this.internalManager.newRandomUserName(token, roomId);
|
||||
}
|
||||
|
||||
public void newInsecureUser(String pid){
|
||||
this.internalManager.newInsecureUser(pid);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,8 @@ public class RoomManager {
|
|||
private final ConcurrentMap<String, ConcurrentHashMap<String, Token>> sessionidTokenTokenobj = new ConcurrentHashMap<>();
|
||||
private final ConcurrentMap<String, ConcurrentHashMap<String, String>> sessionidUsernameToken = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentMap<String, Boolean> usernameInsecure = new ConcurrentHashMap<>();
|
||||
|
||||
private volatile boolean closed = false;
|
||||
|
||||
public RoomManager() {
|
||||
|
@ -178,6 +180,16 @@ public class RoomManager {
|
|||
if (sessionidTokenTokenobj.get(roomName) != null) {
|
||||
sessionidTokenTokenobj.get(roomName).remove(token);
|
||||
}
|
||||
boolean stillParticipant = false;
|
||||
for (Room r : rooms.values()) {
|
||||
if (r.getParticipant(participantId) != null){
|
||||
stillParticipant = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!stillParticipant) {
|
||||
usernameInsecure.remove(participantId);
|
||||
}
|
||||
}
|
||||
|
||||
showMap();
|
||||
|
@ -967,8 +979,8 @@ public class RoomManager {
|
|||
return getParticipant(pid).getRoom().getName();
|
||||
}
|
||||
|
||||
public boolean isParticipantInRoom(String token, String roomId) throws OpenViduException {
|
||||
if (openviduConf.getOpenViduSecurity()) {
|
||||
public boolean isParticipantInRoom(String token, String roomId, String pid) throws OpenViduException {
|
||||
if (!this.isInsecureUser(pid)) {
|
||||
if (this.sessionidTokenTokenobj.get(roomId) != null) {
|
||||
return this.sessionidTokenTokenobj.get(roomId).containsKey(token);
|
||||
} else{
|
||||
|
@ -983,8 +995,8 @@ public class RoomManager {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isPublisherInRoom(String userName, String roomId) {
|
||||
if (openviduConf.getOpenViduSecurity()) {
|
||||
public boolean isPublisherInRoom(String userName, String roomId, String pid) {
|
||||
if (!this.isInsecureUser(pid)) {
|
||||
if (this.sessionidUsernameToken.get(roomId) != null){
|
||||
String token = this.sessionidUsernameToken.get(roomId).get(userName);
|
||||
if (token != null){
|
||||
|
@ -1000,6 +1012,14 @@ public class RoomManager {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isInsecureUser(String pid) {
|
||||
if(this.usernameInsecure.containsKey(pid)) {
|
||||
System.out.println("The user with pid " + pid + " is an INSECURE user");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getTokenClientMetadata(String userName, String roomId) throws OpenViduException {
|
||||
if (this.sessionidUsernameToken.get(roomId) != null && this.sessionidTokenTokenobj.get(roomId) != null){
|
||||
String token = this.sessionidUsernameToken.get(roomId).get(userName);
|
||||
|
@ -1054,9 +1074,7 @@ public class RoomManager {
|
|||
if (this.sessionidUsernameToken.get(roomId) != null && this.sessionidTokenTokenobj.get(roomId) != null) {
|
||||
if(metadataFormatCorrect(metadata)){
|
||||
String token = new BigInteger(130, new SecureRandom()).toString(32);
|
||||
if (openviduConf.getOpenViduSecurity()) { // Store the token only if security is enabled
|
||||
this.sessionidTokenTokenobj.get(roomId).put(token, new Token(token, role, metadata));
|
||||
}
|
||||
this.sessionidTokenTokenobj.get(roomId).put(token, new Token(token, role, metadata));
|
||||
showMap();
|
||||
return token;
|
||||
}
|
||||
|
@ -1071,21 +1089,21 @@ public class RoomManager {
|
|||
}
|
||||
|
||||
public String newRandomUserName(String token, String roomId) {
|
||||
if (openviduConf.getOpenViduSecurity()) {
|
||||
if (this.sessionidUsernameToken.get(roomId) != null && this.sessionidTokenTokenobj.get(roomId) != null) {
|
||||
if (this.sessionidTokenTokenobj.get(roomId).get(token) != null) {
|
||||
return this.generateAndStoreUserName(token, roomId);
|
||||
} else {
|
||||
throw new OpenViduException(Code.USER_NOT_FOUND_ERROR_CODE, token);
|
||||
}
|
||||
if (this.sessionidUsernameToken.get(roomId) != null && this.sessionidTokenTokenobj.get(roomId) != null) {
|
||||
if (this.sessionidTokenTokenobj.get(roomId).get(token) != null) {
|
||||
return this.generateAndStoreUserName(token, roomId);
|
||||
} else {
|
||||
throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, roomId);
|
||||
throw new OpenViduException(Code.USER_NOT_FOUND_ERROR_CODE, token);
|
||||
}
|
||||
} else {
|
||||
return token;
|
||||
throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, roomId);
|
||||
}
|
||||
}
|
||||
|
||||
public void newInsecureUser(String pid){
|
||||
this.usernameInsecure.put(pid, true);
|
||||
}
|
||||
|
||||
private String generateAndStoreUserName(String token, String roomId) {
|
||||
String userName = new BigInteger(130, new SecureRandom()).toString(32);
|
||||
ConcurrentHashMap<String, String> usernameToken = this.sessionidUsernameToken.get(roomId);
|
||||
|
|
|
@ -34,6 +34,7 @@ import io.openvidu.client.internal.ProtocolElements;
|
|||
import io.openvidu.server.core.NotificationRoomManager;
|
||||
import io.openvidu.server.core.api.pojo.ParticipantRequest;
|
||||
import io.openvidu.server.core.api.pojo.UserParticipant;
|
||||
import io.openvidu.server.security.OpenviduConfiguration;
|
||||
|
||||
/**
|
||||
* Controls the user interactions by delegating her JSON-RPC requests to the room API.
|
||||
|
@ -46,6 +47,9 @@ public class JsonRpcUserControl {
|
|||
|
||||
@Autowired
|
||||
protected NotificationRoomManager roomManager;
|
||||
|
||||
@Autowired
|
||||
OpenviduConfiguration openviduConf;
|
||||
|
||||
public JsonRpcUserControl() {}
|
||||
|
||||
|
@ -55,15 +59,21 @@ public class JsonRpcUserControl {
|
|||
|
||||
String roomId = getStringParam(request, ProtocolElements.JOINROOM_ROOM_PARAM);
|
||||
String token = getStringParam(request, ProtocolElements.JOINROOM_TOKEN_PARAM);
|
||||
String pid = participantRequest.getParticipantId();
|
||||
|
||||
if(roomManager.getRoomManager().isParticipantInRoom(token, roomId)){
|
||||
if (openviduConf.isOpenViduSecret(getStringParam(request, ProtocolElements.JOINROOM_SECRET_PARAM))) {
|
||||
roomManager.newInsecureUser(pid);
|
||||
}
|
||||
|
||||
if(roomManager.getRoomManager().isParticipantInRoom(token, roomId, pid)){
|
||||
|
||||
String userName = roomManager.newRandomUserName(token, roomId);
|
||||
String clientMetadata = getStringParam(request, ProtocolElements.JOINROOM_METADATA_PARAM);
|
||||
|
||||
if(roomManager.getRoomManager().metadataFormatCorrect(clientMetadata)){
|
||||
|
||||
this.roomManager.getRoomManager().setTokenClientMetadata(userName, roomId, clientMetadata);
|
||||
String userName = roomManager.newRandomUserName(token, roomId);
|
||||
|
||||
roomManager.getRoomManager().setTokenClientMetadata(userName, roomId, clientMetadata);
|
||||
|
||||
boolean dataChannels = false;
|
||||
if (request.getParams().has(ProtocolElements.JOINROOM_DATACHANNELS_PARAM)) {
|
||||
|
@ -85,7 +95,7 @@ public class JsonRpcUserControl {
|
|||
} else {
|
||||
System.out.println("Error: sessionId or token not valid");
|
||||
throw new OpenViduException(Code.USER_UNAUTHORIZED_ERROR_CODE,
|
||||
"Unable to join room. The user does not have a valid token");
|
||||
"Unable to join room. The user is not authorized");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +106,7 @@ public class JsonRpcUserControl {
|
|||
String participantName = roomManager.getRoomManager().getParticipantName(pid);
|
||||
String roomName = roomManager.getRoomManager().getRoomNameFromParticipantId(pid);
|
||||
|
||||
if (roomManager.getRoomManager().isPublisherInRoom(participantName, roomName)) {
|
||||
if (roomManager.getRoomManager().isPublisherInRoom(participantName, roomName, pid)) {
|
||||
|
||||
String sdpOffer = getStringParam(request, ProtocolElements.PUBLISHVIDEO_SDPOFFER_PARAM);
|
||||
boolean audioOnly = getBooleanParam(request, ProtocolElements.PUBLISHVIDEO_AUDIOONLY_PARAM);
|
||||
|
|
|
@ -15,9 +15,6 @@ public class OpenviduConfiguration {
|
|||
@Value("${openvidu.secret}")
|
||||
private String openviduSecret;
|
||||
|
||||
@Value("${openvidu.security}")
|
||||
private boolean openviduSecurity; // true, false
|
||||
|
||||
public String getOpenViduPublicUrl() {
|
||||
return this.openviduPublicUrl;
|
||||
}
|
||||
|
@ -29,9 +26,9 @@ public class OpenviduConfiguration {
|
|||
public String getOpenViduSecret() {
|
||||
return this.openviduSecret;
|
||||
}
|
||||
|
||||
public boolean getOpenViduSecurity() {
|
||||
return this.openviduSecurity;
|
||||
|
||||
public boolean isOpenViduSecret(String secret) {
|
||||
return secret.equals(this.getOpenViduSecret());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,5 +7,4 @@ server.address: 0.0.0.0
|
|||
kms.uris=[\"ws://localhost:8888/kurento\"]
|
||||
|
||||
openvidu.secret: MY_SECRET
|
||||
openvidu.security: false
|
||||
openvidu.publicurl: ngrok
|
|
@ -9,5 +9,4 @@ server.ssl.key-alias: openvidu-selfsigned
|
|||
kms.uris=[\"ws://localhost:8888/kurento\"]
|
||||
|
||||
openvidu.secret: MY_SECRET
|
||||
openvidu.security: true
|
||||
openvidu.publicurl: local
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
webpackJsonp([1,4],{
|
||||
|
||||
/***/ 105:
|
||||
/***/ 104:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -8,7 +8,7 @@ webpackJsonp([1,4],{
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var EventEmitter = __webpack_require__(52);
|
||||
var kurentoUtils = __webpack_require__(277);
|
||||
var adapter = __webpack_require__(176);
|
||||
var adapter = __webpack_require__(175);
|
||||
if (window) {
|
||||
window["adapter"] = adapter;
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ var Stream = (function () {
|
|||
}
|
||||
}
|
||||
this.elements.forEach(function (e) { return disposeElement(e); });
|
||||
this.videoElements.forEach(function (ve) { return disposeElement(ve); });
|
||||
//this.videoElements.forEach(ve => disposeElement(ve.video));
|
||||
disposeElement("progress-" + this.getId());
|
||||
if (this.wp) {
|
||||
this.wp.dispose();
|
||||
|
@ -585,11 +585,10 @@ CredentialsDialogComponent = __decorate([
|
|||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_material__ = __webpack_require__(119);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_info_service__ = __webpack_require__(70);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_credentials_service__ = __webpack_require__(123);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_openvidu_browser__ = __webpack_require__(371);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_openvidu_browser___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_openvidu_browser__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__credentials_dialog_component__ = __webpack_require__(120);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_info_service__ = __webpack_require__(69);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_openvidu_browser__ = __webpack_require__(371);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_openvidu_browser___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_openvidu_browser__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__credentials_dialog_component__ = __webpack_require__(120);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardComponent; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
@ -605,13 +604,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|||
|
||||
|
||||
|
||||
|
||||
var DashboardComponent = (function () {
|
||||
function DashboardComponent(infoService, credentialsService, dialog) {
|
||||
function DashboardComponent(infoService, dialog) {
|
||||
var _this = this;
|
||||
this.infoService = infoService;
|
||||
this.credentialsService = credentialsService;
|
||||
this.dialog = dialog;
|
||||
this.lockScroll = false;
|
||||
this.info = [];
|
||||
this.testStatus = 'DISCONNECTED';
|
||||
this.testButton = 'Test';
|
||||
|
@ -620,6 +618,7 @@ var DashboardComponent = (function () {
|
|||
// Subscription to info updated event raised by InfoService
|
||||
this.infoSubscription = this.infoService.newInfo$.subscribe(function (info) {
|
||||
_this.info.push(info);
|
||||
_this.scrollToBottom();
|
||||
});
|
||||
}
|
||||
DashboardComponent.prototype.ngOnInit = function () {
|
||||
|
@ -636,9 +635,6 @@ var DashboardComponent = (function () {
|
|||
this.endTestVideo();
|
||||
}
|
||||
};
|
||||
DashboardComponent.prototype.ngAfterViewChecked = function () {
|
||||
this.scrollToBottom();
|
||||
};
|
||||
DashboardComponent.prototype.toggleTestVideo = function () {
|
||||
if (!this.session) {
|
||||
this.testVideo();
|
||||
|
@ -648,18 +644,26 @@ var DashboardComponent = (function () {
|
|||
}
|
||||
};
|
||||
DashboardComponent.prototype.testVideo = function () {
|
||||
var OV = new __WEBPACK_IMPORTED_MODULE_4_openvidu_browser__["OpenVidu"]();
|
||||
this.connectToSession(OV, 'wss://' + location.hostname + ':8443/testSession', 'token');
|
||||
};
|
||||
DashboardComponent.prototype.connectToSession = function (OV, mySessionId, myToken) {
|
||||
var _this = this;
|
||||
var dialogRef;
|
||||
dialogRef = this.dialog.open(__WEBPACK_IMPORTED_MODULE_4__credentials_dialog_component__["a" /* CredentialsDialogComponent */]);
|
||||
dialogRef.componentInstance.myReference = dialogRef;
|
||||
dialogRef.afterClosed().subscribe(function (secret) {
|
||||
if (secret) {
|
||||
_this.connectToSession('wss://' + location.hostname + ':8443/testSession?secret=' + secret);
|
||||
}
|
||||
});
|
||||
};
|
||||
DashboardComponent.prototype.connectToSession = function (mySessionId) {
|
||||
var _this = this;
|
||||
var OV = new __WEBPACK_IMPORTED_MODULE_3_openvidu_browser__["OpenVidu"]();
|
||||
this.session = OV.initSession(mySessionId);
|
||||
this.session.on('streamCreated', function (event) {
|
||||
_this.session.subscribe(event.stream, 'mirrored-video');
|
||||
});
|
||||
this.testStatus = 'CONNECTING';
|
||||
this.testButton = 'Testing...';
|
||||
this.session.connect(myToken, function (error) {
|
||||
this.session.connect('token', function (error) {
|
||||
if (!error) {
|
||||
_this.testStatus = 'CONNECTED';
|
||||
var publisherRemote = OV.initPublisher('mirrored-video', {
|
||||
|
@ -683,17 +687,11 @@ var DashboardComponent = (function () {
|
|||
if (error.code === 401) {
|
||||
_this.endTestVideo();
|
||||
var dialogRef = void 0;
|
||||
dialogRef = _this.dialog.open(__WEBPACK_IMPORTED_MODULE_5__credentials_dialog_component__["a" /* CredentialsDialogComponent */]);
|
||||
dialogRef = _this.dialog.open(__WEBPACK_IMPORTED_MODULE_4__credentials_dialog_component__["a" /* CredentialsDialogComponent */]);
|
||||
dialogRef.componentInstance.myReference = dialogRef;
|
||||
dialogRef.afterClosed().subscribe(function (secret) {
|
||||
if (secret) {
|
||||
_this.credentialsService.getSessionId(secret).subscribe(function (sessionId) {
|
||||
_this.credentialsService.getToken(sessionId.id, secret).subscribe(function (token) {
|
||||
_this.connectToSession(OV, sessionId.id, token.token);
|
||||
});
|
||||
}, function (err) {
|
||||
console.log(err);
|
||||
});
|
||||
_this.connectToSession('wss://' + location.hostname + ':8443/testSession?secret=' + secret);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -709,20 +707,23 @@ var DashboardComponent = (function () {
|
|||
this.testStatus = 'DISCONNECTED';
|
||||
this.testButton = 'Test';
|
||||
this.showSpinner = false;
|
||||
this.info = [];
|
||||
};
|
||||
DashboardComponent.prototype.scrollToBottom = function () {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
if (!this.lockScroll) {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log('[Error]:' + err.toString());
|
||||
console.error('[Error]:' + err.toString());
|
||||
}
|
||||
};
|
||||
return DashboardComponent;
|
||||
}());
|
||||
__decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_7" /* ViewChild */])('scrollMe'),
|
||||
__metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* ElementRef */]) === "function" && _a || Object)
|
||||
__metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["l" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["l" /* ElementRef */]) === "function" && _a || Object)
|
||||
], DashboardComponent.prototype, "myScrollContainer", void 0);
|
||||
__decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_12" /* HostListener */])('window:beforeunload'),
|
||||
|
@ -734,12 +735,12 @@ DashboardComponent = __decorate([
|
|||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_4" /* Component */])({
|
||||
selector: 'app-dashboard',
|
||||
template: __webpack_require__(283),
|
||||
styles: [__webpack_require__(262)],
|
||||
styles: [__webpack_require__(261)],
|
||||
}),
|
||||
__metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__services_info_service__["a" /* InfoService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__services_info_service__["a" /* InfoService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__services_credentials_service__["a" /* CredentialsService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__services_credentials_service__["a" /* CredentialsService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_1__angular_material__["h" /* MdDialog */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__angular_material__["h" /* MdDialog */]) === "function" && _d || Object])
|
||||
__metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__services_info_service__["a" /* InfoService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__services_info_service__["a" /* InfoService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_1__angular_material__["j" /* MdDialog */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__angular_material__["j" /* MdDialog */]) === "function" && _c || Object])
|
||||
], DashboardComponent);
|
||||
|
||||
var _a, _b, _c, _d;
|
||||
var _a, _b, _c;
|
||||
//# sourceMappingURL=dashboard.component.js.map
|
||||
|
||||
/***/ }),
|
||||
|
@ -771,7 +772,7 @@ SessionDetailsComponent = __decorate([
|
|||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_4" /* Component */])({
|
||||
selector: 'app-session-details',
|
||||
template: __webpack_require__(284),
|
||||
styles: [__webpack_require__(263)]
|
||||
styles: [__webpack_require__(262)]
|
||||
}),
|
||||
__metadata("design:paramtypes", [])
|
||||
], SessionDetailsComponent);
|
||||
|
@ -780,66 +781,7 @@ SessionDetailsComponent = __decorate([
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 123:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(69);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CredentialsService; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
|
||||
|
||||
|
||||
var CredentialsService = (function () {
|
||||
function CredentialsService(http) {
|
||||
this.http = http;
|
||||
this.url = 'https://' + location.hostname + ':8443';
|
||||
}
|
||||
CredentialsService.prototype.getSessionId = function (secret) {
|
||||
var _this = this;
|
||||
var headers = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Headers */]({ 'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + secret) });
|
||||
var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["c" /* RequestOptions */]({ headers: headers });
|
||||
return this.http.post('api/sessions', options)
|
||||
.map(function (response) { return response.json(); })
|
||||
.catch(function (error) { return _this.handleError(error); });
|
||||
};
|
||||
CredentialsService.prototype.getToken = function (sessionId, secret) {
|
||||
var _this = this;
|
||||
var body = JSON.stringify({ "session": sessionId, "role": "PUBLISHER", "data": "" });
|
||||
var headers = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Headers */]({ 'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + secret), 'Content-Type': 'application/json' });
|
||||
var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["c" /* RequestOptions */]({ headers: headers });
|
||||
return this.http.post('api/tokens', body, options)
|
||||
.map(function (response) { return response.json(); })
|
||||
.catch(function (error) { return _this.handleError(error); });
|
||||
};
|
||||
CredentialsService.prototype.handleError = function (error) {
|
||||
console.error(error);
|
||||
return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].throw('Server error (' + error.status + '): ' + error.text());
|
||||
};
|
||||
return CredentialsService;
|
||||
}());
|
||||
CredentialsService = __decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* Http */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* Http */]) === "function" && _a || Object])
|
||||
], CredentialsService);
|
||||
|
||||
var _a;
|
||||
//# sourceMappingURL=credentials.service.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 169:
|
||||
/***/ 168:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -937,13 +879,13 @@ exports.Publisher = Publisher;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 170:
|
||||
/***/ 169:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Subscriber_1 = __webpack_require__(171);
|
||||
var Subscriber_1 = __webpack_require__(170);
|
||||
var EventEmitter = __webpack_require__(52);
|
||||
var Session = (function () {
|
||||
function Session(session, openVidu) {
|
||||
|
@ -1087,7 +1029,7 @@ exports.Session = Session;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 171:
|
||||
/***/ 170:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -1131,13 +1073,13 @@ exports.Subscriber = Subscriber;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 172:
|
||||
/***/ 171:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Stream_1 = __webpack_require__(105);
|
||||
var Stream_1 = __webpack_require__(104);
|
||||
var Connection = (function () {
|
||||
function Connection(openVidu, local, room, options) {
|
||||
this.openVidu = openVidu;
|
||||
|
@ -1205,7 +1147,7 @@ exports.Connection = Connection;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 177:
|
||||
/***/ 176:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
function webpackEmptyContext(req) {
|
||||
|
@ -1214,20 +1156,20 @@ function webpackEmptyContext(req) {
|
|||
webpackEmptyContext.keys = function() { return []; };
|
||||
webpackEmptyContext.resolve = webpackEmptyContext;
|
||||
module.exports = webpackEmptyContext;
|
||||
webpackEmptyContext.id = 177;
|
||||
webpackEmptyContext.id = 176;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 178:
|
||||
/***/ 177:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__ = __webpack_require__(198);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app_module__ = __webpack_require__(203);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__environments_environment__ = __webpack_require__(205);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__ = __webpack_require__(197);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app_module__ = __webpack_require__(202);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__environments_environment__ = __webpack_require__(204);
|
||||
|
||||
|
||||
|
||||
|
@ -1240,12 +1182,12 @@ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dyna
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 201:
|
||||
/***/ 200:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_services_info_service__ = __webpack_require__(70);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_services_info_service__ = __webpack_require__(69);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppComponent; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
@ -1301,7 +1243,7 @@ AppComponent = __decorate([
|
|||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_4" /* Component */])({
|
||||
selector: 'app-root',
|
||||
template: __webpack_require__(282),
|
||||
styles: [__webpack_require__(261)]
|
||||
styles: [__webpack_require__(260)]
|
||||
}),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1_app_services_info_service__["a" /* InfoService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_app_services_info_service__["a" /* InfoService */]) === "function" && _a || Object])
|
||||
], AppComponent);
|
||||
|
@ -1311,12 +1253,12 @@ var _a;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 202:
|
||||
/***/ 201:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_animations__ = __webpack_require__(199);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_animations__ = __webpack_require__(198);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_material__ = __webpack_require__(119);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppMaterialModule; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
|
@ -1338,22 +1280,26 @@ AppMaterialModule = __decorate([
|
|||
imports: [
|
||||
__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_animations__["a" /* BrowserAnimationsModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["a" /* MdButtonModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["b" /* MdCheckboxModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["c" /* MdCardModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["d" /* MdInputModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["e" /* MdProgressSpinnerModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["f" /* MdTooltipModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["g" /* MdDialogModule */]
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["b" /* MdIconModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["c" /* MdCheckboxModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["d" /* MdCardModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["e" /* MdInputModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["f" /* MdProgressSpinnerModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["g" /* MdTooltipModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["h" /* MdDialogModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["i" /* MdSlideToggleModule */]
|
||||
],
|
||||
exports: [
|
||||
__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_animations__["a" /* BrowserAnimationsModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["a" /* MdButtonModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["b" /* MdCheckboxModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["c" /* MdCardModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["d" /* MdInputModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["e" /* MdProgressSpinnerModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["f" /* MdTooltipModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["g" /* MdDialogModule */]
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["b" /* MdIconModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["c" /* MdCheckboxModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["d" /* MdCardModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["e" /* MdInputModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["f" /* MdProgressSpinnerModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["g" /* MdTooltipModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["h" /* MdDialogModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__angular_material__["i" /* MdSlideToggleModule */]
|
||||
],
|
||||
})
|
||||
], AppMaterialModule);
|
||||
|
@ -1362,20 +1308,21 @@ AppMaterialModule = __decorate([
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 203:
|
||||
/***/ 202:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(22);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_flex_layout__ = __webpack_require__(195);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_flex_layout__ = __webpack_require__(194);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(118);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_http__ = __webpack_require__(69);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_routing__ = __webpack_require__(204);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_app_material_module__ = __webpack_require__(202);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__services_info_service__ = __webpack_require__(70);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_credentials_service__ = __webpack_require__(123);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__app_component__ = __webpack_require__(201);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(117);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_http__ = __webpack_require__(118);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hammerjs__ = __webpack_require__(264);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hammerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_hammerjs__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_routing__ = __webpack_require__(203);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_app_app_material_module__ = __webpack_require__(201);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_info_service__ = __webpack_require__(69);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__app_component__ = __webpack_require__(200);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_dashboard_dashboard_component__ = __webpack_require__(121);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_session_details_session_details_component__ = __webpack_require__(122);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_dashboard_credentials_dialog_component__ = __webpack_require__(120);
|
||||
|
@ -1416,14 +1363,14 @@ AppModule = __decorate([
|
|||
__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__["a" /* BrowserModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormsModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_4__angular_http__["a" /* HttpModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_5__app_routing__["a" /* routing */],
|
||||
__WEBPACK_IMPORTED_MODULE_6_app_app_material_module__["a" /* AppMaterialModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_6__app_routing__["a" /* routing */],
|
||||
__WEBPACK_IMPORTED_MODULE_7_app_app_material_module__["a" /* AppMaterialModule */],
|
||||
__WEBPACK_IMPORTED_MODULE_1__angular_flex_layout__["a" /* FlexLayoutModule */]
|
||||
],
|
||||
entryComponents: [
|
||||
__WEBPACK_IMPORTED_MODULE_12__components_dashboard_credentials_dialog_component__["a" /* CredentialsDialogComponent */],
|
||||
],
|
||||
providers: [__WEBPACK_IMPORTED_MODULE_7__services_info_service__["a" /* InfoService */], __WEBPACK_IMPORTED_MODULE_8__services_credentials_service__["a" /* CredentialsService */]],
|
||||
providers: [__WEBPACK_IMPORTED_MODULE_8__services_info_service__["a" /* InfoService */]],
|
||||
bootstrap: [__WEBPACK_IMPORTED_MODULE_9__app_component__["a" /* AppComponent */]]
|
||||
})
|
||||
], AppModule);
|
||||
|
@ -1432,11 +1379,11 @@ AppModule = __decorate([
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 204:
|
||||
/***/ 203:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_router__ = __webpack_require__(200);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_router__ = __webpack_require__(199);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_components_dashboard_dashboard_component__ = __webpack_require__(121);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_components_session_details_session_details_component__ = __webpack_require__(122);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return routing; });
|
||||
|
@ -1458,7 +1405,7 @@ var routing = __WEBPACK_IMPORTED_MODULE_0__angular_router__["a" /* RouterModule
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 205:
|
||||
/***/ 204:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -1475,7 +1422,7 @@ var environment = {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 261:
|
||||
/***/ 260:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
exports = module.exports = __webpack_require__(37)(false);
|
||||
|
@ -1493,7 +1440,7 @@ module.exports = module.exports.toString();
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 262:
|
||||
/***/ 261:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
exports = module.exports = __webpack_require__(37)(false);
|
||||
|
@ -1511,7 +1458,7 @@ module.exports = module.exports.toString();
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 263:
|
||||
/***/ 262:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
exports = module.exports = __webpack_require__(37)(false);
|
||||
|
@ -1539,7 +1486,7 @@ module.exports = "<main>\n <router-outlet></router-outlet>\n</main>"
|
|||
/***/ 283:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = "<div id=\"dashboard-div\" fxLayout=\"row\" fxLayout.xs=\"column\" fxLayoutGap=\"20px\" fxFlexFill>\n\n <div fxLayout=\"column\" fxFlex=\"66%\" fxFlexOrder=\"1\" fxFlexOrder.xs=\"2\">\n <md-card id=\"log\">\n <md-card-title>Server events</md-card-title>\n <md-divider></md-divider>\n <md-card-content #scrollMe id=\"log-content\">\n <md-list>\n <md-list-item *ngFor=\"let i of info\">\n <p>{{i}}</p>\n </md-list-item>\n </md-list>\n </md-card-content>\n </md-card>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"33%\" fxFlexOrder=\"2\" fxFlexOrder.xs=\"1\">\n <md-card id=\"video-loop\">\n <md-card-title>Test the connection\n <button [class]=\"testStatus == 'DISCONNECTED' ? 'blue' : (testStatus == 'PLAYING' ? 'yellow' : 'disabled')\" md-raised-button (click)=\"toggleTestVideo()\" [disabled]=\"testStatus==='CONNECTING' || testStatus==='CONNECTED'\">{{testButton}}</button></md-card-title>\n <md-card-content #scrollMe id=\"log-content\">\n <div id=\"mirrored-video\">\n <div *ngIf=\"showSpinner\" id=\"loader\">\n <div class=\"loader-1 center\"><span></span></div>\n </div>\n <!--<md-spinner *ngIf=\"showSpinner\" [color]=\"color\"></md-spinner>-->\n <div *ngIf=\"session\" id=\"tick-div\">\n <div id=\"tooltip-tick\" *ngIf=\"testStatus=='PLAYING'\" mdTooltip=\"The connection is successful\" mdTooltipPosition=\"below\"></div>\n <div [class]=\"testStatus=='PLAYING' ? 'trigger drawn' : 'trigger'\"></div>\n <svg version=\"1.1\" id=\"tick\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"-1 -1 39 39\" style=\"enable-background:new 0 0 37 37;\" xml:space=\"preserve\">\n <path class=\"circ path\" style=\"fill:none;stroke:#06d362;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:10;\" d=\"\n\tM30.5,6.5L30.5,6.5c6.6,6.6,6.6,17.4,0,24l0,0c-6.6,6.6-17.4,6.6-24,0l0,0c-6.6-6.6-6.6-17.4,0-24l0,0C13.1-0.2,23.9-0.2,30.5,6.5z\"\n />\n <polyline class=\"tick path\" style=\"fill:none;stroke:#06d362;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\n\t11.6,20 15.9,24.2 26.4,13.8 \" />\n </svg>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </div>\n\n</div>\n"
|
||||
module.exports = "<div id=\"dashboard-div\" fxLayout=\"row\" fxLayout.xs=\"column\" fxLayoutGap=\"20px\" fxFlexFill>\n\n <div fxLayout=\"column\" fxFlex=\"66%\" fxFlexOrder=\"1\" fxFlexOrder.xs=\"2\">\n <md-card id=\"log\">\n <md-card-title>Server events\n <md-slide-toggle title=\"Lock Scroll\" [(ngModel)]=\"lockScroll\" style=\"float: right; margin-left: auto;\">\n <md-icon>lock_outline</md-icon>\n </md-slide-toggle>\n </md-card-title>\n <md-divider></md-divider>\n <md-card-content #scrollMe id=\"log-content\">\n <ul>\n <li *ngFor=\"let i of info\">\n <p>{{i}}</p>\n </li>\n </ul>\n </md-card-content>\n </md-card>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"33%\" fxFlexOrder=\"2\" fxFlexOrder.xs=\"1\">\n <md-card id=\"video-loop\">\n <md-card-title>Test the connection\n <button [class]=\"testStatus == 'DISCONNECTED' ? 'blue' : (testStatus == 'PLAYING' ? 'yellow' : 'disabled')\" md-raised-button\n (click)=\"toggleTestVideo()\" [disabled]=\"testStatus==='CONNECTING' || testStatus==='CONNECTED'\">{{testButton}}</button></md-card-title>\n <md-card-content #scrollMe id=\"log-content\">\n <div id=\"mirrored-video\">\n <div *ngIf=\"showSpinner\" id=\"loader\">\n <div class=\"loader-1 center\"><span></span></div>\n </div>\n <!--<md-spinner *ngIf=\"showSpinner\" [color]=\"color\"></md-spinner>-->\n <div *ngIf=\"session\" id=\"tick-div\">\n <div id=\"tooltip-tick\" *ngIf=\"testStatus=='PLAYING'\" mdTooltip=\"The connection is successful\" mdTooltipPosition=\"below\"></div>\n <div [class]=\"testStatus=='PLAYING' ? 'trigger drawn' : 'trigger'\"></div>\n <svg version=\"1.1\" id=\"tick\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"-1 -1 39 39\" style=\"enable-background:new 0 0 37 37;\" xml:space=\"preserve\">\n <path class=\"circ path\" style=\"fill:none;stroke:#06d362;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:10;\" d=\"\n\tM30.5,6.5L30.5,6.5c6.6,6.6,6.6,17.4,0,24l0,0c-6.6,6.6-17.4,6.6-24,0l0,0c-6.6-6.6-6.6-17.4,0-24l0,0C13.1-0.2,23.9-0.2,30.5,6.5z\"\n />\n <polyline class=\"tick path\" style=\"fill:none;stroke:#06d362;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\n\t11.6,20 15.9,24.2 26.4,13.8 \" />\n </svg>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </div>\n\n</div>\n"
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -1573,9 +1520,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*
|
||||
*/
|
||||
var OpenViduInternal_1 = __webpack_require__(372);
|
||||
var Session_1 = __webpack_require__(170);
|
||||
var Publisher_1 = __webpack_require__(169);
|
||||
var adapter = __webpack_require__(176);
|
||||
var Session_1 = __webpack_require__(169);
|
||||
var Publisher_1 = __webpack_require__(168);
|
||||
var adapter = __webpack_require__(175);
|
||||
if (window) {
|
||||
window["adapter"] = adapter;
|
||||
}
|
||||
|
@ -1664,11 +1611,11 @@ function __export(m) {
|
|||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(__webpack_require__(370));
|
||||
__export(__webpack_require__(170));
|
||||
__export(__webpack_require__(169));
|
||||
__export(__webpack_require__(168));
|
||||
__export(__webpack_require__(170));
|
||||
__export(__webpack_require__(104));
|
||||
__export(__webpack_require__(171));
|
||||
__export(__webpack_require__(105));
|
||||
__export(__webpack_require__(172));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -1696,8 +1643,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*
|
||||
*/
|
||||
var SessionInternal_1 = __webpack_require__(373);
|
||||
var Stream_1 = __webpack_require__(105);
|
||||
var RpcBuilder = __webpack_require__(137);
|
||||
var Stream_1 = __webpack_require__(104);
|
||||
var RpcBuilder = __webpack_require__(136);
|
||||
var OpenViduInternal = (function () {
|
||||
function OpenViduInternal() {
|
||||
this.remoteStreams = [];
|
||||
|
@ -1766,6 +1713,12 @@ var OpenViduInternal = (function () {
|
|||
OpenViduInternal.prototype.setWsUri = function (wsUri) {
|
||||
this.wsUri = wsUri;
|
||||
};
|
||||
OpenViduInternal.prototype.getSecret = function () {
|
||||
return this.secret;
|
||||
};
|
||||
OpenViduInternal.prototype.setSecret = function (secret) {
|
||||
this.secret = secret;
|
||||
};
|
||||
OpenViduInternal.prototype.getOpenViduServerURL = function () {
|
||||
return 'https://' + this.wsUri.split("wss://")[1].split("/room")[0];
|
||||
};
|
||||
|
@ -2020,34 +1973,52 @@ exports.OpenViduInternal = OpenViduInternal;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Connection_1 = __webpack_require__(172);
|
||||
var Connection_1 = __webpack_require__(171);
|
||||
var EventEmitter = __webpack_require__(52);
|
||||
var SECRET_PARAM = '?secret=';
|
||||
var SessionInternal = (function () {
|
||||
function SessionInternal(openVidu, sessionId) {
|
||||
this.openVidu = openVidu;
|
||||
this.sessionId = sessionId;
|
||||
this.ee = new EventEmitter();
|
||||
this.streams = {};
|
||||
this.participants = {};
|
||||
this.participantsSpeaking = [];
|
||||
this.connected = false;
|
||||
this.sessionId = this.getUrlWithoutSecret(sessionId);
|
||||
this.localParticipant = new Connection_1.Connection(this.openVidu, true, this);
|
||||
if (!this.openVidu.getWsUri()) {
|
||||
this.openVidu.setWsUri(this.checkNgrokUri(sessionId));
|
||||
this.processOpenViduUrl(sessionId);
|
||||
}
|
||||
}
|
||||
SessionInternal.prototype.checkNgrokUri = function (sessionId) {
|
||||
sessionId = sessionId.substring(0, sessionId.lastIndexOf('/')) + '/room';
|
||||
if (sessionId.indexOf(".ngrok.io") !== -1) {
|
||||
// OpenVidu server URL referes to a ngrok IP: secure wss protocol and delete port of URL
|
||||
sessionId = sessionId.replace("ws://", "wss://");
|
||||
var regex = /\.ngrok\.io:\d+/;
|
||||
sessionId = sessionId.replace(regex, ".ngrok.io");
|
||||
SessionInternal.prototype.processOpenViduUrl = function (url) {
|
||||
this.openVidu.setSecret(this.getSecretFromUrl(url));
|
||||
this.openVidu.setWsUri(this.getFinalUrl(url));
|
||||
};
|
||||
SessionInternal.prototype.getSecretFromUrl = function (url) {
|
||||
var secret = '';
|
||||
if (url.indexOf(SECRET_PARAM) !== -1) {
|
||||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length);
|
||||
}
|
||||
else if ((sessionId.indexOf("localhost") !== -1) || (sessionId.indexOf("127.0.0.1") != -1)) {
|
||||
return secret;
|
||||
};
|
||||
SessionInternal.prototype.getUrlWithoutSecret = function (url) {
|
||||
if (url.indexOf(SECRET_PARAM) !== -1) {
|
||||
url = url.substring(0, url.lastIndexOf(SECRET_PARAM));
|
||||
}
|
||||
return url;
|
||||
};
|
||||
SessionInternal.prototype.getFinalUrl = 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 sessionId;
|
||||
return url;
|
||||
};
|
||||
/* NEW METHODS */
|
||||
SessionInternal.prototype.connect = function (token, callback) {
|
||||
|
@ -2061,6 +2032,7 @@ var SessionInternal = (function () {
|
|||
token: token,
|
||||
session: _this.sessionId,
|
||||
metadata: _this.options.metadata,
|
||||
secret: _this.openVidu.getSecret(),
|
||||
dataChannels: false
|
||||
};
|
||||
if (_this.localParticipant) {
|
||||
|
@ -2454,12 +2426,12 @@ exports.SessionInternal = SessionInternal;
|
|||
/***/ 389:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(178);
|
||||
module.exports = __webpack_require__(177);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 70:
|
||||
/***/ 69:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,12 @@
|
|||
webpackJsonp([2,4],{
|
||||
|
||||
/***/ 180:
|
||||
/***/ 179:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||
|
||||
// load the styles
|
||||
var content = __webpack_require__(259);
|
||||
var content = __webpack_require__(258);
|
||||
if(typeof content === 'string') content = [[module.i, content, '']];
|
||||
// add the styles to the DOM
|
||||
var update = __webpack_require__(374)(content, {});
|
||||
|
@ -27,7 +27,7 @@ if(false) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 258:
|
||||
/***/ 257:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
exports = module.exports = __webpack_require__(37)(false);
|
||||
|
@ -42,12 +42,12 @@ exports.push([module.i, ".mat-elevation-z0{box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 259:
|
||||
/***/ 258:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
exports = module.exports = __webpack_require__(37)(false);
|
||||
// imports
|
||||
exports.i(__webpack_require__(258), "");
|
||||
exports.i(__webpack_require__(257), "");
|
||||
|
||||
// module
|
||||
exports.push([module.i, "html,\nbody {\n height: 100%;\n margin: 0;\n padding: 0;\n background: #4d4d4d;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);\n}\n\nmain {\n height: 100%;\n}\n\nli {\n list-style: none;\n}\n\nvideo {\n width: 100%;\n}\n\n.mat-spinner path {\n stroke: #4d4d4d;\n}", ""]);
|
||||
|
@ -164,7 +164,7 @@ function toComment(sourceMap) {
|
|||
return '/*# ' + data + ' */';
|
||||
}
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(72).Buffer))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(71).Buffer))
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -424,12 +424,12 @@ function updateLink(linkElement, obj) {
|
|||
/***/ 391:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(180);
|
||||
module.exports = __webpack_require__(179);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 71:
|
||||
/***/ 70:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -551,7 +551,7 @@ function fromByteArray (uint8) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 72:
|
||||
/***/ 71:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -565,9 +565,9 @@ function fromByteArray (uint8) {
|
|||
|
||||
|
||||
|
||||
var base64 = __webpack_require__(71)
|
||||
var ieee754 = __webpack_require__(89)
|
||||
var isArray = __webpack_require__(90)
|
||||
var base64 = __webpack_require__(70)
|
||||
var ieee754 = __webpack_require__(88)
|
||||
var isArray = __webpack_require__(89)
|
||||
|
||||
exports.Buffer = Buffer
|
||||
exports.SlowBuffer = SlowBuffer
|
||||
|
@ -2349,7 +2349,7 @@ function isnan (val) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 89:
|
||||
/***/ 88:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
||||
|
@ -2440,7 +2440,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 90:
|
||||
/***/ 89:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var toString = {}.toString;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue