\\n\"","import { Component, OnInit, OnDestroy, HostListener, ViewEncapsulation, ApplicationRef } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { OpenVidu, Session, Stream, Subscriber, StreamEvent, StreamManagerEvent } from 'openvidu-browser';\n\nimport { OpenViduLayout } from '../openvidu-layout';\n\n@Component({\n selector: 'app-layout-best-fit',\n templateUrl: './layout-best-fit.component.html',\n styleUrls: ['./layout-best-fit.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class LayoutBestFitComponent implements OnInit, OnDestroy {\n\n openviduLayout: OpenViduLayout;\n sessionId: string;\n secret: string;\n\n session: Session;\n subscribers: Subscriber[] = [];\n\n layout: any;\n resizeTimeout;\n numberOfScreenStreams = 0;\n\n layoutOptions = {\n maxRatio: 3 / 2, // The narrowest ratio that will be used (default 2x3)\n minRatio: 9 / 16, // The widest ratio that will be used (default 16x9)\n fixedRatio: false, /* If this is true then the aspect ratio of the video is maintained\n and minRatio and maxRatio are ignored (default false) */\n bigClass: 'OV_big', // The class to add to elements that should be sized bigger\n bigPercentage: 0.8, // The maximum percentage of space the big ones should take up\n bigFixedRatio: false, // fixedRatio for the big ones\n bigMaxRatio: 3 / 2, // The narrowest ratio to use for the big elements (default 2x3)\n bigMinRatio: 9 / 16, // The widest ratio to use for the big elements (default 16x9)\n bigFirst: true, // Whether to place the big one in the top left (true) or bottom right\n animate: true // Whether you want to animate the transitions\n };\n\n constructor(private route: ActivatedRoute, private appRef: ApplicationRef) {\n this.route.params.subscribe(params => {\n this.sessionId = params.sessionId;\n this.secret = params.secret;\n });\n }\n\n @HostListener('window:beforeunload')\n beforeunloadHandler() {\n this.leaveSession();\n }\n\n @HostListener('window:resize', ['$event'])\n sizeChange(event) {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = setTimeout(() => {\n this.openviduLayout.updateLayout();\n }, 20);\n }\n\n ngOnDestroy() {\n this.leaveSession();\n }\n\n ngOnInit() {\n const OV = new OpenVidu();\n this.session = OV.initSession();\n\n this.session.on('streamCreated', (event: StreamEvent) => {\n let changeFixedRatio = false;\n if (event.stream.typeOfVideo === 'SCREEN') {\n this.numberOfScreenStreams++;\n changeFixedRatio = true;\n }\n const subscriber: Subscriber = this.session.subscribe(event.stream, undefined);\n subscriber.on('streamPlaying', (e: StreamManagerEvent) => {\n const video: HTMLVideoElement = subscriber.videos[0].video;\n video.parentElement.parentElement.classList.remove('custom-class');\n this.updateLayout(changeFixedRatio);\n });\n this.addSubscriber(subscriber);\n });\n\n this.session.on('streamDestroyed', (event: StreamEvent) => {\n let changeFixedRatio = false;\n if (event.stream.typeOfVideo === 'SCREEN') {\n this.numberOfScreenStreams--;\n changeFixedRatio = true;\n }\n this.deleteSubscriber(event.stream.streamManager);\n this.updateLayout(changeFixedRatio);\n });\n\n const port = !!location.port ? (':' + location.port) : '';\n const token = 'wss://' + location.hostname + port + '?sessionId=' + this.sessionId + '&secret=' + this.secret + '&recorder=true';\n this.session.connect(token)\n .catch(error => {\n console.error(error);\n })\n\n this.openviduLayout = new OpenViduLayout();\n this.openviduLayout.initLayoutContainer(document.getElementById('layout'), this.layoutOptions);\n }\n\n private addSubscriber(subscriber: Subscriber): void {\n this.subscribers.push(subscriber);\n this.appRef.tick();\n }\n\n private deleteSubscriber(subscriber: Subscriber): void {\n let index = -1;\n for (let i = 0; i < this.subscribers.length; i++) {\n if (this.subscribers[i] === subscriber) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n this.subscribers.splice(index, 1);\n }\n this.appRef.tick();\n }\n\n leaveSession() {\n if (this.session) { this.session.disconnect(); };\n this.subscribers = [];\n this.session = null;\n }\n\n updateLayout(changeFixedRatio: boolean) {\n if (changeFixedRatio) {\n this.layoutOptions.fixedRatio = this.numberOfScreenStreams > 0;\n this.openviduLayout.setLayoutOptions(this.layoutOptions);\n }\n this.openviduLayout.updateLayout();\n }\n\n}\n","declare var $: any;\n\nexport interface OpenViduLayoutOptions {\n maxRatio: number;\n minRatio: number;\n fixedRatio: boolean;\n animate: any;\n bigClass: string;\n bigPercentage: any;\n bigFixedRatio: any;\n bigMaxRatio: any;\n bigMinRatio: any;\n bigFirst: any;\n}\n\nexport class OpenViduLayout {\n\n private layoutContainer: HTMLElement;\n private opts: OpenViduLayoutOptions;\n\n private fixAspectRatio(elem: HTMLVideoElement, width: number) {\n const sub: HTMLVideoElement = elem.querySelector('.OT_root');\n if (sub) {\n // If this is the parent of a subscriber or publisher then we need\n // to force the mutation observer on the publisher or subscriber to\n // trigger to get it to fix it's layout\n const oldWidth = sub.style.width;\n sub.style.width = width + 'px';\n // sub.style.height = height + 'px';\n sub.style.width = oldWidth || '';\n }\n }\n\n private positionElement(elem: HTMLVideoElement, x: number, y: number, width: number, height: number, animate: any) {\n const targetPosition = {\n left: x + 'px',\n top: y + 'px',\n width: width + 'px',\n height: height + 'px'\n };\n\n this.fixAspectRatio(elem, width);\n\n if (animate && $) {\n $(elem).stop();\n $(elem).animate(targetPosition, animate.duration || 200, animate.easing || 'swing',\n () => {\n this.fixAspectRatio(elem, width);\n if (animate.complete) { animate.complete.call(this); }\n });\n } else {\n $(elem).css(targetPosition);\n }\n this.fixAspectRatio(elem, width);\n }\n\n private getVideoRatio(elem: HTMLVideoElement) {\n if (!elem) {\n return 3 / 4;\n }\n const video: HTMLVideoElement = elem.querySelector('video');\n if (video && video.videoHeight && video.videoWidth) {\n return video.videoHeight / video.videoWidth;\n } else if (elem.videoHeight && elem.videoWidth) {\n return elem.videoHeight / elem.videoWidth;\n }\n return 3 / 4;\n }\n\n private getCSSNumber(elem: HTMLElement, prop: string) {\n const cssStr = $(elem).css(prop);\n return cssStr ? parseInt(cssStr, 10) : 0;\n }\n\n // Really cheap UUID function\n private cheapUUID() {\n return (Math.random() * 100000000).toFixed(0);\n }\n\n private getHeight(elem: HTMLElement) {\n const heightStr = $(elem).css('height');\n return heightStr ? parseInt(heightStr, 10) : 0;\n }\n\n private getWidth(elem: HTMLElement) {\n const widthStr = $(elem).css('width');\n return widthStr ? parseInt(widthStr, 10) : 0;\n }\n\n private getBestDimensions(minR: number, maxR: number, count: number, WIDTH: number, HEIGHT: number, targetHeight: number) {\n let maxArea,\n targetCols,\n targetRows,\n targetWidth,\n tWidth,\n tHeight,\n tRatio;\n\n // Iterate through every possible combination of rows and columns\n // and see which one has the least amount of whitespace\n for (let i = 1; i <= count; i++) {\n const colsAux = i;\n const rowsAux = Math.ceil(count / colsAux);\n\n // Try taking up the whole height and width\n tHeight = Math.floor(HEIGHT / rowsAux);\n tWidth = Math.floor(WIDTH / colsAux);\n\n tRatio = tHeight / tWidth;\n if (tRatio > maxR) {\n // We went over decrease the height\n tRatio = maxR;\n tHeight = tWidth * tRatio;\n } else if (tRatio < minR) {\n // We went under decrease the width\n tRatio = minR;\n tWidth = tHeight / tRatio;\n }\n\n const area = (tWidth * tHeight) * count;\n\n // If this width and height takes up the most space then we're going with that\n if (maxArea === undefined || (area > maxArea)) {\n maxArea = area;\n targetHeight = tHeight;\n targetWidth = tWidth;\n targetCols = colsAux;\n targetRows = rowsAux;\n }\n }\n return {\n maxArea: maxArea,\n targetCols: targetCols,\n targetRows: targetRows,\n targetHeight: targetHeight,\n targetWidth: targetWidth,\n ratio: targetHeight / targetWidth\n };\n };\n\n private arrange(children: HTMLVideoElement[], WIDTH: number, HEIGHT: number, offsetLeft: number, offsetTop: number, fixedRatio: boolean,\n minRatio: number, maxRatio: number, animate: any) {\n\n let targetHeight;\n\n const count = children.length;\n let dimensions;\n\n if (!fixedRatio) {\n dimensions = this.getBestDimensions(minRatio, maxRatio, count, WIDTH, HEIGHT, targetHeight);\n } else {\n // Use the ratio of the first video element we find to approximate\n const ratio = this.getVideoRatio(children.length > 0 ? children[0] : null);\n dimensions = this.getBestDimensions(ratio, ratio, count, WIDTH, HEIGHT, targetHeight);\n }\n\n // Loop through each stream in the container and place it inside\n let x = 0,\n y = 0;\n const rows = [];\n let row;\n // Iterate through the children and create an array with a new item for each row\n // and calculate the width of each row so that we know if we go over the size and need\n // to adjust\n for (let i = 0; i < children.length; i++) {\n if (i % dimensions.targetCols === 0) {\n // This is a new row\n row = {\n children: [],\n width: 0,\n height: 0\n };\n rows.push(row);\n }\n const elem: HTMLVideoElement = children[i];\n row.children.push(elem);\n let targetWidth = dimensions.targetWidth;\n targetHeight = dimensions.targetHeight;\n // If we're using a fixedRatio then we need to set the correct ratio for this element\n if (fixedRatio) {\n targetWidth = targetHeight / this.getVideoRatio(elem);\n }\n row.width += targetWidth;\n row.height = targetHeight;\n }\n // Calculate total row height adjusting if we go too wide\n let totalRowHeight = 0;\n let remainingShortRows = 0;\n for (let i = 0; i < rows.length; i++) {\n row = rows[i];\n if (row.width > WIDTH) {\n // Went over on the width, need to adjust the height proportionally\n row.height = Math.floor(row.height * (WIDTH / row.width));\n row.width = WIDTH;\n } else if (row.width < WIDTH) {\n remainingShortRows += 1;\n }\n totalRowHeight += row.height;\n }\n if (totalRowHeight < HEIGHT && remainingShortRows > 0) {\n // We can grow some of the rows, we're not taking up the whole height\n let remainingHeightDiff = HEIGHT - totalRowHeight;\n totalRowHeight = 0;\n for (let i = 0; i < rows.length; i++) {\n row = rows[i];\n if (row.width < WIDTH) {\n // Evenly distribute the extra height between the short rows\n let extraHeight = remainingHeightDiff / remainingShortRows;\n if ((extraHeight / row.height) > ((WIDTH - row.width) / row.width)) {\n // We can't go that big or we'll go too wide\n extraHeight = Math.floor(((WIDTH - row.width) / row.width) * row.height);\n }\n row.width += Math.floor((extraHeight / row.height) * row.width);\n row.height += extraHeight;\n remainingHeightDiff -= extraHeight;\n remainingShortRows -= 1;\n }\n totalRowHeight += row.height;\n }\n }\n // vertical centering\n y = ((HEIGHT - (totalRowHeight)) / 2);\n // Iterate through each row and place each child\n for (let i = 0; i < rows.length; i++) {\n row = rows[i];\n // center the row\n const rowMarginLeft = ((WIDTH - row.width) / 2);\n x = rowMarginLeft;\n for (let j = 0; j < row.children.length; j++) {\n const elem: HTMLVideoElement = row.children[j];\n\n let targetWidth = dimensions.targetWidth;\n targetHeight = row.height;\n // If we're using a fixedRatio then we need to set the correct ratio for this element\n if (fixedRatio) {\n targetWidth = Math.floor(targetHeight / this.getVideoRatio(elem));\n }\n elem.style.position = 'absolute';\n // $(elem).css('position', 'absolute');\n const actualWidth = targetWidth - this.getCSSNumber(elem, 'paddingLeft') -\n this.getCSSNumber(elem, 'paddingRight') -\n this.getCSSNumber(elem, 'marginLeft') -\n this.getCSSNumber(elem, 'marginRight') -\n this.getCSSNumber(elem, 'borderLeft') -\n this.getCSSNumber(elem, 'borderRight');\n\n const actualHeight = targetHeight - this.getCSSNumber(elem, 'paddingTop') -\n this.getCSSNumber(elem, 'paddingBottom') -\n this.getCSSNumber(elem, 'marginTop') -\n this.getCSSNumber(elem, 'marginBottom') -\n this.getCSSNumber(elem, 'borderTop') -\n this.getCSSNumber(elem, 'borderBottom');\n\n this.positionElement(elem, x + offsetLeft, y + offsetTop, actualWidth, actualHeight, animate);\n x += targetWidth;\n }\n y += targetHeight;\n }\n }\n\n private filterDisplayNone(element: HTMLElement) {\n return element.style.display !== 'none';\n }\n\n updateLayout() {\n if (this.layoutContainer.style.display === 'none') {\n return;\n }\n let id = this.layoutContainer.id;\n if (!id) {\n id = 'OT_' + this.cheapUUID();\n this.layoutContainer.id = id;\n }\n\n const HEIGHT = this.getHeight(this.layoutContainer) -\n this.getCSSNumber(this.layoutContainer, 'borderTop') -\n this.getCSSNumber(this.layoutContainer, 'borderBottom');\n const WIDTH = this.getWidth(this.layoutContainer) -\n this.getCSSNumber(this.layoutContainer, 'borderLeft') -\n this.getCSSNumber(this.layoutContainer, 'borderRight');\n\n const availableRatio = HEIGHT / WIDTH;\n\n let offsetLeft = 0;\n let offsetTop = 0;\n let bigOffsetTop = 0;\n let bigOffsetLeft = 0;\n\n const bigOnes = Array.prototype.filter.call(\n this.layoutContainer.querySelectorAll('#' + id + '>.' + this.opts.bigClass),\n this.filterDisplayNone);\n const smallOnes = Array.prototype.filter.call(\n this.layoutContainer.querySelectorAll('#' + id + '>*:not(.' + this.opts.bigClass + ')'),\n this.filterDisplayNone);\n\n if (bigOnes.length > 0 && smallOnes.length > 0) {\n let bigWidth, bigHeight;\n\n if (availableRatio > this.getVideoRatio(bigOnes[0])) {\n // We are tall, going to take up the whole width and arrange small\n // guys at the bottom\n bigWidth = WIDTH;\n bigHeight = Math.floor(HEIGHT * this.opts.bigPercentage);\n offsetTop = bigHeight;\n bigOffsetTop = HEIGHT - offsetTop;\n } else {\n // We are wide, going to take up the whole height and arrange the small\n // guys on the right\n bigHeight = HEIGHT;\n bigWidth = Math.floor(WIDTH * this.opts.bigPercentage);\n offsetLeft = bigWidth;\n bigOffsetLeft = WIDTH - offsetLeft;\n }\n if (this.opts.bigFirst) {\n this.arrange(bigOnes, bigWidth, bigHeight, 0, 0, this.opts.bigFixedRatio, this.opts.bigMinRatio,\n this.opts.bigMaxRatio, this.opts.animate);\n this.arrange(smallOnes, WIDTH - offsetLeft, HEIGHT - offsetTop, offsetLeft, offsetTop,\n this.opts.fixedRatio, this.opts.minRatio, this.opts.maxRatio, this.opts.animate);\n } else {\n this.arrange(smallOnes, WIDTH - offsetLeft, HEIGHT - offsetTop, 0, 0, this.opts.fixedRatio,\n this.opts.minRatio, this.opts.maxRatio, this.opts.animate);\n this.arrange(bigOnes, bigWidth, bigHeight, bigOffsetLeft, bigOffsetTop,\n this.opts.bigFixedRatio, this.opts.bigMinRatio, this.opts.bigMaxRatio, this.opts.animate);\n }\n } else if (bigOnes.length > 0 && smallOnes.length === 0) {\n this.\n // We only have one bigOne just center it\n arrange(bigOnes, WIDTH, HEIGHT, 0, 0, this.opts.bigFixedRatio, this.opts.bigMinRatio,\n this.opts.bigMaxRatio, this.opts.animate);\n } else {\n this.arrange(smallOnes, WIDTH - offsetLeft, HEIGHT - offsetTop, offsetLeft, offsetTop,\n this.opts.fixedRatio, this.opts.minRatio, this.opts.maxRatio, this.opts.animate);\n }\n }\n\n initLayoutContainer(container, opts) {\n this.opts = {\n maxRatio: (opts.maxRatio != null) ? opts.maxRatio : 3 / 2,\n minRatio: (opts.minRatio != null) ? opts.minRatio : 9 / 16,\n fixedRatio: (opts.fixedRatio != null) ? opts.fixedRatio : false,\n animate: (opts.animate != null) ? opts.animate : false,\n bigClass: (opts.bigClass != null) ? opts.bigClass : 'OT_big',\n bigPercentage: (opts.bigPercentage != null) ? opts.bigPercentage : 0.8,\n bigFixedRatio: (opts.bigFixedRatio != null) ? opts.bigFixedRatio : false,\n bigMaxRatio: (opts.bigMaxRatio != null) ? opts.bigMaxRatio : 3 / 2,\n bigMinRatio: (opts.bigMinRatio != null) ? opts.bigMinRatio : 9 / 16,\n bigFirst: (opts.bigFirst != null) ? opts.bigFirst : true\n };\n this.layoutContainer = typeof (container) === 'string' ? $(container) : container;\n }\n\n setLayoutOptions(options: OpenViduLayoutOptions) {\n this.opts = options;\n }\n\n}\n\n","import { Component, Input, ViewChild, ElementRef, AfterViewInit } from '@angular/core';\nimport { Subscriber } from 'openvidu-browser';\n\n@Component({\n selector: 'app-ov-video',\n template: ''\n})\nexport class OpenViduVideoComponent implements AfterViewInit {\n\n @ViewChild('videoElement') elementRef: ElementRef;\n\n _subscriber: Subscriber;\n\n ngAfterViewInit() {\n this._subscriber.addVideoElement(this.elementRef.nativeElement);\n }\n\n @Input()\n set subscriber(subscriber: Subscriber) {\n this._subscriber = subscriber;\n if (!!this.elementRef) {\n this._subscriber.addVideoElement(this.elementRef.nativeElement);\n }\n }\n\n}\n","module.exports = \"\"","module.exports = \"
\\n session-details works!\\n
\\n\"","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-session-details',\n templateUrl: './session-details.component.html',\n styleUrls: ['./session-details.component.css']\n})\nexport class SessionDetailsComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable()\nexport class InfoService {\n\n info: string;\n newInfo$: Subject;\n\n constructor() {\n this.newInfo$ = new Subject();\n }\n\n getInfo() {\n return this.info;\n }\n\n updateInfo(info: string) {\n this.info = info;\n this.newInfo$.next(info);\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable()\nexport class RestService {\n\n private openviduPublicUrl: string;\n\n getOpenViduPublicUrl(): Promise {\n return new Promise((resolve, reject) => {\n if (!!this.openviduPublicUrl) {\n resolve(this.openviduPublicUrl);\n } else {\n const url = location.protocol + '//' + location.hostname + ((!!location.port) ? (':' + location.port) : '') +\n '/config/openvidu-publicurl';\n const http = new XMLHttpRequest();\n\n http.onreadystatechange = () => {\n if (http.readyState === 4) {\n if (http.status === 200) {\n this.openviduPublicUrl = http.responseText;\n resolve(http.responseText);\n } else {\n reject('Error getting OpenVidu publicurl');\n }\n };\n }\n http.open('GET', url, true);\n http.send();\n }\n });\n }\n\n}\n","// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\n\nexport const environment = {\n production: false\n};\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/Connection.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/LocalRecorder.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/OpenVidu.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/Publisher.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/Session.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/Stream.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/StreamManager.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenVidu/Subscriber.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Enums/LocalRecorderState.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Enums/OpenViduError.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Enums/VideoInsertMode.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/ConnectionEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/Event.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/PublisherSpeakingEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/RecordingEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/SessionDisconnectedEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/SignalEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/StreamEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/StreamManagerEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/StreamPropertyChangedEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/Events/VideoElementEvent.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/Mapper.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/index.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/index.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/index.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/packers/JsonRPC.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/packers/XmlRPC.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/packers/index.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/ScreenSharing/Screen-Capturing-Auto.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/ScreenSharing/Screen-Capturing.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/WebRtcPeer/WebRtcPeer.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/OpenViduInternal/WebRtcStats/WebRtcStats.js","webpack:////home/pablo/Documents/Git/openvidu/openvidu-browser/lib/index.js","webpack:///./src/$_lazy_route_resource lazy namespace object","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.material.module.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/app.routing.ts","webpack:///./src/app/components/dashboard/credentials-dialog.component.ts","webpack:///./src/app/components/dashboard/dashboard.component.css","webpack:///./src/app/components/dashboard/dashboard.component.html","webpack:///./src/app/components/dashboard/dashboard.component.ts","webpack:///./src/app/components/layouts/layout-best-fit/layout-best-fit.component.css","webpack:///./src/app/components/layouts/layout-best-fit/layout-best-fit.component.html","webpack:///./src/app/components/layouts/layout-best-fit/layout-best-fit.component.ts","webpack:///./src/app/components/layouts/openvidu-layout.ts","webpack:///./src/app/components/layouts/ov-video.component.ts","webpack:///./src/app/components/session-details/session-details.component.css","webpack:///./src/app/components/session-details/session-details.component.html","webpack:///./src/app/components/session-details/session-details.component.ts","webpack:///./src/app/services/info.service.ts","webpack:///./src/app/services/rest.service.ts","webpack:///./src/environments/environment.ts","webpack:///./src/main.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,sC;;;;;;;;;;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE,mCAAmC,uBAAuB;AAC1D;AACA,uEAAuE;AACvE,mCAAmC,uBAAuB;AAC1D;AACA,uEAAuE;AACvE,mCAAmC,uBAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY,EAAE,wBAAwB,YAAY,EAAE;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,2CAA2C,qBAAqB;AAChE;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,yC;;;;;;;;;;;;ACtUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,uNAAuN,qCAAqC;AAC5P,+MAA+M,qCAAqC;AACpP;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qCAAqC;AACrC,oCAAoC;AACpC,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,oC;;;;;;;;;;;;ACzkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sIAAsI,sDAAsD,EAAE;AAC9L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,qC;;;;;;;;;;;;ACxeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,oDAAoD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,mC;;;;;;;;;;;;ACx2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB,EAAE,6BAA6B,sBAAsB,EAAE;AACxH,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,kC;;;;;;;;;;;;ACncA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,QAAQ;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,yC;;;;;;;;;;;;ACtWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,sC;;;;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qFAAqF;AACtF,8C;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kFAAkF;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,yC;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4EAA4E;AAC7E,2C;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA,CAAC;AACD;AACA,2C;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,CAAC;AACD;AACA,iC;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA,CAAC;AACD;AACA,kD;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA,CAAC;AACD;AACA,0C;;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,oD;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA,CAAC;AACD;AACA,uC;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,+BAA+B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,QAAQ;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,uC;;;;;;;;;;;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA,CAAC;AACD;AACA,8C;;;;;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA,CAAC;AACD;AACA,sD;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA,CAAC;AACD;AACA,6C;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;;;;;AC5CA;AACA;AACA,iC;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;;;;;;AChMA;AACA;AACA,iC;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qD;;;;;;;;;;;ACrKA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kCAAkC;AACjF,+CAA+C,kCAAkC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,eAAe;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iC;;;;;;;;;;;ACleA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mC;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA,iC;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iD;;;;;;;;;;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4C;;;;;;;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,4CAA4C;AACrF;AACA;AACA;AACA;AACA,iDAAiD,iCAAiC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,6BAA6B,sBAAsB,EAAE;AAClE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,6BAA6B,sBAAsB,EAAE;AAClE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,kBAAkB,EAAE,6BAA6B,sBAAsB,EAAE;AAC7I,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,kBAAkB,EAAE,6BAA6B,sBAAsB,EAAE;AAC1J;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,sC;;;;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yDAAyD,gBAAgB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,oBAAoB,EAAE;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,a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,CAAC;wBAC/C,CAAC;oBACL,CAAC;oBAAA,CAAC;gBACN,CAAC;gBACD,MAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAC5B,MAAI,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IA3BQ,WAAW;QADvB,gEAAU,EAAE;OACA,WAAW,CA6BvB;IAAD,kBAAC;CAAA;AA7BuB;;;;;;;;;;;;;;ACJxB;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,gFAAgF;AAEzE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;;;;;;;;;;;ACP6C;AAC4B;AAE9B;AACY;AAEzD,EAAE,CAAC,CAAC,qEAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3B,oEAAc,EAAE,CAAC;AACnB,CAAC;AAED,gGAAsB,EAAE,CAAC,eAAe,CAAC,yDAAS,CAAC,CAAC","file":"main.js","sourcesContent":["\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar Stream_1 = require(\"./Stream\");\n/**\n * Represents each one of the user's connection to the session (the local one and other user's connections).\n * Therefore each [[Session]] and [[Stream]] object has an attribute of type Connection\n */\nvar Connection = /** @class */ (function () {\n /**\n * @hidden\n */\n function Connection(session, opts) {\n this.session = session;\n /**\n * @hidden\n */\n this.disposed = false;\n var msg = \"'Connection' created \";\n if (!!opts) {\n msg += \"(remote) with 'connectionId' [\" + opts.id + ']';\n }\n else {\n msg += '(local)';\n }\n console.info(msg);\n this.options = opts;\n if (!!opts) {\n // Connection is remote\n this.connectionId = opts.id;\n if (opts.metadata) {\n this.data = opts.metadata;\n }\n if (opts.streams) {\n this.initRemoteStreams(opts.streams);\n }\n }\n this.creationTime = new Date().getTime();\n }\n /* Hidden methods */\n /**\n * @hidden\n */\n Connection.prototype.sendIceCandidate = function (candidate) {\n console.debug((!!this.stream.outboundStreamOpts ? 'Local' : 'Remote'), 'candidate for', this.connectionId, JSON.stringify(candidate));\n this.session.openvidu.sendRequest('onIceCandidate', {\n endpointName: this.connectionId,\n candidate: candidate.candidate,\n sdpMid: candidate.sdpMid,\n sdpMLineIndex: candidate.sdpMLineIndex\n }, function (error, response) {\n if (error) {\n console.error('Error sending ICE candidate: '\n + JSON.stringify(error));\n }\n });\n };\n /**\n * @hidden\n */\n Connection.prototype.initRemoteStreams = function (options) {\n var _this = this;\n // This is ready for supporting multiple streams per Connection object. Right now the loop will always run just once\n // this.stream should also be replaced by a collection of streams to support multiple streams per Connection\n options.forEach(function (opts) {\n var streamOptions = {\n id: opts.id,\n connection: _this,\n hasAudio: opts.hasAudio,\n hasVideo: opts.hasVideo,\n audioActive: opts.audioActive,\n videoActive: opts.videoActive,\n typeOfVideo: opts.typeOfVideo,\n frameRate: opts.frameRate,\n videoDimensions: !!opts.videoDimensions ? JSON.parse(opts.videoDimensions) : undefined\n };\n var stream = new Stream_1.Stream(_this.session, streamOptions);\n _this.addStream(stream);\n });\n console.info(\"Remote 'Connection' with 'connectionId' [\" + this.connectionId + '] is now configured for receiving Streams with options: ', this.stream.inboundStreamOpts);\n };\n /**\n * @hidden\n */\n Connection.prototype.addStream = function (stream) {\n stream.connection = this;\n this.stream = stream;\n };\n /**\n * @hidden\n */\n Connection.prototype.removeStream = function (streamId) {\n delete this.stream;\n };\n /**\n * @hidden\n */\n Connection.prototype.dispose = function () {\n if (!!this.stream) {\n delete this.stream;\n }\n this.disposed = true;\n };\n return Connection;\n}());\nexports.Connection = Connection;\n//# sourceMappingURL=Connection.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar LocalRecorderState_1 = require(\"../OpenViduInternal/Enums/LocalRecorderState\");\n/**\n * Easy recording of [[Stream]] objects straightaway from the browser.\n *\n * > WARNING: Performing browser local recording of **remote streams** may cause some troubles. A long waiting time may be required after calling _LocalRecorder.stop()_ in this case\n */\nvar LocalRecorder = /** @class */ (function () {\n /**\n * @hidden\n */\n function LocalRecorder(stream) {\n this.stream = stream;\n this.chunks = [];\n this.count = 0;\n this.connectionId = (!!this.stream.connection) ? this.stream.connection.connectionId : 'default-connection';\n this.id = this.stream.streamId + '_' + this.connectionId + '_localrecord';\n this.state = LocalRecorderState_1.LocalRecorderState.READY;\n }\n /**\n * Starts the recording of the Stream. [[state]] property must be `READY`. After method succeeds is set to `RECORDING`\n * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully started and rejected with an Error object if not\n */\n LocalRecorder.prototype.record = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n if (typeof MediaRecorder === 'undefined') {\n console.error('MediaRecorder not supported on your browser. See compatibility in https://caniuse.com/#search=MediaRecorder');\n throw (Error('MediaRecorder not supported on your browser. See compatibility in https://caniuse.com/#search=MediaRecorder'));\n }\n if (_this.state !== LocalRecorderState_1.LocalRecorderState.READY) {\n throw (Error('\\'LocalRecord.record()\\' needs \\'LocalRecord.state\\' to be \\'READY\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.clean()\\' or init a new LocalRecorder before'));\n }\n console.log(\"Starting local recording of stream '\" + _this.stream.streamId + \"' of connection '\" + _this.connectionId + \"'\");\n if (typeof MediaRecorder.isTypeSupported === 'function') {\n var options = void 0;\n if (MediaRecorder.isTypeSupported('video/webm;codecs=vp9')) {\n options = { mimeType: 'video/webm;codecs=vp9' };\n }\n else if (MediaRecorder.isTypeSupported('video/webm;codecs=h264')) {\n options = { mimeType: 'video/webm;codecs=h264' };\n }\n else if (MediaRecorder.isTypeSupported('video/webm;codecs=vp8')) {\n options = { mimeType: 'video/webm;codecs=vp8' };\n }\n console.log('Using mimeType ' + options.mimeType);\n _this.mediaRecorder = new MediaRecorder(_this.stream.getMediaStream(), options);\n }\n else {\n console.warn('isTypeSupported is not supported, using default codecs for browser');\n _this.mediaRecorder = new MediaRecorder(_this.stream.getMediaStream());\n }\n _this.mediaRecorder.start(10);\n }\n catch (err) {\n reject(err);\n }\n _this.mediaRecorder.ondataavailable = function (e) {\n _this.chunks.push(e.data);\n };\n _this.mediaRecorder.onerror = function (e) {\n console.error('MediaRecorder error: ', e);\n };\n _this.mediaRecorder.onstart = function () {\n console.log('MediaRecorder started (state=' + _this.mediaRecorder.state + ')');\n };\n _this.mediaRecorder.onstop = function () {\n _this.onStopDefault();\n };\n _this.mediaRecorder.onpause = function () {\n console.log('MediaRecorder paused (state=' + _this.mediaRecorder.state + ')');\n };\n _this.mediaRecorder.onresume = function () {\n console.log('MediaRecorder resumed (state=' + _this.mediaRecorder.state + ')');\n };\n _this.mediaRecorder.onwarning = function (e) {\n console.log('MediaRecorder warning: ' + e);\n };\n _this.state = LocalRecorderState_1.LocalRecorderState.RECORDING;\n resolve();\n });\n };\n /**\n * Ends the recording of the Stream. [[state]] property must be `RECORDING` or `PAUSED`. After method succeeds is set to `FINISHED`\n * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully stopped and rejected with an Error object if not\n */\n LocalRecorder.prototype.stop = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n if (_this.state === LocalRecorderState_1.LocalRecorderState.READY || _this.state === LocalRecorderState_1.LocalRecorderState.FINISHED) {\n throw (Error('\\'LocalRecord.stop()\\' needs \\'LocalRecord.state\\' to be \\'RECORDING\\' or \\'PAUSED\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.start()\\' before'));\n }\n _this.mediaRecorder.onstop = function () {\n _this.onStopDefault();\n resolve();\n };\n _this.mediaRecorder.stop();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n /**\n * Pauses the recording of the Stream. [[state]] property must be `RECORDING`. After method succeeds is set to `PAUSED`\n * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully paused and rejected with an Error object if not\n */\n LocalRecorder.prototype.pause = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n if (_this.state !== LocalRecorderState_1.LocalRecorderState.RECORDING) {\n reject(Error('\\'LocalRecord.pause()\\' needs \\'LocalRecord.state\\' to be \\'RECORDING\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.start()\\' or \\'LocalRecorder.resume()\\' before'));\n }\n _this.mediaRecorder.pause();\n _this.state = LocalRecorderState_1.LocalRecorderState.PAUSED;\n }\n catch (error) {\n reject(error);\n }\n });\n };\n /**\n * Resumes the recording of the Stream. [[state]] property must be `PAUSED`. After method succeeds is set to `RECORDING`\n * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully resumed and rejected with an Error object if not\n */\n LocalRecorder.prototype.resume = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n if (_this.state !== LocalRecorderState_1.LocalRecorderState.PAUSED) {\n throw (Error('\\'LocalRecord.resume()\\' needs \\'LocalRecord.state\\' to be \\'PAUSED\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.pause()\\' before'));\n }\n _this.mediaRecorder.resume();\n _this.state = LocalRecorderState_1.LocalRecorderState.RECORDING;\n }\n catch (error) {\n reject(error);\n }\n });\n };\n /**\n * Previews the recording, appending a new HTMLVideoElement to element with id `parentId`. [[state]] property must be `FINISHED`\n */\n LocalRecorder.prototype.preview = function (parentElement) {\n if (this.state !== LocalRecorderState_1.LocalRecorderState.FINISHED) {\n throw (Error('\\'LocalRecord.preview()\\' needs \\'LocalRecord.state\\' to be \\'FINISHED\\' (current value: \\'' + this.state + '\\'). Call \\'LocalRecorder.stop()\\' before'));\n }\n this.videoPreview = document.createElement('video');\n this.videoPreview.id = this.id;\n this.videoPreview.autoplay = true;\n if (typeof parentElement === 'string') {\n this.htmlParentElementId = parentElement;\n var parentElementDom = document.getElementById(parentElement);\n if (parentElementDom) {\n this.videoPreview = parentElementDom.appendChild(this.videoPreview);\n }\n }\n else {\n this.htmlParentElementId = parentElement.id;\n this.videoPreview = parentElement.appendChild(this.videoPreview);\n }\n this.videoPreview.src = this.videoPreviewSrc;\n return this.videoPreview;\n };\n /**\n * Gracefully stops and cleans the current recording (WARNING: it is completely dismissed). Sets [[state]] to `READY` so the recording can start again\n */\n LocalRecorder.prototype.clean = function () {\n var _this = this;\n var f = function () {\n delete _this.blob;\n _this.chunks = [];\n _this.count = 0;\n delete _this.mediaRecorder;\n _this.state = LocalRecorderState_1.LocalRecorderState.READY;\n };\n if (this.state === LocalRecorderState_1.LocalRecorderState.RECORDING || this.state === LocalRecorderState_1.LocalRecorderState.PAUSED) {\n this.stop().then(function () { return f(); })[\"catch\"](function () { return f(); });\n }\n else {\n f();\n }\n };\n /**\n * Downloads the recorded video through the browser. [[state]] property must be `FINISHED`\n */\n LocalRecorder.prototype.download = function () {\n if (this.state !== LocalRecorderState_1.LocalRecorderState.FINISHED) {\n throw (Error('\\'LocalRecord.download()\\' needs \\'LocalRecord.state\\' to be \\'FINISHED\\' (current value: \\'' + this.state + '\\'). Call \\'LocalRecorder.stop()\\' before'));\n }\n else {\n var a = document.createElement('a');\n a.style.display = 'none';\n document.body.appendChild(a);\n var url = window.URL.createObjectURL(this.blob);\n a.href = url;\n a.download = this.id + '.webm';\n a.click();\n window.URL.revokeObjectURL(url);\n document.body.removeChild(a);\n }\n };\n /**\n * Gets the raw Blob file. Methods preview, download, uploadAsBinary and uploadAsMultipartfile use this same file to perform their specific actions. [[state]] property must be `FINISHED`\n */\n LocalRecorder.prototype.getBlob = function () {\n if (this.state !== LocalRecorderState_1.LocalRecorderState.FINISHED) {\n throw (Error('Call \\'LocalRecord.stop()\\' before getting Blob file'));\n }\n else {\n return this.blob;\n }\n };\n /**\n * Uploads the recorded video as a binary file performing an HTTP/POST operation to URL `endpoint`. [[state]] property must be `FINISHED`. Optional HTTP headers can be passed as second parameter. For example:\n * ```\n * var headers = {\n * \"Cookie\": \"$Version=1; Skin=new;\",\n * \"Authorization\":\"Basic QWxhZGpbjpuIHNlctZQ==\"\n * }\n * ```\n * @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not\n */\n LocalRecorder.prototype.uploadAsBinary = function (endpoint, headers) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.state !== LocalRecorderState_1.LocalRecorderState.FINISHED) {\n reject(Error('\\'LocalRecord.uploadAsBinary()\\' needs \\'LocalRecord.state\\' to be \\'FINISHED\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.stop()\\' before'));\n }\n else {\n var http_1 = new XMLHttpRequest();\n http_1.open('POST', endpoint, true);\n if (typeof headers === 'object') {\n for (var _i = 0, _a = Object.keys(headers); _i < _a.length; _i++) {\n var key = _a[_i];\n http_1.setRequestHeader(key, headers[key]);\n }\n }\n http_1.onreadystatechange = function () {\n if (http_1.readyState === 4) {\n if (http_1.status.toString().charAt(0) === '2') {\n // Success response from server (HTTP status standard: 2XX is success)\n resolve(http_1.responseText);\n }\n else {\n reject(http_1.status);\n }\n }\n };\n http_1.send(_this.blob);\n }\n });\n };\n /**\n * Uploads the recorded video as a multipart file performing an HTTP/POST operation to URL `endpoint`. [[state]] property must be `FINISHED`. Optional HTTP headers can be passed as second parameter. For example:\n * ```\n * var headers = {\n * \"Cookie\": \"$Version=1; Skin=new;\",\n * \"Authorization\":\"Basic QWxhZGpbjpuIHNlctZQ==\"\n * }\n * ```\n * @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not:\n */\n LocalRecorder.prototype.uploadAsMultipartfile = function (endpoint, headers) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.state !== LocalRecorderState_1.LocalRecorderState.FINISHED) {\n reject(Error('\\'LocalRecord.uploadAsMultipartfile()\\' needs \\'LocalRecord.state\\' to be \\'FINISHED\\' (current value: \\'' + _this.state + '\\'). Call \\'LocalRecorder.stop()\\' before'));\n }\n else {\n var http_2 = new XMLHttpRequest();\n http_2.open('POST', endpoint, true);\n if (typeof headers === 'object') {\n for (var _i = 0, _a = Object.keys(headers); _i < _a.length; _i++) {\n var key = _a[_i];\n http_2.setRequestHeader(key, headers[key]);\n }\n }\n var sendable = new FormData();\n sendable.append('file', _this.blob, _this.id + '.webm');\n http_2.onreadystatechange = function () {\n if (http_2.readyState === 4) {\n if (http_2.status.toString().charAt(0) === '2') {\n // Success response from server (HTTP status standard: 2XX is success)\n resolve(http_2.responseText);\n }\n else {\n reject(http_2.status);\n }\n }\n };\n http_2.send(sendable);\n }\n });\n };\n /* Private methods */\n LocalRecorder.prototype.onStopDefault = function () {\n console.log('MediaRecorder stopped (state=' + this.mediaRecorder.state + ')');\n this.blob = new Blob(this.chunks, { type: 'video/webm' });\n this.chunks = [];\n this.videoPreviewSrc = window.URL.createObjectURL(this.blob);\n this.state = LocalRecorderState_1.LocalRecorderState.FINISHED;\n };\n return LocalRecorder;\n}());\nexports.LocalRecorder = LocalRecorder;\n//# sourceMappingURL=LocalRecorder.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar LocalRecorder_1 = require(\"./LocalRecorder\");\nvar Publisher_1 = require(\"./Publisher\");\nvar Session_1 = require(\"./Session\");\nvar StreamPropertyChangedEvent_1 = require(\"../OpenViduInternal/Events/StreamPropertyChangedEvent\");\nvar OpenViduError_1 = require(\"../OpenViduInternal/Enums/OpenViduError\");\nvar VideoInsertMode_1 = require(\"../OpenViduInternal/Enums/VideoInsertMode\");\nvar screenSharingAuto = require(\"../OpenViduInternal/ScreenSharing/Screen-Capturing-Auto\");\nvar screenSharing = require(\"../OpenViduInternal/ScreenSharing/Screen-Capturing\");\nvar RpcBuilder = require(\"../OpenViduInternal/KurentoUtils/kurento-jsonrpc\");\nvar platform = require(\"platform\");\n/**\n * Entrypoint of OpenVidu Browser library.\n * Use it to initialize objects of type [[Session]], [[Publisher]] and [[LocalRecorder]]\n */\nvar OpenVidu = /** @class */ (function () {\n function OpenVidu() {\n var _this = this;\n /**\n * @hidden\n */\n this.publishers = [];\n /**\n * @hidden\n */\n this.secret = '';\n /**\n * @hidden\n */\n this.recorder = false;\n /**\n * @hidden\n */\n this.advancedConfiguration = {};\n console.info(\"'OpenVidu' initialized\");\n if (platform.name.toLowerCase().indexOf('mobile') !== -1) {\n // Listen to orientationchange only on mobile browsers\n window.onorientationchange = function () {\n _this.publishers.forEach(function (publisher) {\n if (!!publisher.stream && !!publisher.stream.hasVideo && !!publisher.stream.streamManager.videos[0]) {\n var attempts_1 = 0;\n var oldWidth_1 = publisher.stream.videoDimensions.width;\n var oldHeight_1 = publisher.stream.videoDimensions.height;\n // New resolution got from different places for Chrome and Firefox. Chrome needs a videoWidth and videoHeight of a videoElement.\n // Firefox needs getSettings from the videoTrack\n var firefoxSettings_1 = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings();\n var newWidth_1 = (platform.name.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings_1.width : publisher.videoReference.videoWidth;\n var newHeight_1 = (platform.name.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings_1.height : publisher.videoReference.videoHeight;\n var repeatUntilChange_1 = setInterval(function () {\n firefoxSettings_1 = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings();\n newWidth_1 = (platform.name.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings_1.width : publisher.videoReference.videoWidth;\n newHeight_1 = (platform.name.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings_1.height : publisher.videoReference.videoHeight;\n sendStreamPropertyChangedEvent_1(oldWidth_1, oldHeight_1, newWidth_1, newHeight_1);\n }, 100);\n var sendStreamPropertyChangedEvent_1 = function (oldWidth, oldHeight, newWidth, newHeight) {\n attempts_1++;\n if (attempts_1 > 4) {\n clearTimeout(repeatUntilChange_1);\n }\n if (newWidth !== oldWidth || newHeight !== oldHeight) {\n publisher.stream.videoDimensions = {\n width: newWidth || 0,\n height: newHeight || 0\n };\n var newValue_1 = JSON.stringify(publisher.stream.videoDimensions);\n _this.sendRequest('streamPropertyChanged', {\n streamId: publisher.stream.streamId,\n property: 'videoDimensions',\n newValue: newValue_1,\n reason: 'deviceRotated'\n }, function (error, response) {\n if (error) {\n console.error(\"Error sending 'streamPropertyChanged' event\", error);\n }\n else {\n _this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this.session, publisher.stream, 'videoDimensions', newValue_1, { width: oldWidth, height: oldHeight }, 'deviceRotated')]);\n publisher.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(publisher, publisher.stream, 'videoDimensions', newValue_1, { width: oldWidth, height: oldHeight }, 'deviceRotated')]);\n }\n });\n clearTimeout(repeatUntilChange_1);\n }\n };\n }\n });\n };\n }\n }\n /**\n * Returns new session\n */\n OpenVidu.prototype.initSession = function () {\n this.session = new Session_1.Session(this);\n return this.session;\n };\n /**\n * Returns a new publisher\n *\n * #### Events dispatched\n *\n * The [[Publisher]] object will dispatch an `accessDialogOpened` event, only if the pop-up shown by the browser to request permissions for the camera is opened. You can use this event to alert the user about granting permissions\n * for your website. An `accessDialogClosed` event will also be dispatched after user clicks on \"Allow\" or \"Block\" in the pop-up.\n *\n * The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not.\n *\n * The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (only if you\n * [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.\n *\n * The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing. See [[StreamManagerEvent]] to learn more.\n *\n * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Publisher.\n * You can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)\n * @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails.\n * `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event\n */\n OpenVidu.prototype.initPublisher = function (targetElement, param2, param3) {\n var properties;\n if (!!param2 && (typeof param2 !== 'function')) {\n // Matches 'initPublisher(targetElement, properties)' or 'initPublisher(targetElement, properties, completionHandler)'\n properties = param2;\n properties = {\n audioSource: (typeof properties.audioSource !== 'undefined') ? properties.audioSource : undefined,\n frameRate: this.isMediaStreamTrack(properties.videoSource) ? undefined : ((typeof properties.frameRate !== 'undefined') ? properties.frameRate : undefined),\n insertMode: (typeof properties.insertMode !== 'undefined') ? ((typeof properties.insertMode === 'string') ? VideoInsertMode_1.VideoInsertMode[properties.insertMode] : properties.insertMode) : VideoInsertMode_1.VideoInsertMode.APPEND,\n mirror: (typeof properties.mirror !== 'undefined') ? properties.mirror : true,\n publishAudio: (typeof properties.publishAudio !== 'undefined') ? properties.publishAudio : true,\n publishVideo: (typeof properties.publishVideo !== 'undefined') ? properties.publishVideo : true,\n resolution: this.isMediaStreamTrack(properties.videoSource) ? undefined : ((typeof properties.resolution !== 'undefined') ? properties.resolution : '640x480'),\n videoSource: (typeof properties.videoSource !== 'undefined') ? properties.videoSource : undefined\n };\n }\n else {\n // Matches 'initPublisher(targetElement)' or 'initPublisher(targetElement, completionHandler)'\n properties = {\n insertMode: VideoInsertMode_1.VideoInsertMode.APPEND,\n mirror: true,\n publishAudio: true,\n publishVideo: true,\n resolution: '640x480'\n };\n }\n var publisher = new Publisher_1.Publisher(targetElement, properties, this);\n var completionHandler;\n if (!!param2 && (typeof param2 === 'function')) {\n completionHandler = param2;\n }\n else if (!!param3) {\n completionHandler = param3;\n }\n publisher.initialize()\n .then(function () {\n if (completionHandler !== undefined) {\n completionHandler(undefined);\n }\n publisher.emitEvent('accessAllowed', []);\n })[\"catch\"](function (error) {\n if (completionHandler !== undefined) {\n completionHandler(error);\n }\n publisher.emitEvent('accessDenied', []);\n });\n this.publishers.push(publisher);\n return publisher;\n };\n OpenVidu.prototype.initPublisherAsync = function (targetElement, properties) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var publisher;\n var callback = function (error) {\n if (!!error) {\n reject(error);\n }\n else {\n resolve(publisher);\n }\n };\n if (!!properties) {\n publisher = _this.initPublisher(targetElement, properties, callback);\n }\n else {\n publisher = _this.initPublisher(targetElement, callback);\n }\n });\n };\n /**\n * Returns a new local recorder for recording streams straight away from the browser\n * @param stream Stream to record\n */\n OpenVidu.prototype.initLocalRecorder = function (stream) {\n return new LocalRecorder_1.LocalRecorder(stream);\n };\n /**\n * Checks if the browser supports OpenVidu\n * @returns 1 if the browser supports OpenVidu, 0 otherwise\n */\n OpenVidu.prototype.checkSystemRequirements = function () {\n var browser = platform.name;\n var version = platform.version;\n if ((browser !== 'Chrome') && (browser !== 'Chrome Mobile') &&\n (browser !== 'Firefox') && (browser !== 'Firefox Mobile') && (browser !== 'Firefox for iOS') &&\n (browser !== 'Opera') && (browser !== 'Opera Mobile') &&\n (browser !== 'Safari')) {\n return 0;\n }\n else {\n return 1;\n }\n };\n /**\n * Collects information about the media input devices available on the system. You can pass property `deviceId` of a [[Device]] object as value of `audioSource` or `videoSource` properties in [[initPublisher]] method\n */\n OpenVidu.prototype.getDevices = function () {\n return new Promise(function (resolve, reject) {\n navigator.mediaDevices.enumerateDevices().then(function (deviceInfos) {\n var devices = [];\n deviceInfos.forEach(function (deviceInfo) {\n if (deviceInfo.kind === 'audioinput' || deviceInfo.kind === 'videoinput') {\n devices.push({\n kind: deviceInfo.kind,\n deviceId: deviceInfo.deviceId,\n label: deviceInfo.label\n });\n }\n });\n resolve(devices);\n })[\"catch\"](function (error) {\n console.error('Error getting devices', error);\n reject(error);\n });\n });\n };\n /**\n * Get a MediaStream object that you can customize before calling [[initPublisher]] (pass _MediaStreamTrack_ property of the _MediaStream_ value resolved by the Promise as `audioSource` or `videoSource` properties in [[initPublisher]])\n *\n * Parameter `options` is the same as in [[initPublisher]] second parameter (of type [[PublisherProperties]]), but only the following properties will be applied: `audioSource`, `videoSource`, `frameRate`, `resolution`\n *\n * To customize the Publisher's video, the API for HTMLCanvasElement is very useful. For example, to get a black-and-white video at 10 fps and HD resolution with no sound:\n * ```\n * var OV = new OpenVidu();\n * var FRAME_RATE = 10;\n *\n * OV.getUserMedia({\n * audioSource: false;\n * videoSource: undefined,\n * resolution: '1280x720',\n * frameRate: FRAME_RATE\n * })\n * .then(mediaStream => {\n *\n * var videoTrack = mediaStream.getVideoTracks()[0];\n * var video = document.createElement('video');\n * video.srcObject = new MediaStream([videoTrack]);\n *\n * var canvas = document.createElement('canvas');\n * var ctx = canvas.getContext('2d');\n * ctx.filter = 'grayscale(100%)';\n *\n * video.addEventListener('play', () => {\n * var loop = () => {\n * if (!video.paused && !video.ended) {\n * ctx.drawImage(video, 0, 0, 300, 170);\n * setTimeout(loop, 1000/ FRAME_RATE); // Drawing at 10 fps\n * }\n * };\n * loop();\n * });\n * video.play();\n *\n * var grayVideoTrack = canvas.captureStream(FRAME_RATE).getVideoTracks()[0];\n * var publisher = this.OV.initPublisher(\n * myHtmlTarget,\n * {\n * audioSource: false,\n * videoSource: grayVideoTrack\n * });\n * });\n * ```\n */\n OpenVidu.prototype.getUserMedia = function (options) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.generateMediaConstraints(options)\n .then(function (constraints) {\n navigator.mediaDevices.getUserMedia(constraints)\n .then(function (mediaStream) {\n resolve(mediaStream);\n })[\"catch\"](function (error) {\n var errorName;\n var errorMessage = error.toString();\n if (!(options.videoSource === 'screen')) {\n errorName = OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;\n }\n else {\n errorName = OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED;\n }\n reject(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n });\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n };\n /* tslint:disable:no-empty */\n /**\n * Disable all logging except error level\n */\n OpenVidu.prototype.enableProdMode = function () {\n console.log = function () { };\n console.debug = function () { };\n console.info = function () { };\n console.warn = function () { };\n };\n /* tslint:enable:no-empty */\n /**\n * Set OpenVidu advanced configuration options. Currently `configuration` is an object with the following optional properties (see [[OpenViduAdvancedConfiguration]] for more details):\n * - `iceServers`: set custom STUN/TURN servers to be used by OpenVidu Browser\n * - `screenShareChromeExtension`: url to a custom screen share extension for Chrome to be used instead of the default one, based on ours [https://github.com/OpenVidu/openvidu-screen-sharing-chrome-extension](https://github.com/OpenVidu/openvidu-screen-sharing-chrome-extension)\n * - `publisherSpeakingEventsOptions`: custom configuration for the [[PublisherSpeakingEvent]] feature\n */\n OpenVidu.prototype.setAdvancedConfiguration = function (configuration) {\n this.advancedConfiguration = configuration;\n };\n /* Hidden methods */\n /**\n * @hidden\n */\n OpenVidu.prototype.generateMediaConstraints = function (publisherProperties) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var audio, video;\n if (publisherProperties.audioSource === null || publisherProperties.audioSource === false) {\n audio = false;\n }\n else if (publisherProperties.audioSource === undefined) {\n audio = true;\n }\n else {\n audio = publisherProperties.audioSource;\n }\n if (publisherProperties.videoSource === null || publisherProperties.videoSource === false) {\n video = false;\n }\n else {\n video = {\n height: {\n ideal: 480\n },\n width: {\n ideal: 640\n }\n };\n }\n var mediaConstraints = {\n audio: audio,\n video: video\n };\n if (typeof mediaConstraints.audio === 'string') {\n mediaConstraints.audio = { deviceId: { exact: mediaConstraints.audio } };\n }\n if (mediaConstraints.video) {\n if (!!publisherProperties.resolution) {\n var widthAndHeight = publisherProperties.resolution.toLowerCase().split('x');\n var width = Number(widthAndHeight[0]);\n var height = Number(widthAndHeight[1]);\n mediaConstraints.video.width.ideal = width;\n mediaConstraints.video.height.ideal = height;\n }\n if (!!publisherProperties.frameRate) {\n mediaConstraints.video.frameRate = { ideal: publisherProperties.frameRate };\n }\n if (!!publisherProperties.videoSource && typeof publisherProperties.videoSource === 'string') {\n if (publisherProperties.videoSource === 'screen') {\n if (platform.name !== 'Chrome' && platform.name.indexOf('Firefox') === -1) {\n var error = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED, 'You can only screen share in desktop Chrome and Firefox. Detected browser: ' + platform.name);\n console.error(error);\n reject(error);\n }\n else {\n if (!!_this.advancedConfiguration.screenShareChromeExtension && !(platform.name.indexOf('Firefox') !== -1)) {\n // Custom screen sharing extension for Chrome\n screenSharing.getScreenConstraints(function (error, screenConstraints) {\n if (!!error || !!screenConstraints.mandatory && screenConstraints.mandatory.chromeMediaSource === 'screen') {\n if (error === 'permission-denied' || error === 'PermissionDeniedError') {\n var error_1 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');\n console.error(error_1);\n reject(error_1);\n }\n else {\n var extensionId = _this.advancedConfiguration.screenShareChromeExtension.split('/').pop().trim();\n screenSharing.getChromeExtensionStatus(extensionId, function (status) {\n if (status === 'installed-disabled') {\n var error_2 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');\n console.error(error_2);\n reject(error_2);\n }\n if (status === 'not-installed') {\n var error_3 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, _this.advancedConfiguration.screenShareChromeExtension);\n console.error(error_3);\n reject(error_3);\n }\n });\n }\n }\n else {\n mediaConstraints.video = screenConstraints;\n resolve(mediaConstraints);\n }\n });\n }\n else {\n // Default screen sharing extension for Chrome\n screenSharingAuto.getScreenId(function (error, sourceId, screenConstraints) {\n if (!!error) {\n if (error === 'not-installed') {\n var extensionUrl = !!_this.advancedConfiguration.screenShareChromeExtension ? _this.advancedConfiguration.screenShareChromeExtension :\n 'https://chrome.google.com/webstore/detail/openvidu-screensharing/lfcgfepafnobdloecchnfaclibenjold';\n var error_4 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED, extensionUrl);\n console.error(error_4);\n reject(error_4);\n }\n else if (error === 'installed-disabled') {\n var error_5 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_EXTENSION_DISABLED, 'You must enable the screen extension');\n console.error(error_5);\n reject(error_5);\n }\n else if (error === 'permission-denied') {\n var error_6 = new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED, 'You must allow access to one window of your desktop');\n console.error(error_6);\n reject(error_6);\n }\n }\n else {\n mediaConstraints.video = screenConstraints.video;\n resolve(mediaConstraints);\n }\n });\n }\n publisherProperties.videoSource = 'screen';\n }\n }\n else {\n // tslint:disable-next-line:no-string-literal\n mediaConstraints.video['deviceId'] = { exact: publisherProperties.videoSource };\n resolve(mediaConstraints);\n }\n }\n else {\n resolve(mediaConstraints);\n }\n }\n else {\n resolve(mediaConstraints);\n }\n });\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.startWs = function (onConnectSucces) {\n var config = {\n heartbeat: 5000,\n sendCloseMessage: false,\n ws: {\n uri: this.wsUri,\n useSockJS: false,\n onconnected: onConnectSucces,\n ondisconnect: this.disconnectCallback.bind(this),\n onreconnecting: this.reconnectingCallback.bind(this),\n onreconnected: this.reconnectedCallback.bind(this)\n },\n rpc: {\n requestTimeout: 10000,\n participantJoined: this.session.onParticipantJoined.bind(this.session),\n participantPublished: this.session.onParticipantPublished.bind(this.session),\n participantUnpublished: this.session.onParticipantUnpublished.bind(this.session),\n participantLeft: this.session.onParticipantLeft.bind(this.session),\n participantEvicted: this.session.onParticipantEvicted.bind(this.session),\n recordingStarted: this.session.onRecordingStarted.bind(this.session),\n recordingStopped: this.session.onRecordingStopped.bind(this.session),\n sendMessage: this.session.onNewMessage.bind(this.session),\n streamPropertyChanged: this.session.onStreamPropertyChanged.bind(this.session),\n iceCandidate: this.session.recvIceCandidate.bind(this.session),\n mediaError: this.session.onMediaError.bind(this.session)\n }\n };\n this.jsonRpcClient = new RpcBuilder.clients.JsonRpcClient(config);\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.closeWs = function () {\n this.jsonRpcClient.close();\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.sendRequest = function (method, params, callback) {\n if (params && params instanceof Function) {\n callback = params;\n params = {};\n }\n console.debug('Sending request: {method:\"' + method + '\", params: ' + JSON.stringify(params) + '}');\n this.jsonRpcClient.send(method, params, callback);\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.isMediaStreamTrack = function (mediaSource) {\n var is = (!!mediaSource &&\n mediaSource.enabled !== undefined && typeof mediaSource.enabled === 'boolean' &&\n mediaSource.id !== undefined && typeof mediaSource.id === 'string' &&\n mediaSource.kind !== undefined && typeof mediaSource.kind === 'string' &&\n mediaSource.label !== undefined && typeof mediaSource.label === 'string' &&\n mediaSource.muted !== undefined && typeof mediaSource.muted === 'boolean' &&\n mediaSource.readyState !== undefined && typeof mediaSource.readyState === 'string');\n return is;\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.getWsUri = function () {\n return this.wsUri;\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.getSecret = function () {\n return this.secret;\n };\n /**\n * @hidden\n */\n OpenVidu.prototype.getRecorder = function () {\n return this.recorder;\n };\n /* Private methods */\n OpenVidu.prototype.disconnectCallback = function () {\n console.warn('Websocket connection lost');\n if (this.isRoomAvailable()) {\n this.session.onLostConnection();\n }\n else {\n alert('Connection error. Please reload page.');\n }\n };\n OpenVidu.prototype.reconnectingCallback = function () {\n console.warn('Websocket connection lost (reconnecting)');\n if (this.isRoomAvailable()) {\n this.session.onLostConnection();\n }\n else {\n alert('Connection error. Please reload page.');\n }\n };\n OpenVidu.prototype.reconnectedCallback = function () {\n console.warn('Websocket reconnected');\n };\n OpenVidu.prototype.isRoomAvailable = function () {\n if (this.session !== undefined && this.session instanceof Session_1.Session) {\n return true;\n }\n else {\n console.warn('Session instance not found');\n return false;\n }\n };\n return OpenVidu;\n}());\nexports.OpenVidu = OpenVidu;\n//# sourceMappingURL=OpenVidu.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Session_1 = require(\"./Session\");\nvar Stream_1 = require(\"./Stream\");\nvar StreamManager_1 = require(\"./StreamManager\");\nvar StreamEvent_1 = require(\"../OpenViduInternal/Events/StreamEvent\");\nvar StreamPropertyChangedEvent_1 = require(\"../OpenViduInternal/Events/StreamPropertyChangedEvent\");\nvar VideoElementEvent_1 = require(\"../OpenViduInternal/Events/VideoElementEvent\");\nvar OpenViduError_1 = require(\"../OpenViduInternal/Enums/OpenViduError\");\nvar platform = require(\"platform\");\n/**\n * Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method\n */\nvar Publisher = /** @class */ (function (_super) {\n __extends(Publisher, _super);\n /**\n * @hidden\n */\n function Publisher(targEl, properties, openvidu) {\n var _this = _super.call(this, new Stream_1.Stream((!!openvidu.session) ? openvidu.session : new Session_1.Session(openvidu), { publisherProperties: properties, mediaConstraints: {} }), targEl) || this;\n /**\n * Whether the Publisher has been granted access to the requested input devices or not\n */\n _this.accessAllowed = false;\n /**\n * Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)\n */\n _this.isSubscribedToRemote = false;\n _this.accessDenied = false;\n _this.properties = properties;\n _this.openvidu = openvidu;\n _this.stream.ee.on('local-stream-destroyed-by-disconnect', function (reason) {\n var streamEvent = new StreamEvent_1.StreamEvent(true, _this, 'streamDestroyed', _this.stream, reason);\n _this.emitEvent('streamDestroyed', [streamEvent]);\n streamEvent.callDefaultBehavior();\n });\n return _this;\n }\n /**\n * Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same value will have no effect\n *\n * #### Events dispatched\n *\n * The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `\"audioActive\"` and `reason` set to `\"publishAudio\"`\n * The [[Publisher]] object of the local participant will also dispatch the exact same event\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `\"audioActive\"` and `reason` set to `\"publishAudio\"`\n * The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event\n *\n * See [[StreamPropertyChangedEvent]] to learn more.\n *\n * @param value `true` to publish the audio stream, `false` to unpublish it\n */\n Publisher.prototype.publishAudio = function (value) {\n var _this = this;\n if (this.stream.audioActive !== value) {\n this.stream.getMediaStream().getAudioTracks().forEach(function (track) {\n track.enabled = value;\n });\n this.session.openvidu.sendRequest('streamPropertyChanged', {\n streamId: this.stream.streamId,\n property: 'audioActive',\n newValue: value,\n reason: 'publishAudio'\n }, function (error, response) {\n if (error) {\n console.error(\"Error sending 'streamPropertyChanged' event\", error);\n }\n else {\n _this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this.session, _this.stream, 'audioActive', value, !value, 'publishAudio')]);\n _this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this, _this.stream, 'audioActive', value, !value, 'publishAudio')]);\n }\n });\n this.stream.audioActive = value;\n console.info(\"'Publisher' has \" + (value ? 'published' : 'unpublished') + ' its audio stream');\n }\n };\n /**\n * Publish or unpublish the video stream (if available). Calling this method twice in a row passing same value will have no effect\n *\n * #### Events dispatched\n *\n * The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `\"videoActive\"` and `reason` set to `\"publishVideo\"`\n * The [[Publisher]] object of the local participant will also dispatch the exact same event\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `\"videoActive\"` and `reason` set to `\"publishVideo\"`\n * The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event\n *\n * See [[StreamPropertyChangedEvent]] to learn more.\n *\n * @param value `true` to publish the video stream, `false` to unpublish it\n */\n Publisher.prototype.publishVideo = function (value) {\n var _this = this;\n if (this.stream.videoActive !== value) {\n this.stream.getMediaStream().getVideoTracks().forEach(function (track) {\n track.enabled = value;\n });\n this.session.openvidu.sendRequest('streamPropertyChanged', {\n streamId: this.stream.streamId,\n property: 'videoActive',\n newValue: value,\n reason: 'publishVideo'\n }, function (error, response) {\n if (error) {\n console.error(\"Error sending 'streamPropertyChanged' event\", error);\n }\n else {\n _this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this.session, _this.stream, 'videoActive', value, !value, 'publishVideo')]);\n _this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this, _this.stream, 'videoActive', value, !value, 'publishVideo')]);\n }\n });\n this.stream.videoActive = value;\n console.info(\"'Publisher' has \" + (value ? 'published' : 'unpublished') + ' its video stream');\n }\n };\n /**\n * Call this method before [[Session.publish]] if you prefer to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.\n */\n Publisher.prototype.subscribeToRemote = function (value) {\n value = (value !== undefined) ? value : true;\n this.isSubscribedToRemote = value;\n this.stream.subscribeToMyRemote(value);\n };\n /**\n * See [[EventDispatcher.on]]\n */\n Publisher.prototype.on = function (type, handler) {\n var _this = this;\n _super.prototype.on.call(this, type, handler);\n if (type === 'streamCreated') {\n if (!!this.stream && this.stream.isLocalStreamPublished) {\n this.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]);\n }\n else {\n this.stream.ee.on('stream-created-by-publisher', function () {\n _this.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]);\n });\n }\n }\n if (type === 'remoteVideoPlaying') {\n if (this.stream.displayMyRemote() && this.videos[0] && this.videos[0].video &&\n this.videos[0].video.currentTime > 0 &&\n this.videos[0].video.paused === false &&\n this.videos[0].video.ended === false &&\n this.videos[0].video.readyState === 4) {\n this.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);\n }\n }\n if (type === 'accessAllowed') {\n if (this.accessAllowed) {\n this.emitEvent('accessAllowed', []);\n }\n }\n if (type === 'accessDenied') {\n if (this.accessDenied) {\n this.emitEvent('accessDenied', []);\n }\n }\n return this;\n };\n /**\n * See [[EventDispatcher.once]]\n */\n Publisher.prototype.once = function (type, handler) {\n var _this = this;\n _super.prototype.once.call(this, type, handler);\n if (type === 'streamCreated') {\n if (!!this.stream && this.stream.isLocalStreamPublished) {\n this.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, this, 'streamCreated', this.stream, '')]);\n }\n else {\n this.stream.ee.once('stream-created-by-publisher', function () {\n _this.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', _this.stream, '')]);\n });\n }\n }\n if (type === 'remoteVideoPlaying') {\n if (this.stream.displayMyRemote() && this.videos[0] && this.videos[0].video &&\n this.videos[0].video.currentTime > 0 &&\n this.videos[0].video.paused === false &&\n this.videos[0].video.ended === false &&\n this.videos[0].video.readyState === 4) {\n this.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'remoteVideoPlaying')]);\n }\n }\n if (type === 'accessAllowed') {\n if (this.accessAllowed) {\n this.emitEvent('accessAllowed', []);\n }\n }\n if (type === 'accessDenied') {\n if (this.accessDenied) {\n this.emitEvent('accessDenied', []);\n }\n }\n return this;\n };\n /* Hidden methods */\n /**\n * @hidden\n */\n Publisher.prototype.initialize = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var errorCallback = function (openViduError) {\n _this.accessDenied = true;\n _this.accessAllowed = false;\n reject(openViduError);\n };\n var successCallback = function (mediaStream) {\n _this.accessAllowed = true;\n _this.accessDenied = false;\n if (_this.openvidu.isMediaStreamTrack(_this.properties.audioSource)) {\n mediaStream.removeTrack(mediaStream.getAudioTracks()[0]);\n mediaStream.addTrack(_this.properties.audioSource);\n }\n if (_this.openvidu.isMediaStreamTrack(_this.properties.videoSource)) {\n mediaStream.removeTrack(mediaStream.getVideoTracks()[0]);\n mediaStream.addTrack(_this.properties.videoSource);\n }\n // Apply PublisherProperties.publishAudio and PublisherProperties.publishVideo\n if (!!mediaStream.getAudioTracks()[0]) {\n mediaStream.getAudioTracks()[0].enabled = !!_this.stream.outboundStreamOpts.publisherProperties.publishAudio;\n }\n if (!!mediaStream.getVideoTracks()[0]) {\n mediaStream.getVideoTracks()[0].enabled = !!_this.stream.outboundStreamOpts.publisherProperties.publishVideo;\n }\n _this.stream.setMediaStream(mediaStream);\n if (!_this.stream.displayMyRemote()) {\n // When we are subscribed to our remote we don't still set the MediaStream object in the video elements to\n // avoid early 'streamPlaying' event\n _this.stream.updateMediaStreamInVideos();\n }\n if (!!_this.firstVideoElement) {\n _this.createVideoElement(_this.firstVideoElement.targetElement, _this.properties.insertMode);\n }\n delete _this.firstVideoElement;\n if (!_this.stream.isSendScreen() && !!mediaStream.getVideoTracks()[0]) {\n // With no screen share, video dimension can be set directly from MediaStream (getSettings)\n // Orientation must be checked for mobile devices (width and height are reversed)\n var _a = mediaStream.getVideoTracks()[0].getSettings(), width = _a.width, height = _a.height;\n if (platform.name.toLowerCase().indexOf('mobile') !== -1 && (window.innerHeight > window.innerWidth)) {\n // Mobile portrait mode\n _this.stream.videoDimensions = {\n width: height || 0,\n height: width || 0\n };\n }\n else {\n _this.stream.videoDimensions = {\n width: width || 0,\n height: height || 0\n };\n }\n _this.stream.isLocalStreamReadyToPublish = true;\n _this.stream.ee.emitEvent('stream-ready-to-publish', []);\n }\n else {\n // With screen share, video dimension must be got from a video element (onloadedmetadata event)\n _this.videoReference = document.createElement('video');\n _this.videoReference.srcObject = mediaStream;\n _this.videoReference.onloadedmetadata = function () {\n _this.stream.videoDimensions = {\n width: _this.videoReference.videoWidth,\n height: _this.videoReference.videoHeight\n };\n _this.screenShareResizeInterval = setInterval(function () {\n var firefoxSettings = mediaStream.getVideoTracks()[0].getSettings();\n var newWidth = (platform.name === 'Chrome') ? _this.videoReference.videoWidth : firefoxSettings.width;\n var newHeight = (platform.name === 'Chrome') ? _this.videoReference.videoHeight : firefoxSettings.height;\n if (_this.stream.isLocalStreamPublished &&\n (newWidth !== _this.stream.videoDimensions.width ||\n newHeight !== _this.stream.videoDimensions.height)) {\n var oldValue_1 = { width: _this.stream.videoDimensions.width, height: _this.stream.videoDimensions.height };\n _this.stream.videoDimensions = {\n width: newWidth || 0,\n height: newHeight || 0\n };\n var newValue_1 = JSON.stringify(_this.stream.videoDimensions);\n _this.session.openvidu.sendRequest('streamPropertyChanged', {\n streamId: _this.stream.streamId,\n property: 'videoDimensions',\n newValue: newValue_1,\n reason: 'screenResized'\n }, function (error, response) {\n if (error) {\n console.error(\"Error sending 'streamPropertyChanged' event\", error);\n }\n else {\n _this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this.session, _this.stream, 'videoDimensions', newValue_1, oldValue_1, 'screenResized')]);\n _this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this, _this.stream, 'videoDimensions', newValue_1, oldValue_1, 'screenResized')]);\n }\n });\n }\n }, 500);\n _this.stream.isLocalStreamReadyToPublish = true;\n _this.stream.ee.emitEvent('stream-ready-to-publish', []);\n };\n }\n resolve();\n };\n _this.openvidu.generateMediaConstraints(_this.properties)\n .then(function (constraints) {\n var outboundStreamOptions = {\n mediaConstraints: constraints,\n publisherProperties: _this.properties\n };\n _this.stream.setOutboundStreamOptions(outboundStreamOptions);\n var constraintsAux = {};\n var timeForDialogEvent = 1250;\n if (_this.stream.isSendVideo() || _this.stream.isSendAudio()) {\n var definedAudioConstraint_1 = ((constraints.audio === undefined) ? true : constraints.audio);\n constraintsAux.audio = _this.stream.isSendScreen() ? false : definedAudioConstraint_1;\n constraintsAux.video = constraints.video;\n var startTime_1 = Date.now();\n _this.setPermissionDialogTimer(timeForDialogEvent);\n navigator.mediaDevices.getUserMedia(constraintsAux)\n .then(function (mediaStream) {\n _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);\n if (_this.stream.isSendScreen() && _this.stream.isSendAudio()) {\n // When getting desktop as user media audio constraint must be false. Now we can ask for it if required\n constraintsAux.audio = definedAudioConstraint_1;\n constraintsAux.video = false;\n startTime_1 = Date.now();\n _this.setPermissionDialogTimer(timeForDialogEvent);\n navigator.mediaDevices.getUserMedia(constraintsAux)\n .then(function (audioOnlyStream) {\n _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);\n mediaStream.addTrack(audioOnlyStream.getAudioTracks()[0]);\n successCallback(mediaStream);\n })[\"catch\"](function (error) {\n _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);\n var errorName, errorMessage;\n switch (error.name.toLowerCase()) {\n case 'notfounderror':\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;\n errorMessage = error.toString();\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n break;\n case 'notallowederror':\n errorName = OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;\n errorMessage = error.toString();\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n break;\n case 'overconstrainederror':\n if (error.constraint.toLowerCase() === 'deviceid') {\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;\n errorMessage = \"Audio input device with deviceId '\" + constraints.video.deviceId.exact + \"' not found\";\n }\n else {\n errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;\n errorMessage = \"Audio input device doesn't support the value passed for constraint '\" + error.constraint + \"'\";\n }\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n break;\n }\n });\n }\n else {\n successCallback(mediaStream);\n }\n })[\"catch\"](function (error) {\n _this.clearPermissionDialogTimer(startTime_1, timeForDialogEvent);\n var errorName, errorMessage;\n switch (error.name.toLowerCase()) {\n case 'notfounderror':\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: constraints.video\n })\n .then(function (mediaStream) {\n mediaStream.getVideoTracks().forEach(function (track) {\n track.stop();\n });\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;\n errorMessage = error.toString();\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n })[\"catch\"](function (e) {\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;\n errorMessage = error.toString();\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n });\n break;\n case 'notallowederror':\n errorName = _this.stream.isSendScreen() ? OpenViduError_1.OpenViduErrorName.SCREEN_CAPTURE_DENIED : OpenViduError_1.OpenViduErrorName.DEVICE_ACCESS_DENIED;\n errorMessage = error.toString();\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n break;\n case 'overconstrainederror':\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: constraints.video\n })\n .then(function (mediaStream) {\n mediaStream.getVideoTracks().forEach(function (track) {\n track.stop();\n });\n if (error.constraint.toLowerCase() === 'deviceid') {\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;\n errorMessage = \"Audio input device with deviceId '\" + constraints.audio.deviceId.exact + \"' not found\";\n }\n else {\n errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;\n errorMessage = \"Audio input device doesn't support the value passed for constraint '\" + error.constraint + \"'\";\n }\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n })[\"catch\"](function (e) {\n if (error.constraint.toLowerCase() === 'deviceid') {\n errorName = OpenViduError_1.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;\n errorMessage = \"Video input device with deviceId '\" + constraints.video.deviceId.exact + \"' not found\";\n }\n else {\n errorName = OpenViduError_1.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;\n errorMessage = \"Video input device doesn't support the value passed for constraint '\" + error.constraint + \"'\";\n }\n errorCallback(new OpenViduError_1.OpenViduError(errorName, errorMessage));\n });\n break;\n }\n });\n }\n else {\n reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.NO_INPUT_SOURCE_SET, \"Properties 'audioSource' and 'videoSource' cannot be set to false or null at the same time when calling 'OpenVidu.initPublisher'\"));\n }\n })[\"catch\"](function (error) {\n errorCallback(error);\n });\n });\n };\n /**\n * @hidden\n */\n Publisher.prototype.updateSession = function (session) {\n this.session = session;\n this.stream.session = session;\n };\n /**\n * @hidden\n */\n Publisher.prototype.reestablishStreamPlayingEvent = function () {\n if (this.ee.getListeners('streamPlaying').length > 0) {\n this.addPlayEventToFirstVideo();\n }\n };\n /* Private methods */\n Publisher.prototype.setPermissionDialogTimer = function (waitTime) {\n var _this = this;\n this.permissionDialogTimeout = setTimeout(function () {\n _this.emitEvent('accessDialogOpened', []);\n }, waitTime);\n };\n Publisher.prototype.clearPermissionDialogTimer = function (startTime, waitTime) {\n clearTimeout(this.permissionDialogTimeout);\n if ((Date.now() - startTime) > waitTime) {\n // Permission dialog was shown and now is closed\n this.emitEvent('accessDialogClosed', []);\n }\n };\n return Publisher;\n}(StreamManager_1.StreamManager));\nexports.Publisher = Publisher;\n//# sourceMappingURL=Publisher.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar Connection_1 = require(\"./Connection\");\nvar Subscriber_1 = require(\"./Subscriber\");\nvar ConnectionEvent_1 = require(\"../OpenViduInternal/Events/ConnectionEvent\");\nvar RecordingEvent_1 = require(\"../OpenViduInternal/Events/RecordingEvent\");\nvar SessionDisconnectedEvent_1 = require(\"../OpenViduInternal/Events/SessionDisconnectedEvent\");\nvar SignalEvent_1 = require(\"../OpenViduInternal/Events/SignalEvent\");\nvar StreamEvent_1 = require(\"../OpenViduInternal/Events/StreamEvent\");\nvar StreamPropertyChangedEvent_1 = require(\"../OpenViduInternal/Events/StreamPropertyChangedEvent\");\nvar OpenViduError_1 = require(\"../OpenViduInternal/Enums/OpenViduError\");\nvar VideoInsertMode_1 = require(\"../OpenViduInternal/Enums/VideoInsertMode\");\nvar platform = require(\"platform\");\nvar EventEmitter = require(\"wolfy87-eventemitter\");\n/**\n * Represents a video call. It can also be seen as a videoconference room where multiple users can connect.\n * Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.\n * Initialized with [[OpenVidu.initSession]] method\n */\nvar Session = /** @class */ (function () {\n /**\n * @hidden\n */\n function Session(openvidu) {\n /**\n * Collection of all StreamManagers of this Session ([[Publisher]] and [[Subscriber]])\n */\n this.streamManagers = [];\n // This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification\n /**\n * @hidden\n */\n this.remoteStreamsCreated = {};\n /**\n * @hidden\n */\n this.remoteConnections = {};\n /**\n * @hidden\n */\n this.speakingEventsEnabled = false;\n this.ee = new EventEmitter();\n this.openvidu = openvidu;\n }\n /**\n * Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when\n * they receive `streamCreated` event. The structure of `metadata` string is up to you (maybe some standarized format\n * as JSON or XML is a good idea), the only restriction is a maximum length of 10000 chars.\n *\n * This metadata is not considered secure, as it is generated in the client side. To pass securized data, add it as a parameter in the\n * token generation operation (through the API REST, openvidu-java-client or openvidu-node-client).\n *\n * Only after the returned Promise is successfully resolved [[Session.connection]] object will be available and properly defined.\n *\n * #### Events dispatched\n *\n * The [[Session]] object of the local participant will first dispatch one or more `connectionCreated` events upon successful termination of this method:\n * - First one for your own local Connection object, so you can retrieve [[Session.connection]] property.\n * - Then one for each remote Connection previously connected to the Session, if any. Any other remote user connecting to the Session after you have\n * successfully connected will also dispatch a `connectionCreated` event when they do so.\n *\n * The [[Session]] object of the local participant will also dispatch a `streamCreated` event for each remote active [[Publisher]] that was already streaming\n * when connecting, just after dispatching all remote `connectionCreated` events.\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `connectionCreated` event.\n *\n * See [[ConnectionEvent]] and [[StreamEvent]] to learn more.\n *\n * @returns A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not\n *\n */\n Session.prototype.connect = function (token, metadata) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.processToken(token);\n if (_this.openvidu.checkSystemRequirements()) {\n // Early configuration to deactivate automatic subscription to streams\n _this.options = {\n sessionId: _this.sessionId,\n participantId: token,\n metadata: !!metadata ? _this.stringClientMetadata(metadata) : ''\n };\n _this.connectAux(token).then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n }\n else {\n reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.BROWSER_NOT_SUPPORTED, 'Browser ' + platform.name + ' ' + platform.version + ' is not supported in OpenVidu'));\n }\n });\n };\n /**\n * Leaves the session, destroying all streams and deleting the user as a participant.\n *\n * #### Events dispatched\n *\n * The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.\n * This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)\n * and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).\n * For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.\n * Call `event.preventDefault()` upon event `sessionDisconnected` to avoid this behavior and take care of disposing and cleaning all the Subscriber objects yourself.\n * See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.\n *\n * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.\n * This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).\n * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.\n * Call `event.preventDefault()` upon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call `Session.unpublish()`\n * or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.\n * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)\n * and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).\n * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.\n * Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior and take care of disposing and cleaning the Subscriber object yourself.\n * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more.\n */\n Session.prototype.disconnect = function () {\n this.leave(false, 'disconnect');\n };\n /**\n * Subscribes to a `stream`, adding a new HTML video element to DOM with `subscriberProperties` settings. This method is usually called in the callback of `streamCreated` event.\n *\n * #### Events dispatched\n *\n * The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (only if you\n * [let OpenVidu take care of the video players](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.\n *\n * The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing. See [[StreamManagerEvent]] to learn more.\n *\n * @param stream Stream object to subscribe to\n * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Subscriber.\n * You can always call method [[Subscriber.addVideoElement]] or [[Subscriber.createVideoElement]] to manage the video elements on your own (see [Manage video players](/docs/how-do-i/manage-videos) section)\n * @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails.\n */\n Session.prototype.subscribe = function (stream, targetElement, param3, param4) {\n var properties = {};\n if (!!param3 && typeof param3 !== 'function') {\n properties = {\n insertMode: (typeof param3.insertMode !== 'undefined') ? ((typeof param3.insertMode === 'string') ? VideoInsertMode_1.VideoInsertMode[param3.insertMode] : properties.insertMode) : VideoInsertMode_1.VideoInsertMode.APPEND,\n subscribeToAudio: (typeof param3.subscribeToAudio !== 'undefined') ? param3.subscribeToAudio : true,\n subscribeToVideo: (typeof param3.subscribeToVideo !== 'undefined') ? param3.subscribeToVideo : true\n };\n }\n else {\n properties = {\n insertMode: VideoInsertMode_1.VideoInsertMode.APPEND,\n subscribeToAudio: true,\n subscribeToVideo: true\n };\n }\n var completionHandler;\n if (!!param3 && (typeof param3 === 'function')) {\n completionHandler = param3;\n }\n else if (!!param4) {\n completionHandler = param4;\n }\n console.info('Subscribing to ' + stream.connection.connectionId);\n stream.subscribe()\n .then(function () {\n console.info('Subscribed correctly to ' + stream.connection.connectionId);\n if (completionHandler !== undefined) {\n completionHandler(undefined);\n }\n })[\"catch\"](function (error) {\n if (completionHandler !== undefined) {\n completionHandler(error);\n }\n });\n var subscriber = new Subscriber_1.Subscriber(stream, targetElement, properties);\n if (!!subscriber.targetElement) {\n stream.streamManager.createVideoElement(subscriber.targetElement, properties.insertMode);\n }\n return subscriber;\n };\n Session.prototype.subscribeAsync = function (stream, targetElement, properties) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var subscriber;\n var callback = function (error) {\n if (!!error) {\n reject(error);\n }\n else {\n resolve(subscriber);\n }\n };\n if (!!properties) {\n subscriber = _this.subscribe(stream, targetElement, properties, callback);\n }\n else {\n subscriber = _this.subscribe(stream, targetElement, callback);\n }\n });\n };\n /**\n * Unsubscribes from `subscriber`, automatically removing its associated HTML video elements.\n *\n * #### Events dispatched\n *\n * The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.\n * Only videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed\n *\n * See [[VideoElementEvent]] to learn more\n */\n Session.prototype.unsubscribe = function (subscriber) {\n var connectionId = subscriber.stream.connection.connectionId;\n console.info('Unsubscribing from ' + connectionId);\n this.openvidu.sendRequest('unsubscribeFromVideo', { sender: subscriber.stream.connection.connectionId }, function (error, response) {\n if (error) {\n console.error('Error unsubscribing from ' + connectionId, error);\n }\n else {\n console.info('Unsubscribed correctly from ' + connectionId);\n }\n subscriber.stream.disposeWebRtcPeer();\n subscriber.stream.disposeMediaStream();\n });\n subscriber.stream.streamManager.removeAllVideos();\n };\n /**\n * Publishes to the Session the Publisher object\n *\n * #### Events dispatched\n *\n * The local [[Publisher]] object will dispatch a `streamCreated` event upon successful termination of this method. See [[StreamEvent]] to learn more.\n *\n * The local [[Publisher]] object will dispatch a `streamPlaying` once the media stream starts playing. See [[StreamManagerEvent]] to learn more.\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `streamCreated` event so they can subscribe to it. See [[StreamEvent]] to learn more.\n *\n * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not\n */\n Session.prototype.publish = function (publisher) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n publisher.session = _this;\n publisher.stream.session = _this;\n if (!publisher.stream.isLocalStreamPublished) {\n // 'Session.unpublish(Publisher)' has NOT been called\n _this.connection.addStream(publisher.stream);\n publisher.stream.publish()\n .then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n }\n else {\n // 'Session.unpublish(Publisher)' has been called. Must initialize again Publisher\n publisher.initialize()\n .then(function () {\n _this.connection.addStream(publisher.stream);\n publisher.reestablishStreamPlayingEvent();\n publisher.stream.publish()\n .then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n })[\"catch\"](function (error) {\n reject(error);\n });\n }\n });\n };\n /**\n * Unpublishes from the Session the Publisher object.\n *\n * #### Events dispatched\n *\n * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.\n * This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher\n * (only those videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).\n * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.\n * Call `event.preventDefault()` upon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.\n *\n * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.\n * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and\n * delete any HTML video element associated to it (only those [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).\n * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.\n * Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior and take care of disposing and cleaning the Subscriber object on your own.\n *\n * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.\n */\n Session.prototype.unpublish = function (publisher) {\n var stream = publisher.stream;\n if (!stream.connection) {\n console.error('The associated Connection object of this Publisher is null', stream);\n return;\n }\n else if (stream.connection !== this.connection) {\n console.error('The associated Connection object of this Publisher is not your local Connection.' +\n \"Only moderators can force unpublish on remote Streams via 'forceUnpublish' method\", stream);\n return;\n }\n else {\n console.info('Unpublishing local media (' + stream.connection.connectionId + ')');\n this.openvidu.sendRequest('unpublishVideo', function (error, response) {\n if (error) {\n console.error(error);\n }\n else {\n console.info('Media unpublished correctly');\n }\n });\n stream.disposeWebRtcPeer();\n delete stream.connection.stream;\n var streamEvent = new StreamEvent_1.StreamEvent(true, publisher, 'streamDestroyed', publisher.stream, 'unpublish');\n publisher.emitEvent('streamDestroyed', [streamEvent]);\n streamEvent.callDefaultBehavior();\n }\n };\n /**\n * Sends one signal. `signal` object has the following optional properties:\n * ```json\n * {data:string, to:Connection[], type:string}\n * ```\n * All users subscribed to that signal (`session.on('signal:type', ...)` or `session.on('signal', ...)` for all signals) and whose Connection objects are in `to` array will receive it. Their local\n * Session objects will dispatch a `signal` or `signal:type` event. See [[SignalEvent]] to learn more.\n *\n * @returns A Promise (to which you can optionally subscribe to) that is resolved if the message successfully reached openvidu-server and rejected with an Error object if not. _This doesn't\n * mean that openvidu-server could resend the message to all the listed receivers._\n */\n /* tslint:disable:no-string-literal */\n Session.prototype.signal = function (signal) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var signalMessage = {};\n if (signal.to && signal.to.length > 0) {\n var connectionIds_1 = [];\n signal.to.forEach(function (connection) {\n connectionIds_1.push(connection.connectionId);\n });\n signalMessage['to'] = connectionIds_1;\n }\n else {\n signalMessage['to'] = [];\n }\n signalMessage['data'] = signal.data ? signal.data : '';\n signalMessage['type'] = signal.type ? signal.type : '';\n _this.openvidu.sendRequest('sendMessage', {\n message: JSON.stringify(signalMessage)\n }, function (error, response) {\n if (!!error) {\n reject(error);\n }\n else {\n resolve();\n }\n });\n });\n };\n /* tslint:enable:no-string-literal */\n /**\n * See [[EventDispatcher.on]]\n */\n Session.prototype.on = function (type, handler) {\n this.ee.on(type, function (event) {\n if (event) {\n console.info(\"Event '\" + type + \"' triggered by 'Session'\", event);\n }\n else {\n console.info(\"Event '\" + type + \"' triggered by 'Session'\");\n }\n handler(event);\n });\n if (type === 'publisherStartSpeaking' || type === 'publisherStopSpeaking') {\n this.speakingEventsEnabled = true;\n // If there are already available remote streams, enable hark 'speaking' event in all of them\n for (var connectionId in this.remoteConnections) {\n var str = this.remoteConnections[connectionId].stream;\n if (!!str && !str.speechEvent && str.hasAudio) {\n str.enableSpeakingEvents();\n }\n }\n }\n return this;\n };\n /**\n * See [[EventDispatcher.once]]\n */\n Session.prototype.once = function (type, handler) {\n this.ee.once(type, function (event) {\n if (event) {\n console.info(\"Event '\" + type + \"' triggered by 'Session'\", event);\n }\n else {\n console.info(\"Event '\" + type + \"' triggered by 'Session'\");\n }\n handler(event);\n });\n if (type === 'publisherStartSpeaking' || type === 'publisherStopSpeaking') {\n this.speakingEventsEnabled = true;\n // If there are already available remote streams, enable hark in all of them\n for (var connectionId in this.remoteConnections) {\n var str = this.remoteConnections[connectionId].stream;\n if (!!str && !str.speechEvent && str.hasAudio) {\n str.enableOnceSpeakingEvents();\n }\n }\n }\n return this;\n };\n /**\n * See [[EventDispatcher.off]]\n */\n Session.prototype.off = function (type, handler) {\n if (!handler) {\n this.ee.removeAllListeners(type);\n }\n else {\n this.ee.off(type, handler);\n }\n if (type === 'publisherStartSpeaking' || type === 'publisherStopSpeaking') {\n this.speakingEventsEnabled = false;\n // If there are already available remote streams, disablae hark in all of them\n for (var connectionId in this.remoteConnections) {\n var str = this.remoteConnections[connectionId].stream;\n if (!!str && !!str.speechEvent) {\n str.disableSpeakingEvents();\n }\n }\n }\n return this;\n };\n /* Hidden methods */\n /**\n * @hidden\n */\n Session.prototype.onParticipantJoined = function (response) {\n var _this = this;\n // Connection shouldn't exist\n this.getConnection(response.id, '')\n .then(function (connection) {\n console.warn('Connection ' + response.id + ' already exists in connections list');\n })[\"catch\"](function (openViduError) {\n var connection = new Connection_1.Connection(_this, response);\n _this.remoteConnections[response.id] = connection;\n _this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onParticipantLeft = function (msg) {\n var _this = this;\n this.getRemoteConnection(msg.name, 'Remote connection ' + msg.name + \" unknown when 'onParticipantLeft'. \" +\n 'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))\n .then(function (connection) {\n if (!!connection.stream) {\n var stream = connection.stream;\n var streamEvent = new StreamEvent_1.StreamEvent(true, _this, 'streamDestroyed', stream, msg.reason);\n _this.ee.emitEvent('streamDestroyed', [streamEvent]);\n streamEvent.callDefaultBehavior();\n delete _this.remoteStreamsCreated[stream.streamId];\n }\n delete _this.remoteConnections[connection.connectionId];\n _this.ee.emitEvent('connectionDestroyed', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionDestroyed', connection, msg.reason)]);\n })[\"catch\"](function (openViduError) {\n console.error(openViduError);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onParticipantPublished = function (response) {\n var _this = this;\n var afterConnectionFound = function (connection) {\n _this.remoteConnections[connection.connectionId] = connection;\n if (!_this.remoteStreamsCreated[connection.stream.streamId]) {\n // Avoid race condition between stream.subscribe() in \"onParticipantPublished\" and in \"joinRoom\" rpc callback\n // This condition is false if openvidu-server sends \"participantPublished\" event to a subscriber participant that has\n // already subscribed to certain stream in the callback of \"joinRoom\" method\n _this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', connection.stream, '')]);\n }\n _this.remoteStreamsCreated[connection.stream.streamId] = true;\n };\n // Get the existing Connection created on 'onParticipantJoined' for\n // existing participants or create a new one for new participants\n var connection;\n this.getRemoteConnection(response.id, \"Remote connection '\" + response.id + \"' unknown when 'onParticipantPublished'. \" +\n 'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))\n .then(function (con) {\n // Update existing Connection\n connection = con;\n response.metadata = con.data;\n connection.options = response;\n connection.initRemoteStreams(response.streams);\n afterConnectionFound(connection);\n })[\"catch\"](function (openViduError) {\n // Create new Connection\n connection = new Connection_1.Connection(_this, response);\n afterConnectionFound(connection);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onParticipantUnpublished = function (msg) {\n var _this = this;\n this.getRemoteConnection(msg.name, \"Remote connection '\" + msg.name + \"' unknown when 'onParticipantUnpublished'. \" +\n 'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))\n .then(function (connection) {\n var streamEvent = new StreamEvent_1.StreamEvent(true, _this, 'streamDestroyed', connection.stream, msg.reason);\n _this.ee.emitEvent('streamDestroyed', [streamEvent]);\n streamEvent.callDefaultBehavior();\n // Deleting the remote stream\n var streamId = connection.stream.streamId;\n delete _this.remoteStreamsCreated[streamId];\n connection.removeStream(streamId);\n })[\"catch\"](function (openViduError) {\n console.error(openViduError);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onParticipantEvicted = function (msg) {\n /*this.getRemoteConnection(msg.name, 'Remote connection ' + msg.name + \" unknown when 'onParticipantLeft'. \" +\n 'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))\n\n .then(connection => {\n if (!!connection.stream) {\n const stream = connection.stream;\n\n const streamEvent = new StreamEvent(true, this, 'streamDestroyed', stream, 'forceDisconnect');\n this.ee.emitEvent('streamDestroyed', [streamEvent]);\n streamEvent.callDefaultBehavior();\n\n delete this.remoteStreamsCreated[stream.streamId];\n }\n connection.dispose();\n delete this.remoteConnections[connection.connectionId];\n this.ee.emitEvent('connectionDestroyed', [new ConnectionEvent(false, this, 'connectionDestroyed', connection, 'forceDisconnect')]);\n })\n .catch(openViduError => {\n console.error(openViduError);\n });*/\n };\n /**\n * @hidden\n */\n Session.prototype.onNewMessage = function (msg) {\n var _this = this;\n console.info('New signal: ' + JSON.stringify(msg));\n this.getConnection(msg.from, \"Connection '\" + msg.from + \"' unknow when 'onNewMessage'. Existing remote connections: \"\n + JSON.stringify(Object.keys(this.remoteConnections)) + '. Existing local connection: ' + this.connection.connectionId)\n .then(function (connection) {\n _this.ee.emitEvent('signal', [new SignalEvent_1.SignalEvent(_this, msg.type, msg.data, connection)]);\n _this.ee.emitEvent('signal:' + msg.type, [new SignalEvent_1.SignalEvent(_this, msg.type, msg.data, connection)]);\n })[\"catch\"](function (openViduError) {\n console.error(openViduError);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onStreamPropertyChanged = function (msg) {\n var _this = this;\n this.getRemoteConnection(msg.connectionId, 'Remote connection ' + msg.connectionId + \" unknown when 'onStreamPropertyChanged'. \" +\n 'Existing remote connections: ' + JSON.stringify(Object.keys(this.remoteConnections)))\n .then(function (connection) {\n if (!!connection.stream && connection.stream.streamId === msg.streamId) {\n var stream = connection.stream;\n var oldValue = void 0;\n switch (msg.property) {\n case 'audioActive':\n oldValue = stream.audioActive;\n msg.newValue = msg.newValue === 'true';\n stream.audioActive = msg.newValue;\n break;\n case 'videoActive':\n oldValue = stream.videoActive;\n msg.newValue = msg.newValue === 'true';\n stream.videoActive = msg.newValue;\n break;\n case 'videoDimensions':\n oldValue = stream.videoDimensions;\n msg.newValue = JSON.parse(JSON.parse(msg.newValue));\n stream.videoDimensions = msg.newValue;\n break;\n }\n _this.ee.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(_this, stream, msg.property, msg.newValue, oldValue, msg.reason)]);\n stream.streamManager.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent_1.StreamPropertyChangedEvent(stream.streamManager, stream, msg.property, msg.newValue, oldValue, msg.reason)]);\n }\n else {\n console.error(\"No stream with streamId '\" + msg.streamId + \"' found for connection '\" + msg.connectionId + \"' on 'streamPropertyChanged' event\");\n }\n })[\"catch\"](function (openViduError) {\n console.error(openViduError);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.recvIceCandidate = function (msg) {\n var candidate = {\n candidate: msg.candidate,\n sdpMid: msg.sdpMid,\n sdpMLineIndex: msg.sdpMLineIndex,\n toJSON: function () {\n return { candidate: msg.candidate };\n }\n };\n this.getConnection(msg.endpointName, 'Connection not found for endpoint ' + msg.endpointName + '. Ice candidate will be ignored: ' + candidate)\n .then(function (connection) {\n var stream = connection.stream;\n stream.getWebRtcPeer().addIceCandidate(candidate)[\"catch\"](function (error) {\n console.error('Error adding candidate for ' + stream.streamId\n + ' stream of endpoint ' + msg.endpointName + ': ' + error);\n });\n })[\"catch\"](function (openViduError) {\n console.error(openViduError);\n });\n };\n /**\n * @hidden\n */\n Session.prototype.onSessionClosed = function (msg) {\n console.info('Session closed: ' + JSON.stringify(msg));\n var s = msg.room;\n if (s !== undefined) {\n this.ee.emitEvent('session-closed', [{\n session: s\n }]);\n }\n else {\n console.warn('Session undefined on session closed', msg);\n }\n };\n /**\n * @hidden\n */\n Session.prototype.onLostConnection = function () {\n /*if (!this.connection) {\n\n console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');\n\n const url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];\n if (window.confirm('If you are not debugging, this is probably a certificate error at \\\"' + url + '\\\"\\n\\nClick OK to navigate and accept it')) {\n location.assign(url + '/accept-certificate');\n }\n return;\n }*/\n console.warn('Lost connection in Session ' + this.sessionId);\n if (!!this.sessionId && !this.connection.disposed) {\n this.leave(true, 'networkDisconnect');\n }\n };\n /**\n * @hidden\n */\n Session.prototype.onMediaError = function (params) {\n console.error('Media error: ' + JSON.stringify(params));\n var err = params.error;\n if (err) {\n this.ee.emitEvent('error-media', [{\n error: err\n }]);\n }\n else {\n console.warn('Received undefined media error. Params:', params);\n }\n };\n /**\n * @hidden\n */\n Session.prototype.onRecordingStarted = function (response) {\n this.ee.emitEvent('recordingStarted', [new RecordingEvent_1.RecordingEvent(this, 'recordingStarted', response.id, response.name)]);\n };\n /**\n * @hidden\n */\n Session.prototype.onRecordingStopped = function (response) {\n this.ee.emitEvent('recordingStopped', [new RecordingEvent_1.RecordingEvent(this, 'recordingStopped', response.id, response.name)]);\n };\n /**\n * @hidden\n */\n Session.prototype.emitEvent = function (type, eventArray) {\n this.ee.emitEvent(type, eventArray);\n };\n /**\n * @hidden\n */\n Session.prototype.leave = function (forced, reason) {\n var _this = this;\n forced = !!forced;\n console.info('Leaving Session (forced=' + forced + ')');\n if (!!this.connection) {\n if (!this.connection.disposed && !forced) {\n this.openvidu.sendRequest('leaveRoom', function (error, response) {\n if (error) {\n console.error(error);\n }\n _this.openvidu.closeWs();\n });\n }\n else {\n this.openvidu.closeWs();\n }\n if (!!this.connection.stream) {\n // Dispose Publisher's local stream\n this.connection.stream.disposeWebRtcPeer();\n if (this.connection.stream.isLocalStreamPublished) {\n // Make Publisher object dispatch 'streamDestroyed' event if the Stream was published\n this.connection.stream.ee.emitEvent('local-stream-destroyed-by-disconnect', [reason]);\n }\n }\n if (!this.connection.disposed) {\n // Make Session object dispatch 'sessionDisconnected' event (if it is not already disposed)\n var sessionDisconnectEvent = new SessionDisconnectedEvent_1.SessionDisconnectedEvent(this, reason);\n this.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);\n sessionDisconnectEvent.callDefaultBehavior();\n }\n }\n else {\n console.warn('You were not connected to the session ' + this.sessionId);\n }\n };\n /* Private methods */\n Session.prototype.connectAux = function (token) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.openvidu.startWs(function (error) {\n if (!!error) {\n reject(error);\n }\n else {\n var joinParams = {\n token: (!!token) ? token : '',\n session: _this.sessionId,\n metadata: !!_this.options.metadata ? _this.options.metadata : '',\n secret: _this.openvidu.getSecret(),\n recorder: _this.openvidu.getRecorder()\n };\n _this.openvidu.sendRequest('joinRoom', joinParams, function (error, response) {\n if (!!error) {\n reject(error);\n }\n else {\n // Initialize local Connection object with values returned by openvidu-server\n _this.connection = new Connection_1.Connection(_this);\n _this.connection.connectionId = response.id;\n _this.connection.data = response.metadata;\n // Initialize remote Connections with value returned by openvidu-server\n var events_1 = {\n connections: new Array(),\n streams: new Array()\n };\n var existingParticipants = response.value;\n existingParticipants.forEach(function (participant) {\n var connection = new Connection_1.Connection(_this, participant);\n _this.remoteConnections[connection.connectionId] = connection;\n events_1.connections.push(connection);\n if (!!connection.stream) {\n _this.remoteStreamsCreated[connection.stream.streamId] = true;\n events_1.streams.push(connection.stream);\n }\n });\n // Own 'connectionCreated' event\n _this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', _this.connection, '')]);\n // One 'connectionCreated' event for each existing connection in the session\n events_1.connections.forEach(function (connection) {\n _this.ee.emitEvent('connectionCreated', [new ConnectionEvent_1.ConnectionEvent(false, _this, 'connectionCreated', connection, '')]);\n });\n // One 'streamCreated' event for each active stream in the session\n events_1.streams.forEach(function (stream) {\n _this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);\n });\n resolve();\n }\n });\n }\n });\n });\n };\n Session.prototype.stringClientMetadata = function (metadata) {\n if (typeof metadata !== 'string') {\n return JSON.stringify(metadata);\n }\n else {\n return metadata;\n }\n };\n Session.prototype.getConnection = function (connectionId, errorMessage) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var connection = _this.remoteConnections[connectionId];\n if (!!connection) {\n // Resolve remote connection\n resolve(connection);\n }\n else {\n if (_this.connection.connectionId === connectionId) {\n // Resolve local connection\n resolve(_this.connection);\n }\n else {\n // Connection not found. Reject with OpenViduError\n reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));\n }\n }\n });\n };\n Session.prototype.getRemoteConnection = function (connectionId, errorMessage) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var connection = _this.remoteConnections[connectionId];\n if (!!connection) {\n // Resolve remote connection\n resolve(connection);\n }\n else {\n // Remote connection not found. Reject with OpenViduError\n reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));\n }\n });\n };\n Session.prototype.processToken = function (token) {\n var url = new URL(token);\n this.sessionId = url.searchParams.get('sessionId');\n var secret = url.searchParams.get('secret');\n var recorder = url.searchParams.get('recorder');\n var turnUsername = url.searchParams.get('turnUsername');\n var turnCredential = url.searchParams.get('turnCredential');\n var role = url.searchParams.get('role');\n if (!!secret) {\n this.openvidu.secret = secret;\n }\n if (!!recorder) {\n this.openvidu.recorder = true;\n }\n if (!!turnUsername && !!turnCredential) {\n var stunUrl = 'stun:' + url.hostname + ':3478';\n var turnUrl1 = 'turn:' + url.hostname + ':3478';\n var turnUrl2 = turnUrl1 + '?transport=tcp';\n this.openvidu.iceServers = [\n { urls: [stunUrl] },\n { urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }\n ];\n console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']');\n }\n if (!!role) {\n this.openvidu.role = role;\n }\n this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';\n };\n return Session;\n}());\nexports.Session = Session;\n//# sourceMappingURL=Session.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar WebRtcPeer_1 = require(\"../OpenViduInternal/WebRtcPeer/WebRtcPeer\");\nvar WebRtcStats_1 = require(\"../OpenViduInternal/WebRtcStats/WebRtcStats\");\nvar PublisherSpeakingEvent_1 = require(\"../OpenViduInternal/Events/PublisherSpeakingEvent\");\nvar EventEmitter = require(\"wolfy87-eventemitter\");\nvar hark = require(\"hark\");\n/**\n * Represents each one of the media streams available in OpenVidu Server for certain session.\n * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access\n * to one of them (sending and receiving it, respectively)\n */\nvar Stream = /** @class */ (function () {\n /**\n * @hidden\n */\n function Stream(session, options) {\n var _this = this;\n /**\n * @hidden\n */\n this.ee = new EventEmitter();\n this.isSubscribeToRemote = false;\n /**\n * @hidden\n */\n this.isLocalStreamReadyToPublish = false;\n /**\n * @hidden\n */\n this.isLocalStreamPublished = false;\n this.session = session;\n if (options.hasOwnProperty('id')) {\n // InboundStreamOptions: stream belongs to a Subscriber\n this.inboundStreamOpts = options;\n this.streamId = this.inboundStreamOpts.id;\n this.hasAudio = this.inboundStreamOpts.hasAudio;\n this.hasVideo = this.inboundStreamOpts.hasVideo;\n if (this.hasAudio) {\n this.audioActive = this.inboundStreamOpts.audioActive;\n }\n if (this.hasVideo) {\n this.videoActive = this.inboundStreamOpts.videoActive;\n this.typeOfVideo = (!this.inboundStreamOpts.typeOfVideo) ? undefined : this.inboundStreamOpts.typeOfVideo;\n this.frameRate = (this.inboundStreamOpts.frameRate === -1) ? undefined : this.inboundStreamOpts.frameRate;\n this.videoDimensions = this.inboundStreamOpts.videoDimensions;\n }\n }\n else {\n // OutboundStreamOptions: stream belongs to a Publisher\n this.outboundStreamOpts = options;\n this.hasAudio = this.isSendAudio();\n this.hasVideo = this.isSendVideo();\n if (this.hasAudio) {\n this.audioActive = !!this.outboundStreamOpts.publisherProperties.publishAudio;\n }\n if (this.hasVideo) {\n this.videoActive = !!this.outboundStreamOpts.publisherProperties.publishVideo;\n this.frameRate = this.outboundStreamOpts.publisherProperties.frameRate;\n if (this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack) {\n this.typeOfVideo = 'CUSTOM';\n }\n else {\n this.typeOfVideo = this.isSendScreen() ? 'SCREEN' : 'CAMERA';\n }\n }\n }\n this.ee.on('mediastream-updated', function () {\n _this.streamManager.updateMediaStream(_this.mediaStream);\n console.debug('Video srcObject [' + _this.mediaStream + '] updated in stream [' + _this.streamId + ']');\n });\n }\n /* Hidden methods */\n /**\n * @hidden\n */\n Stream.prototype.getMediaStream = function () {\n return this.mediaStream;\n };\n /**\n * @hidden\n */\n Stream.prototype.setMediaStream = function (mediaStream) {\n this.mediaStream = mediaStream;\n };\n /**\n * @hidden\n */\n Stream.prototype.updateMediaStreamInVideos = function () {\n this.ee.emitEvent('mediastream-updated');\n };\n /**\n * @hidden\n */\n Stream.prototype.getWebRtcPeer = function () {\n return this.webRtcPeer;\n };\n /**\n * @hidden\n */\n Stream.prototype.getRTCPeerConnection = function () {\n return this.webRtcPeer.pc;\n };\n /**\n * @hidden\n */\n Stream.prototype.subscribeToMyRemote = function (value) {\n this.isSubscribeToRemote = value;\n };\n /**\n * @hidden\n */\n Stream.prototype.setOutboundStreamOptions = function (outboundStreamOpts) {\n this.outboundStreamOpts = outboundStreamOpts;\n };\n /**\n * @hidden\n */\n Stream.prototype.subscribe = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.initWebRtcPeerReceive()\n .then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n };\n /**\n * @hidden\n */\n Stream.prototype.publish = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLocalStreamReadyToPublish) {\n _this.initWebRtcPeerSend()\n .then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n }\n else {\n _this.ee.once('stream-ready-to-publish', function () {\n _this.publish()\n .then(function () {\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n }\n });\n };\n /**\n * @hidden\n */\n Stream.prototype.disposeWebRtcPeer = function () {\n if (this.webRtcPeer) {\n this.webRtcPeer.dispose();\n }\n if (this.speechEvent) {\n this.speechEvent.stop();\n }\n this.stopWebRtcStats();\n console.info((!!this.outboundStreamOpts ? 'Outbound ' : 'Inbound ') + \"WebRTCPeer from 'Stream' with id [\" + this.streamId + '] is now closed');\n };\n /**\n * @hidden\n */\n Stream.prototype.disposeMediaStream = function () {\n if (this.mediaStream) {\n this.mediaStream.getAudioTracks().forEach(function (track) {\n track.stop();\n });\n this.mediaStream.getVideoTracks().forEach(function (track) {\n track.stop();\n });\n delete this.mediaStream;\n }\n console.info((!!this.outboundStreamOpts ? 'Local ' : 'Remote ') + \"MediaStream from 'Stream' with id [\" + this.streamId + '] is now disposed');\n };\n /**\n * @hidden\n */\n Stream.prototype.displayMyRemote = function () {\n return this.isSubscribeToRemote;\n };\n /**\n * @hidden\n */\n Stream.prototype.isSendAudio = function () {\n return (!!this.outboundStreamOpts &&\n this.outboundStreamOpts.publisherProperties.audioSource !== null &&\n this.outboundStreamOpts.publisherProperties.audioSource !== false);\n };\n /**\n * @hidden\n */\n Stream.prototype.isSendVideo = function () {\n return (!!this.outboundStreamOpts &&\n this.outboundStreamOpts.publisherProperties.videoSource !== null &&\n this.outboundStreamOpts.publisherProperties.videoSource !== false);\n };\n /**\n * @hidden\n */\n Stream.prototype.isSendScreen = function () {\n return (!!this.outboundStreamOpts &&\n this.outboundStreamOpts.publisherProperties.videoSource === 'screen');\n };\n /**\n * @hidden\n */\n Stream.prototype.setSpeechEventIfNotExists = function () {\n if (!this.speechEvent) {\n var harkOptions = this.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions || {};\n harkOptions.interval = (typeof harkOptions.interval === 'number') ? harkOptions.interval : 50;\n harkOptions.threshold = (typeof harkOptions.threshold === 'number') ? harkOptions.threshold : -50;\n this.speechEvent = hark(this.mediaStream, harkOptions);\n }\n };\n /**\n * @hidden\n */\n Stream.prototype.enableSpeakingEvents = function () {\n var _this = this;\n this.setSpeechEventIfNotExists();\n this.speechEvent.on('speaking', function () {\n _this.session.emitEvent('publisherStartSpeaking', [new PublisherSpeakingEvent_1.PublisherSpeakingEvent(_this.session, 'publisherStartSpeaking', _this.connection, _this.streamId)]);\n });\n this.speechEvent.on('stopped_speaking', function () {\n _this.session.emitEvent('publisherStopSpeaking', [new PublisherSpeakingEvent_1.PublisherSpeakingEvent(_this.session, 'publisherStopSpeaking', _this.connection, _this.streamId)]);\n });\n };\n /**\n * @hidden\n */\n Stream.prototype.enableOnceSpeakingEvents = function () {\n var _this = this;\n this.setSpeechEventIfNotExists();\n this.speechEvent.on('speaking', function () {\n _this.session.emitEvent('publisherStartSpeaking', [new PublisherSpeakingEvent_1.PublisherSpeakingEvent(_this.session, 'publisherStartSpeaking', _this.connection, _this.streamId)]);\n _this.disableSpeakingEvents();\n });\n this.speechEvent.on('stopped_speaking', function () {\n _this.session.emitEvent('publisherStopSpeaking', [new PublisherSpeakingEvent_1.PublisherSpeakingEvent(_this.session, 'publisherStopSpeaking', _this.connection, _this.streamId)]);\n _this.disableSpeakingEvents();\n });\n };\n /**\n * @hidden\n */\n Stream.prototype.disableSpeakingEvents = function () {\n this.speechEvent.stop();\n this.speechEvent = undefined;\n };\n /**\n * @hidden\n */\n Stream.prototype.isLocal = function () {\n // inbound options undefined and outbound options defined\n return (!this.inboundStreamOpts && !!this.outboundStreamOpts);\n };\n /**\n * @hidden\n */\n Stream.prototype.getSelectedIceCandidate = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.webRtcStats.getSelectedIceCandidateInfo()\n .then(function (report) { return resolve(report); })[\"catch\"](function (error) { return reject(error); });\n });\n };\n /**\n * @hidden\n */\n Stream.prototype.getRemoteIceCandidateList = function () {\n return this.webRtcPeer.remoteCandidatesQueue;\n };\n /**\n * @hidden\n */\n Stream.prototype.getLocalIceCandidateList = function () {\n return this.webRtcPeer.localCandidatesQueue;\n };\n /* Private methods */\n Stream.prototype.initWebRtcPeerSend = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var userMediaConstraints = {\n audio: _this.isSendAudio(),\n video: _this.isSendVideo()\n };\n var options = {\n mediaStream: _this.mediaStream,\n mediaConstraints: userMediaConstraints,\n onicecandidate: _this.connection.sendIceCandidate.bind(_this.connection),\n iceServers: _this.getIceServersConf(),\n simulcast: false\n };\n var successCallback = function (sdpOfferParam) {\n console.debug('Sending SDP offer to publish as '\n + _this.streamId, sdpOfferParam);\n var typeOfVideo = '';\n if (_this.isSendVideo()) {\n typeOfVideo = _this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack ? 'CUSTOM' : (_this.isSendScreen() ? 'SCREEN' : 'CAMERA');\n }\n _this.session.openvidu.sendRequest('publishVideo', {\n sdpOffer: sdpOfferParam,\n doLoopback: _this.displayMyRemote() || false,\n hasAudio: _this.isSendAudio(),\n hasVideo: _this.isSendVideo(),\n audioActive: _this.audioActive,\n videoActive: _this.videoActive,\n typeOfVideo: typeOfVideo,\n frameRate: !!_this.frameRate ? _this.frameRate : -1,\n videoDimensions: JSON.stringify(_this.videoDimensions)\n }, function (error, response) {\n if (error) {\n reject('Error on publishVideo: ' + JSON.stringify(error));\n }\n else {\n _this.webRtcPeer.processAnswer(response.sdpAnswer)\n .then(function () {\n _this.streamId = response.id;\n _this.isLocalStreamPublished = true;\n if (_this.displayMyRemote()) {\n _this.remotePeerSuccessfullyEstablished();\n }\n _this.ee.emitEvent('stream-created-by-publisher');\n _this.initWebRtcStats();\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n console.info(\"'Publisher' successfully published to session\");\n }\n });\n };\n if (_this.displayMyRemote()) {\n _this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerSendrecv(options);\n }\n else {\n _this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerSendonly(options);\n }\n _this.webRtcPeer.generateOffer().then(function (offer) {\n successCallback(offer);\n })[\"catch\"](function (error) {\n reject(new Error('(publish) SDP offer error: ' + JSON.stringify(error)));\n });\n });\n };\n Stream.prototype.initWebRtcPeerReceive = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var offerConstraints = {\n audio: _this.inboundStreamOpts.hasAudio,\n video: _this.inboundStreamOpts.hasVideo\n };\n console.debug(\"'Session.subscribe(Stream)' called. Constraints of generate SDP offer\", offerConstraints);\n var options = {\n onicecandidate: _this.connection.sendIceCandidate.bind(_this.connection),\n mediaConstraints: offerConstraints,\n iceServers: _this.getIceServersConf(),\n simulcast: false\n };\n var successCallback = function (sdpOfferParam) {\n console.debug('Sending SDP offer to subscribe to '\n + _this.streamId, sdpOfferParam);\n _this.session.openvidu.sendRequest('receiveVideoFrom', {\n sender: _this.streamId,\n sdpOffer: sdpOfferParam\n }, function (error, response) {\n if (error) {\n reject(new Error('Error on recvVideoFrom: ' + JSON.stringify(error)));\n }\n else {\n _this.webRtcPeer.processAnswer(response.sdpAnswer).then(function () {\n _this.remotePeerSuccessfullyEstablished();\n _this.initWebRtcStats();\n resolve();\n })[\"catch\"](function (error) {\n reject(error);\n });\n }\n });\n };\n _this.webRtcPeer = new WebRtcPeer_1.WebRtcPeerRecvonly(options);\n _this.webRtcPeer.generateOffer()\n .then(function (offer) {\n successCallback(offer);\n })[\"catch\"](function (error) {\n reject(new Error('(subscribe) SDP offer error: ' + JSON.stringify(error)));\n });\n });\n };\n Stream.prototype.remotePeerSuccessfullyEstablished = function () {\n this.mediaStream = this.webRtcPeer.pc.getRemoteStreams()[0];\n console.debug('Peer remote stream', this.mediaStream);\n if (!!this.mediaStream) {\n this.ee.emitEvent('mediastream-updated');\n if (!this.displayMyRemote() && !!this.mediaStream.getAudioTracks()[0] && this.session.speakingEventsEnabled) {\n this.enableSpeakingEvents();\n }\n }\n };\n Stream.prototype.initWebRtcStats = function () {\n this.webRtcStats = new WebRtcStats_1.WebRtcStats(this);\n this.webRtcStats.initWebRtcStats();\n };\n Stream.prototype.stopWebRtcStats = function () {\n if (!!this.webRtcStats && this.webRtcStats.isEnabled()) {\n this.webRtcStats.stopWebRtcStats();\n }\n };\n Stream.prototype.getIceServersConf = function () {\n var returnValue;\n if (!!this.session.openvidu.advancedConfiguration.iceServers) {\n returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?\n undefined :\n this.session.openvidu.advancedConfiguration.iceServers;\n }\n else if (this.session.openvidu.iceServers) {\n returnValue = this.session.openvidu.iceServers;\n }\n else {\n returnValue = undefined;\n }\n return returnValue;\n };\n return Stream;\n}());\nexports.Stream = Stream;\n//# sourceMappingURL=Stream.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar StreamManagerEvent_1 = require(\"../OpenViduInternal/Events/StreamManagerEvent\");\nvar VideoElementEvent_1 = require(\"../OpenViduInternal/Events/VideoElementEvent\");\nvar VideoInsertMode_1 = require(\"../OpenViduInternal/Enums/VideoInsertMode\");\nvar EventEmitter = require(\"wolfy87-eventemitter\");\n/**\n * Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object.\n * You can insert as many video players fo the same Stream as you want by calling [[StreamManager.addVideoElement]] or\n * [[StreamManager.createVideoElement]].\n *\n * The use of StreamManager wrapper is particularly useful when you don't need to differentiate between Publisher or Subscriber streams or just\n * want to directly manage your own video elements (even more than one video element per Stream). This scenario is pretty common in\n * declarative, MVC frontend frameworks such as Angular, React or Vue.js\n */\nvar StreamManager = /** @class */ (function () {\n /**\n * @hidden\n */\n function StreamManager(stream, targetElement) {\n var _this = this;\n /**\n * All the videos displaying the Stream of this Publisher/Subscriber\n */\n this.videos = [];\n /**\n * @hidden\n */\n this.lazyLaunchVideoElementCreatedEvent = false;\n /**\n * @hidden\n */\n this.ee = new EventEmitter();\n this.stream = stream;\n this.stream.streamManager = this;\n this.remote = !this.stream.isLocal();\n if (!!targetElement) {\n var targEl = void 0;\n if (typeof targetElement === 'string') {\n targEl = document.getElementById(targetElement);\n }\n else if (targetElement instanceof HTMLElement) {\n targEl = targetElement;\n }\n if (!!targEl) {\n this.firstVideoElement = {\n targetElement: targEl,\n video: document.createElement('video'),\n id: ''\n };\n this.targetElement = targEl;\n this.element = targEl;\n }\n }\n this.canPlayListener = function () {\n if (_this.stream.isLocal()) {\n if (!_this.stream.displayMyRemote()) {\n console.info(\"Your local 'Stream' with id [\" + _this.stream.streamId + '] video is now playing');\n _this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'videoPlaying')]);\n }\n else {\n console.info(\"Your own remote 'Stream' with id [\" + _this.stream.streamId + '] video is now playing');\n _this.ee.emitEvent('remoteVideoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'remoteVideoPlaying')]);\n }\n }\n else {\n console.info(\"Remote 'Stream' with id [\" + _this.stream.streamId + '] video is now playing');\n _this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(_this.videos[0].video, _this, 'videoPlaying')]);\n }\n _this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(_this)]);\n };\n }\n /**\n * See [[EventDispatcher.on]]\n */\n StreamManager.prototype.on = function (type, handler) {\n var _this = this;\n this.ee.on(type, function (event) {\n if (event) {\n console.info(\"Event '\" + type + \"' triggered by '\" + (_this.remote ? 'Subscriber' : 'Publisher') + \"'\", event);\n }\n else {\n console.info(\"Event '\" + type + \"' triggered by '\" + (_this.remote ? 'Subscriber' : 'Publisher') + \"'\");\n }\n handler(event);\n });\n if (type === 'videoElementCreated') {\n if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {\n this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);\n this.lazyLaunchVideoElementCreatedEvent = false;\n }\n }\n if (type === 'streamPlaying' || type === 'videoPlaying') {\n if (this.videos[0] && this.videos[0].video &&\n this.videos[0].video.currentTime > 0 &&\n this.videos[0].video.paused === false &&\n this.videos[0].video.ended === false &&\n this.videos[0].video.readyState === 4) {\n this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(this)]);\n this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoPlaying')]);\n }\n }\n return this;\n };\n /**\n * See [[EventDispatcher.once]]\n */\n StreamManager.prototype.once = function (type, handler) {\n this.ee.once(type, function (event) {\n if (event) {\n console.info(\"Event '\" + type + \"' triggered once\", event);\n }\n else {\n console.info(\"Event '\" + type + \"' triggered once\");\n }\n handler(event);\n });\n if (type === 'videoElementCreated') {\n if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {\n this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);\n }\n }\n if (type === 'streamPlaying' || type === 'videoPlaying') {\n if (this.videos[0] && this.videos[0].video &&\n this.videos[0].video.currentTime > 0 &&\n this.videos[0].video.paused === false &&\n this.videos[0].video.ended === false &&\n this.videos[0].video.readyState === 4) {\n this.ee.emitEvent('streamPlaying', [new StreamManagerEvent_1.StreamManagerEvent(this)]);\n this.ee.emitEvent('videoPlaying', [new VideoElementEvent_1.VideoElementEvent(this.videos[0].video, this, 'videoPlaying')]);\n }\n }\n return this;\n };\n /**\n * See [[EventDispatcher.off]]\n */\n StreamManager.prototype.off = function (type, handler) {\n if (!handler) {\n this.ee.removeAllListeners(type);\n }\n else {\n this.ee.off(type, handler);\n }\n return this;\n };\n /**\n * Makes `video` element parameter display this [[stream]]. This is useful when you are\n * [managing the video elements on your own](/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players)\n *\n * Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be\n * disassociated from that previous Publisher/Subscriber and to be associated to this one.\n *\n * @returns 1 if the video wasn't associated to any other Publisher/Subscriber and has been successfully added to this one.\n * 0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other\n * Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.\n */\n StreamManager.prototype.addVideoElement = function (video) {\n this.initializeVideoProperties(video);\n // If the video element is already part of this StreamManager do nothing\n for (var _i = 0, _a = this.videos; _i < _a.length; _i++) {\n var v = _a[_i];\n if (v.video === video) {\n return 0;\n }\n }\n var returnNumber = 1;\n this.initializeVideoProperties(video);\n for (var _b = 0, _c = this.stream.session.streamManagers; _b < _c.length; _b++) {\n var streamManager = _c[_b];\n if (streamManager.disassociateVideo(video)) {\n returnNumber = -1;\n break;\n }\n }\n this.stream.session.streamManagers.forEach(function (streamManager) {\n streamManager.disassociateVideo(video);\n });\n this.pushNewStreamManagerVideo({\n video: video,\n id: video.id\n });\n console.info('New video element associated to ', this);\n return returnNumber;\n };\n /**\n * Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.\n *\n * #### Events dispatched\n *\n * The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]\n *\n * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted\n * @param insertMode How the video element will be inserted accordingly to `targetElemet`\n */\n StreamManager.prototype.createVideoElement = function (targetElement, insertMode) {\n var targEl;\n if (typeof targetElement === 'string') {\n targEl = document.getElementById(targEl);\n if (!targEl) {\n throw new Error(\"The provided 'targetElement' couldn't be resolved to any HTML element: \" + targetElement);\n }\n }\n else if (targetElement instanceof HTMLElement) {\n targEl = targetElement;\n }\n else {\n throw new Error(\"The provided 'targetElement' couldn't be resolved to any HTML element: \" + targetElement);\n }\n var video = document.createElement('video');\n this.initializeVideoProperties(video);\n var insMode = !!insertMode ? insertMode : VideoInsertMode_1.VideoInsertMode.APPEND;\n switch (insMode) {\n case VideoInsertMode_1.VideoInsertMode.AFTER:\n targEl.parentNode.insertBefore(video, targEl.nextSibling);\n break;\n case VideoInsertMode_1.VideoInsertMode.APPEND:\n targEl.appendChild(video);\n break;\n case VideoInsertMode_1.VideoInsertMode.BEFORE:\n targEl.parentNode.insertBefore(video, targEl);\n break;\n case VideoInsertMode_1.VideoInsertMode.PREPEND:\n targEl.insertBefore(video, targEl.childNodes[0]);\n break;\n case VideoInsertMode_1.VideoInsertMode.REPLACE:\n targEl.parentNode.replaceChild(video, targEl);\n break;\n default:\n insMode = VideoInsertMode_1.VideoInsertMode.APPEND;\n targEl.appendChild(video);\n break;\n }\n var v = {\n targetElement: targEl,\n video: video,\n insertMode: insMode,\n id: video.id\n };\n this.pushNewStreamManagerVideo(v);\n this.ee.emitEvent('videoElementCreated', [new VideoElementEvent_1.VideoElementEvent(v.video, this, 'videoElementCreated')]);\n this.lazyLaunchVideoElementCreatedEvent = !!this.firstVideoElement;\n return video;\n };\n /**\n * @hidden\n */\n StreamManager.prototype.initializeVideoProperties = function (video) {\n video.srcObject = this.stream.getMediaStream();\n video.autoplay = true;\n video.controls = false;\n if (!video.id) {\n video.id = (this.remote ? 'remote-' : 'local-') + 'video-' + this.stream.streamId;\n // DEPRECATED property: assign once the property id if the user provided a valid targetElement\n if (!this.id && !!this.targetElement) {\n this.id = video.id;\n }\n }\n if (!this.remote && !this.stream.displayMyRemote()) {\n video.muted = true;\n if (this.stream.outboundStreamOpts.publisherProperties.mirror) {\n this.mirrorVideo(video);\n }\n }\n };\n /**\n * @hidden\n */\n StreamManager.prototype.removeAllVideos = function () {\n var _this = this;\n for (var i = this.stream.session.streamManagers.length - 1; i >= 0; --i) {\n if (this.stream.session.streamManagers[i] === this) {\n this.stream.session.streamManagers.splice(i, 1);\n }\n }\n this.videos.slice().reverse().forEach(function (streamManagerVideo, index, videos) {\n // Remove oncanplay event listener (only OpenVidu browser one, not the user ones)\n streamManagerVideo.video.removeEventListener('canplay', _this.canPlayListener);\n if (!!streamManagerVideo.targetElement) {\n // Only remove videos created by OpenVidu Browser (those generated by passing a valid targetElement in OpenVidu.initPublisher and Session.subscribe\n // or those created by StreamManager.createVideoElement). These are also the videos that triggered a videoElementCreated event\n streamManagerVideo.video.parentNode.removeChild(streamManagerVideo.video);\n _this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent_1.VideoElementEvent(streamManagerVideo.video, _this, 'videoElementDestroyed')]);\n _this.videos.splice(videos.length - 1 - index, 1);\n }\n else {\n // Remove srcObject in all videos managed by the user\n streamManagerVideo.video.srcObject = null;\n }\n });\n };\n /**\n * @hidden\n */\n StreamManager.prototype.disassociateVideo = function (video) {\n var disassociated = false;\n for (var i = 0; i < this.videos.length; i++) {\n if (this.videos[i].video === video) {\n this.videos.splice(i, 1);\n disassociated = true;\n console.info('Video element disassociated from ', this);\n break;\n }\n }\n return disassociated;\n };\n /**\n * @hidden\n */\n StreamManager.prototype.addPlayEventToFirstVideo = function () {\n if ((!!this.videos[0]) && (!!this.videos[0].video) && (this.videos[0].video.oncanplay === null)) {\n this.videos[0].video.addEventListener('canplay', this.canPlayListener);\n }\n };\n /**\n * @hidden\n */\n StreamManager.prototype.updateMediaStream = function (mediaStream) {\n this.videos.forEach(function (streamManagerVideo) {\n streamManagerVideo.video.srcObject = mediaStream;\n });\n };\n /**\n * @hidden\n */\n StreamManager.prototype.emitEvent = function (type, eventArray) {\n this.ee.emitEvent(type, eventArray);\n };\n StreamManager.prototype.pushNewStreamManagerVideo = function (streamManagerVideo) {\n this.videos.push(streamManagerVideo);\n this.addPlayEventToFirstVideo();\n if (this.stream.session.streamManagers.indexOf(this) === -1) {\n this.stream.session.streamManagers.push(this);\n }\n };\n StreamManager.prototype.mirrorVideo = function (video) {\n video.style.transform = 'rotateY(180deg)';\n video.style.webkitTransform = 'rotateY(180deg)';\n };\n return StreamManager;\n}());\nexports.StreamManager = StreamManager;\n//# sourceMappingURL=StreamManager.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar StreamManager_1 = require(\"./StreamManager\");\n/**\n * Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method\n */\nvar Subscriber = /** @class */ (function (_super) {\n __extends(Subscriber, _super);\n /**\n * @hidden\n */\n function Subscriber(stream, targEl, properties) {\n var _this = _super.call(this, stream, targEl) || this;\n _this.element = _this.targetElement;\n _this.stream = stream;\n _this.properties = properties;\n return _this;\n }\n /**\n * Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect\n * @param value `true` to subscribe to the audio stream, `false` to unsubscribe from it\n */\n Subscriber.prototype.subscribeToAudio = function (value) {\n this.stream.getMediaStream().getAudioTracks().forEach(function (track) {\n track.enabled = value;\n });\n console.info(\"'Subscriber' has \" + (value ? 'subscribed to' : 'unsubscribed from') + ' its audio stream');\n return this;\n };\n /**\n * Subscribe or unsubscribe from the video stream (if available). Calling this method twice in a row passing same value will have no effect\n * @param value `true` to subscribe to the video stream, `false` to unsubscribe from it\n */\n Subscriber.prototype.subscribeToVideo = function (value) {\n this.stream.getMediaStream().getVideoTracks().forEach(function (track) {\n track.enabled = value;\n });\n console.info(\"'Subscriber' has \" + (value ? 'subscribed to' : 'unsubscribed from') + ' its video stream');\n return this;\n };\n return Subscriber;\n}(StreamManager_1.StreamManager));\nexports.Subscriber = Subscriber;\n//# sourceMappingURL=Subscriber.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar LocalRecorderState;\n(function (LocalRecorderState) {\n LocalRecorderState[\"READY\"] = \"READY\";\n LocalRecorderState[\"RECORDING\"] = \"RECORDING\";\n LocalRecorderState[\"PAUSED\"] = \"PAUSED\";\n LocalRecorderState[\"FINISHED\"] = \"FINISHED\";\n})(LocalRecorderState = exports.LocalRecorderState || (exports.LocalRecorderState = {}));\n//# sourceMappingURL=LocalRecorderState.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\n/**\n * Defines property [[OpenViduError.name]]\n */\nvar OpenViduErrorName;\n(function (OpenViduErrorName) {\n /**\n * Browser is not supported by OpenVidu.\n * Returned upon unsuccessful [[Session.connect]]\n */\n OpenViduErrorName[\"BROWSER_NOT_SUPPORTED\"] = \"BROWSER_NOT_SUPPORTED\";\n /**\n * The user hasn't granted permissions to the required input device when the browser asked for them.\n * Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]\n */\n OpenViduErrorName[\"DEVICE_ACCESS_DENIED\"] = \"DEVICE_ACCESS_DENIED\";\n /**\n * The user hasn't granted permissions to capture some desktop screen when the browser asked for them.\n * Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]\n */\n OpenViduErrorName[\"SCREEN_CAPTURE_DENIED\"] = \"SCREEN_CAPTURE_DENIED\";\n /**\n * Browser does not support screen sharing.\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"SCREEN_SHARING_NOT_SUPPORTED\"] = \"SCREEN_SHARING_NOT_SUPPORTED\";\n /**\n * Only for Chrome, there's no screen sharing extension installed\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"SCREEN_EXTENSION_NOT_INSTALLED\"] = \"SCREEN_EXTENSION_NOT_INSTALLED\";\n /**\n * Only for Chrome, the screen sharing extension is installed but is disabled\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"SCREEN_EXTENSION_DISABLED\"] = \"SCREEN_EXTENSION_DISABLED\";\n /**\n * No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"INPUT_VIDEO_DEVICE_NOT_FOUND\"] = \"INPUT_VIDEO_DEVICE_NOT_FOUND\";\n /**\n * No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"INPUT_AUDIO_DEVICE_NOT_FOUND\"] = \"INPUT_AUDIO_DEVICE_NOT_FOUND\";\n /**\n * Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of\n * [[PublisherProperties]] parameter both set to *false* or *null*\n */\n OpenViduErrorName[\"NO_INPUT_SOURCE_SET\"] = \"NO_INPUT_SOURCE_SET\";\n /**\n * Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported\n * by the input devices (whenever it is possible they are automatically adjusted to the most similar value).\n * Returned upon unsuccessful [[OpenVidu.initPublisher]]\n */\n OpenViduErrorName[\"PUBLISHER_PROPERTIES_ERROR\"] = \"PUBLISHER_PROPERTIES_ERROR\";\n /**\n * _Not in use yet_\n */\n OpenViduErrorName[\"OPENVIDU_PERMISSION_DENIED\"] = \"OPENVIDU_PERMISSION_DENIED\";\n /**\n * _Not in use yet_\n */\n OpenViduErrorName[\"OPENVIDU_NOT_CONNECTED\"] = \"OPENVIDU_NOT_CONNECTED\";\n /**\n * _Not in use yet_\n */\n OpenViduErrorName[\"GENERIC_ERROR\"] = \"GENERIC_ERROR\";\n})(OpenViduErrorName = exports.OpenViduErrorName || (exports.OpenViduErrorName = {}));\n/**\n * Simple object to identify runtime errors on the client side\n */\nvar OpenViduError = /** @class */ (function () {\n /**\n * @hidden\n */\n function OpenViduError(name, message) {\n this.name = name;\n this.message = message;\n }\n return OpenViduError;\n}());\nexports.OpenViduError = OpenViduError;\n//# sourceMappingURL=OpenViduError.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\n/**\n * How the video will be inserted in the DOM for Publishers and Subscribers. See [[PublisherProperties.insertMode]] and [[SubscriberProperties.insertMode]]\n */\nvar VideoInsertMode;\n(function (VideoInsertMode) {\n /**\n * Video inserted after the target element (as next sibling)\n */\n VideoInsertMode[\"AFTER\"] = \"AFTER\";\n /**\n * Video inserted as last child of the target element\n */\n VideoInsertMode[\"APPEND\"] = \"APPEND\";\n /**\n * Video inserted before the target element (as previous sibling)\n */\n VideoInsertMode[\"BEFORE\"] = \"BEFORE\";\n /**\n * Video inserted as first child of the target element\n */\n VideoInsertMode[\"PREPEND\"] = \"PREPEND\";\n /**\n * Video replaces target element\n */\n VideoInsertMode[\"REPLACE\"] = \"REPLACE\";\n})(VideoInsertMode = exports.VideoInsertMode || (exports.VideoInsertMode = {}));\n//# sourceMappingURL=VideoInsertMode.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `connectionCreated`: dispatched by [[Session]]\n * - `connectionDestroyed`: dispatched by [[Session]]\n */\nvar ConnectionEvent = /** @class */ (function (_super) {\n __extends(ConnectionEvent, _super);\n /**\n * @hidden\n */\n function ConnectionEvent(cancelable, target, type, connection, reason) {\n var _this = _super.call(this, cancelable, target, type) || this;\n _this.connection = connection;\n _this.reason = reason;\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n ConnectionEvent.prototype.callDefaultBehavior = function () { };\n return ConnectionEvent;\n}(Event_1.Event));\nexports.ConnectionEvent = ConnectionEvent;\n//# sourceMappingURL=ConnectionEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar Event = /** @class */ (function () {\n /**\n * @hidden\n */\n function Event(cancelable, target, type) {\n this.hasBeenPrevented = false;\n this.cancelable = cancelable;\n this.target = target;\n this.type = type;\n }\n /**\n * Whether the default beahivour of the event has been prevented or not. Call [[Event.preventDefault]] to prevent it\n */\n Event.prototype.isDefaultPrevented = function () {\n return this.hasBeenPrevented;\n };\n /**\n * Prevents the default behavior of the event. The following events have a default behavior:\n *\n * - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)\n * and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or\n * by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.\n *\n * - `streamDestroyed`:\n * - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`\n * in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.\n * - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)\n * and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or\n * by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.\n */\n Event.prototype.preventDefault = function () {\n // tslint:disable-next-line:no-empty\n this.callDefaultBehavior = function () { };\n this.hasBeenPrevented = true;\n };\n return Event;\n}());\nexports.Event = Event;\n//# sourceMappingURL=Event.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `publisherStartSpeaking`: dispatched by [[Session]]\n * - `publisherStopSpeaking`: dispatched by [[Session]]\n *\n * More information:\n * - This events will only be triggered for **remote streams that have audio tracks**\n * - Both events share the same lifecycle. That means that you can subscribe to only one of them if you want, but if you call `Session.off('publisherStopSpeaking')`,\n * keep in mind that this will also internally remove any 'publisherStartSpeaking' event\n * - You can further configure how the events are dispatched by setting property `publisherSpeakingEventsOptions` in the call of [[OpenVidu.setAdvancedConfiguration]]\n */\nvar PublisherSpeakingEvent = /** @class */ (function (_super) {\n __extends(PublisherSpeakingEvent, _super);\n /**\n * @hidden\n */\n function PublisherSpeakingEvent(target, type, connection, streamId) {\n var _this = _super.call(this, false, target, type) || this;\n _this.type = type;\n _this.connection = connection;\n _this.streamId = streamId;\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n PublisherSpeakingEvent.prototype.callDefaultBehavior = function () { };\n return PublisherSpeakingEvent;\n}(Event_1.Event));\nexports.PublisherSpeakingEvent = PublisherSpeakingEvent;\n//# sourceMappingURL=PublisherSpeakingEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `recordingStarted`: dispatched by [[Session]]\n * - `recordingStopped`: dispatched by [[Session]]\n */\nvar RecordingEvent = /** @class */ (function (_super) {\n __extends(RecordingEvent, _super);\n /**\n * @hidden\n */\n function RecordingEvent(target, type, id, name) {\n var _this = _super.call(this, false, target, type) || this;\n _this.id = id;\n if (name !== id) {\n _this.name = name;\n }\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n RecordingEvent.prototype.callDefaultBehavior = function () { };\n return RecordingEvent;\n}(Event_1.Event));\nexports.RecordingEvent = RecordingEvent;\n//# sourceMappingURL=RecordingEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines event `sessionDisconnected` dispatched by [[Session]]\n */\nvar SessionDisconnectedEvent = /** @class */ (function (_super) {\n __extends(SessionDisconnectedEvent, _super);\n /**\n * @hidden\n */\n function SessionDisconnectedEvent(target, reason) {\n var _this = _super.call(this, true, target, 'sessionDisconnected') || this;\n _this.reason = reason;\n return _this;\n }\n /**\n * @hidden\n */\n SessionDisconnectedEvent.prototype.callDefaultBehavior = function () {\n console.info(\"Calling default behavior upon '\" + this.type + \"' event dispatched by 'Session'\");\n var session = this.target;\n // Dispose and delete all remote Connections\n for (var connectionId in session.remoteConnections) {\n if (!!session.remoteConnections[connectionId].stream) {\n session.remoteConnections[connectionId].stream.disposeWebRtcPeer();\n session.remoteConnections[connectionId].stream.disposeMediaStream();\n if (session.remoteConnections[connectionId].stream.streamManager) {\n session.remoteConnections[connectionId].stream.streamManager.removeAllVideos();\n }\n delete session.remoteStreamsCreated[session.remoteConnections[connectionId].stream.streamId];\n session.remoteConnections[connectionId].dispose();\n }\n delete session.remoteConnections[connectionId];\n }\n };\n return SessionDisconnectedEvent;\n}(Event_1.Event));\nexports.SessionDisconnectedEvent = SessionDisconnectedEvent;\n//# sourceMappingURL=SessionDisconnectedEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `signal`: dispatched by [[Session]]\n * - `signal:TYPE`: dispatched by [[Session]]\n */\nvar SignalEvent = /** @class */ (function (_super) {\n __extends(SignalEvent, _super);\n /**\n * @hidden\n */\n function SignalEvent(target, type, data, from) {\n var _this = _super.call(this, false, target, type) || this;\n _this.type = type;\n _this.data = data;\n _this.from = from;\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n SignalEvent.prototype.callDefaultBehavior = function () { };\n return SignalEvent;\n}(Event_1.Event));\nexports.SignalEvent = SignalEvent;\n//# sourceMappingURL=SignalEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\nvar Publisher_1 = require(\"../../OpenVidu/Publisher\");\nvar Session_1 = require(\"../../OpenVidu/Session\");\n/**\n * Defines the following events:\n * - `streamCreated`: dispatched by [[Session]] and [[Publisher]]\n * - `streamDestroyed`: dispatched by [[Session]] and [[Publisher]]\n */\nvar StreamEvent = /** @class */ (function (_super) {\n __extends(StreamEvent, _super);\n /**\n * @hidden\n */\n function StreamEvent(cancelable, target, type, stream, reason) {\n var _this = _super.call(this, cancelable, target, type) || this;\n _this.stream = stream;\n _this.reason = reason;\n return _this;\n }\n /**\n * @hidden\n */\n StreamEvent.prototype.callDefaultBehavior = function () {\n if (this.type === 'streamDestroyed') {\n if (this.target instanceof Session_1.Session) {\n // Remote Stream\n console.info(\"Calling default behavior upon '\" + this.type + \"' event dispatched by 'Session'\");\n this.stream.disposeWebRtcPeer();\n }\n else if (this.target instanceof Publisher_1.Publisher) {\n // Local Stream\n console.info(\"Calling default behavior upon '\" + this.type + \"' event dispatched by 'Publisher'\");\n clearInterval(this.target.screenShareResizeInterval);\n this.stream.isLocalStreamReadyToPublish = false;\n // Delete Publisher object from OpenVidu publishers array\n var openviduPublishers = this.target.openvidu.publishers;\n for (var i = 0; i < openviduPublishers.length; i++) {\n if (openviduPublishers[i] === this.target) {\n openviduPublishers.splice(i, 1);\n break;\n }\n }\n }\n // Dispose the MediaStream local object\n this.stream.disposeMediaStream();\n // Remove from DOM all video elements associated to this Stream, if there's a StreamManager defined\n // (method Session.subscribe must have been called)\n if (this.stream.streamManager)\n this.stream.streamManager.removeAllVideos();\n // Delete stream from Session.remoteStreamsCreated map\n delete this.stream.session.remoteStreamsCreated[this.stream.streamId];\n // Delete StreamOptionsServer from remote Connection\n var remoteConnection = this.stream.session.remoteConnections[this.stream.connection.connectionId];\n if (!!remoteConnection && !!remoteConnection.options) {\n var streamOptionsServer = remoteConnection.options.streams;\n for (var i = streamOptionsServer.length - 1; i >= 0; --i) {\n if (streamOptionsServer[i].id === this.stream.streamId) {\n streamOptionsServer.splice(i, 1);\n }\n }\n }\n }\n };\n return StreamEvent;\n}(Event_1.Event));\nexports.StreamEvent = StreamEvent;\n//# sourceMappingURL=StreamEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `streamPlaying`: dispatched by [[StreamManager]] ([[Publisher]] and [[Subscriber]])\n */\nvar StreamManagerEvent = /** @class */ (function (_super) {\n __extends(StreamManagerEvent, _super);\n /**\n * @hidden\n */\n function StreamManagerEvent(target) {\n return _super.call(this, false, target, 'streamPlaying') || this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n StreamManagerEvent.prototype.callDefaultBehavior = function () { };\n return StreamManagerEvent;\n}(Event_1.Event));\nexports.StreamManagerEvent = StreamManagerEvent;\n//# sourceMappingURL=StreamManagerEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines event `streamPropertyChanged` dispatched by [[Session]] as well as by [[StreamManager]] ([[Publisher]] and [[Subscriber]]).\n * This event is fired when any remote stream (owned by a Subscriber) or local stream (owned by a Publisher) undergoes\n * any change in any of its mutable properties (see [[changedProperty]]).\n */\nvar StreamPropertyChangedEvent = /** @class */ (function (_super) {\n __extends(StreamPropertyChangedEvent, _super);\n /**\n * @hidden\n */\n function StreamPropertyChangedEvent(target, stream, changedProperty, newValue, oldValue, reason) {\n var _this = _super.call(this, false, target, 'streamPropertyChanged') || this;\n _this.stream = stream;\n _this.changedProperty = changedProperty;\n _this.newValue = newValue;\n _this.oldValue = oldValue;\n _this.reason = reason;\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n StreamPropertyChangedEvent.prototype.callDefaultBehavior = function () { };\n return StreamPropertyChangedEvent;\n}(Event_1.Event));\nexports.StreamPropertyChangedEvent = StreamPropertyChangedEvent;\n//# sourceMappingURL=StreamPropertyChangedEvent.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Event_1 = require(\"./Event\");\n/**\n * Defines the following events:\n * - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See\n * [Manage video players](/docs/how-do-i/manage-videos) section.\n * - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.\n */\nvar VideoElementEvent = /** @class */ (function (_super) {\n __extends(VideoElementEvent, _super);\n /**\n * @hidden\n */\n function VideoElementEvent(element, target, type) {\n var _this = _super.call(this, false, target, type) || this;\n _this.element = element;\n return _this;\n }\n /**\n * @hidden\n */\n // tslint:disable-next-line:no-empty\n VideoElementEvent.prototype.callDefaultBehavior = function () { };\n return VideoElementEvent;\n}(Event_1.Event));\nexports.VideoElementEvent = VideoElementEvent;\n//# sourceMappingURL=VideoElementEvent.js.map","function Mapper() {\n var sources = {};\n this.forEach = function (callback) {\n for (var key in sources) {\n var source = sources[key];\n for (var key2 in source)\n callback(source[key2]);\n }\n ;\n };\n this.get = function (id, source) {\n var ids = sources[source];\n if (ids == undefined)\n return undefined;\n return ids[id];\n };\n this.remove = function (id, source) {\n var ids = sources[source];\n if (ids == undefined)\n return;\n delete ids[id];\n for (var i in ids) {\n return false;\n }\n delete sources[source];\n };\n this.set = function (value, id, source) {\n if (value == undefined)\n return this.remove(id, source);\n var ids = sources[source];\n if (ids == undefined)\n sources[source] = ids = {};\n ids[id] = value;\n };\n}\n;\nMapper.prototype.pop = function (id, source) {\n var value = this.get(id, source);\n if (value == undefined)\n return undefined;\n this.remove(id, source);\n return value;\n};\nmodule.exports = Mapper;\n//# sourceMappingURL=Mapper.js.map","var JsonRpcClient = require('./jsonrpcclient');\nexports.JsonRpcClient = JsonRpcClient;\n//# sourceMappingURL=index.js.map","var RpcBuilder = require('../');\nvar WebSocketWithReconnection = require('./transports/webSocketWithReconnection');\nDate.now = Date.now || function () {\n return +new Date;\n};\nvar PING_INTERVAL = 5000;\nvar RECONNECTING = 'RECONNECTING';\nvar CONNECTED = 'CONNECTED';\nvar DISCONNECTED = 'DISCONNECTED';\nvar Logger = console;\nfunction JsonRpcClient(configuration) {\n var self = this;\n var wsConfig = configuration.ws;\n var notReconnectIfNumLessThan = -1;\n var pingNextNum = 0;\n var enabledPings = true;\n var pingPongStarted = false;\n var pingInterval;\n var status = DISCONNECTED;\n var onreconnecting = wsConfig.onreconnecting;\n var onreconnected = wsConfig.onreconnected;\n var onconnected = wsConfig.onconnected;\n var onerror = wsConfig.onerror;\n configuration.rpc.pull = function (params, request) {\n request.reply(null, \"push\");\n };\n wsConfig.onreconnecting = function () {\n Logger.debug(\"--------- ONRECONNECTING -----------\");\n if (status === RECONNECTING) {\n Logger.error(\"Websocket already in RECONNECTING state when receiving a new ONRECONNECTING message. Ignoring it\");\n return;\n }\n status = RECONNECTING;\n if (onreconnecting) {\n onreconnecting();\n }\n };\n wsConfig.onreconnected = function () {\n Logger.debug(\"--------- ONRECONNECTED -----------\");\n if (status === CONNECTED) {\n Logger.error(\"Websocket already in CONNECTED state when receiving a new ONRECONNECTED message. Ignoring it\");\n return;\n }\n status = CONNECTED;\n enabledPings = true;\n updateNotReconnectIfLessThan();\n usePing();\n if (onreconnected) {\n onreconnected();\n }\n };\n wsConfig.onconnected = function () {\n Logger.debug(\"--------- ONCONNECTED -----------\");\n if (status === CONNECTED) {\n Logger.error(\"Websocket already in CONNECTED state when receiving a new ONCONNECTED message. Ignoring it\");\n return;\n }\n status = CONNECTED;\n enabledPings = true;\n usePing();\n if (onconnected) {\n onconnected();\n }\n };\n wsConfig.onerror = function (error) {\n Logger.debug(\"--------- ONERROR -----------\");\n status = DISCONNECTED;\n if (onerror) {\n onerror(error);\n }\n };\n var ws = new WebSocketWithReconnection(wsConfig);\n Logger.debug('Connecting websocket to URI: ' + wsConfig.uri);\n var rpcBuilderOptions = {\n request_timeout: configuration.rpc.requestTimeout,\n ping_request_timeout: configuration.rpc.heartbeatRequestTimeout\n };\n var rpc = new RpcBuilder(RpcBuilder.packers.JsonRPC, rpcBuilderOptions, ws, function (request) {\n Logger.debug('Received request: ' + JSON.stringify(request));\n try {\n var func = configuration.rpc[request.method];\n if (func === undefined) {\n Logger.error(\"Method \" + request.method + \" not registered in client\");\n }\n else {\n func(request.params, request);\n }\n }\n catch (err) {\n Logger.error('Exception processing request: ' + JSON.stringify(request));\n Logger.error(err);\n }\n });\n this.send = function (method, params, callback) {\n if (method !== 'ping') {\n Logger.debug('Request: method:' + method + \" params:\" + JSON.stringify(params));\n }\n var requestTime = Date.now();\n rpc.encode(method, params, function (error, result) {\n if (error) {\n try {\n Logger.error(\"ERROR:\" + error.message + \" in Request: method:\" +\n method + \" params:\" + JSON.stringify(params) + \" request:\" +\n error.request);\n if (error.data) {\n Logger.error(\"ERROR DATA:\" + JSON.stringify(error.data));\n }\n }\n catch (e) { }\n error.requestTime = requestTime;\n }\n if (callback) {\n if (result != undefined && result.value !== 'pong') {\n Logger.debug('Response: ' + JSON.stringify(result));\n }\n callback(error, result);\n }\n });\n };\n function updateNotReconnectIfLessThan() {\n Logger.debug(\"notReconnectIfNumLessThan = \" + pingNextNum + ' (old=' +\n notReconnectIfNumLessThan + ')');\n notReconnectIfNumLessThan = pingNextNum;\n }\n function sendPing() {\n if (enabledPings) {\n var params = null;\n if (pingNextNum == 0 || pingNextNum == notReconnectIfNumLessThan) {\n params = {\n interval: configuration.heartbeat || PING_INTERVAL\n };\n }\n pingNextNum++;\n self.send('ping', params, (function (pingNum) {\n return function (error, result) {\n if (error) {\n Logger.debug(\"Error in ping request #\" + pingNum + \" (\" +\n error.message + \")\");\n if (pingNum > notReconnectIfNumLessThan) {\n enabledPings = false;\n updateNotReconnectIfLessThan();\n Logger.debug(\"Server did not respond to ping message #\" +\n pingNum + \". Reconnecting... \");\n ws.reconnectWs();\n }\n }\n };\n })(pingNextNum));\n }\n else {\n Logger.debug(\"Trying to send ping, but ping is not enabled\");\n }\n }\n function usePing() {\n if (!pingPongStarted) {\n Logger.debug(\"Starting ping (if configured)\");\n pingPongStarted = true;\n if (configuration.heartbeat != undefined) {\n pingInterval = setInterval(sendPing, configuration.heartbeat);\n sendPing();\n }\n }\n }\n this.close = function () {\n Logger.debug(\"Closing jsonRpcClient explicitly by client\");\n if (pingInterval != undefined) {\n Logger.debug(\"Clearing ping interval\");\n clearInterval(pingInterval);\n }\n pingPongStarted = false;\n enabledPings = false;\n if (configuration.sendCloseMessage) {\n Logger.debug(\"Sending close message\");\n this.send('closeSession', null, function (error, result) {\n if (error) {\n Logger.error(\"Error sending close message: \" + JSON.stringify(error));\n }\n ws.close();\n });\n }\n else {\n ws.close();\n }\n };\n this.forceClose = function (millis) {\n ws.forceClose(millis);\n };\n this.reconnect = function () {\n ws.reconnectWs();\n };\n}\nmodule.exports = JsonRpcClient;\n//# sourceMappingURL=jsonrpcclient.js.map","var WebSocketWithReconnection = require('./webSocketWithReconnection');\nexports.WebSocketWithReconnection = WebSocketWithReconnection;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\nvar Logger = console;\nvar MAX_RETRIES = 2000;\nvar RETRY_TIME_MS = 3000;\nvar CONNECTING = 0;\nvar OPEN = 1;\nvar CLOSING = 2;\nvar CLOSED = 3;\nfunction WebSocketWithReconnection(config) {\n var closing = false;\n var registerMessageHandler;\n var wsUri = config.uri;\n var useSockJS = config.useSockJS;\n var reconnecting = false;\n var forcingDisconnection = false;\n var ws;\n if (useSockJS) {\n ws = new SockJS(wsUri);\n }\n else {\n ws = new WebSocket(wsUri);\n }\n ws.onopen = function () {\n logConnected(ws, wsUri);\n if (config.onconnected) {\n config.onconnected();\n }\n };\n ws.onerror = function (error) {\n Logger.error(\"Could not connect to \" + wsUri + \" (invoking onerror if defined)\", error);\n if (config.onerror) {\n config.onerror(error);\n }\n };\n function logConnected(ws, wsUri) {\n try {\n Logger.debug(\"WebSocket connected to \" + wsUri);\n }\n catch (e) {\n Logger.error(e);\n }\n }\n var reconnectionOnClose = function () {\n if (ws.readyState === CLOSED) {\n if (closing) {\n Logger.debug(\"Connection closed by user\");\n }\n else {\n Logger.debug(\"Connection closed unexpectecly. Reconnecting...\");\n reconnectToSameUri(MAX_RETRIES, 1);\n }\n }\n else {\n Logger.debug(\"Close callback from previous websocket. Ignoring it\");\n }\n };\n ws.onclose = reconnectionOnClose;\n function reconnectToSameUri(maxRetries, numRetries) {\n Logger.debug(\"reconnectToSameUri (attempt #\" + numRetries + \", max=\" + maxRetries + \")\");\n if (numRetries === 1) {\n if (reconnecting) {\n Logger.warn(\"Trying to reconnectToNewUri when reconnecting... Ignoring this reconnection.\");\n return;\n }\n else {\n reconnecting = true;\n }\n if (config.onreconnecting) {\n config.onreconnecting();\n }\n }\n if (forcingDisconnection) {\n reconnectToNewUri(maxRetries, numRetries, wsUri);\n }\n else {\n if (config.newWsUriOnReconnection) {\n config.newWsUriOnReconnection(function (error, newWsUri) {\n if (error) {\n Logger.debug(error);\n setTimeout(function () {\n reconnectToSameUri(maxRetries, numRetries + 1);\n }, RETRY_TIME_MS);\n }\n else {\n reconnectToNewUri(maxRetries, numRetries, newWsUri);\n }\n });\n }\n else {\n reconnectToNewUri(maxRetries, numRetries, wsUri);\n }\n }\n }\n function reconnectToNewUri(maxRetries, numRetries, reconnectWsUri) {\n Logger.debug(\"Reconnection attempt #\" + numRetries);\n ws.close();\n wsUri = reconnectWsUri || wsUri;\n var newWs;\n if (useSockJS) {\n newWs = new SockJS(wsUri);\n }\n else {\n newWs = new WebSocket(wsUri);\n }\n newWs.onopen = function () {\n Logger.debug(\"Reconnected after \" + numRetries + \" attempts...\");\n logConnected(newWs, wsUri);\n reconnecting = false;\n registerMessageHandler();\n if (config.onreconnected()) {\n config.onreconnected();\n }\n newWs.onclose = reconnectionOnClose;\n };\n var onErrorOrClose = function (error) {\n Logger.warn(\"Reconnection error: \", error);\n if (numRetries === maxRetries) {\n if (config.ondisconnect) {\n config.ondisconnect();\n }\n }\n else {\n setTimeout(function () {\n reconnectToSameUri(maxRetries, numRetries + 1);\n }, RETRY_TIME_MS);\n }\n };\n newWs.onerror = onErrorOrClose;\n ws = newWs;\n }\n this.close = function () {\n closing = true;\n ws.close();\n };\n this.forceClose = function (millis) {\n Logger.debug(\"Testing: Force WebSocket close\");\n if (millis) {\n Logger.debug(\"Testing: Change wsUri for \" + millis + \" millis to simulate net failure\");\n var goodWsUri = wsUri;\n wsUri = \"wss://21.234.12.34.4:443/\";\n forcingDisconnection = true;\n setTimeout(function () {\n Logger.debug(\"Testing: Recover good wsUri \" + goodWsUri);\n wsUri = goodWsUri;\n forcingDisconnection = false;\n }, millis);\n }\n ws.close();\n };\n this.reconnectWs = function () {\n Logger.debug(\"reconnectWs\");\n reconnectToSameUri(MAX_RETRIES, 1, wsUri);\n };\n this.send = function (message) {\n ws.send(message);\n };\n this.addEventListener = function (type, callback) {\n registerMessageHandler = function () {\n ws.addEventListener(type, callback);\n };\n registerMessageHandler();\n };\n}\nmodule.exports = WebSocketWithReconnection;\n//# sourceMappingURL=webSocketWithReconnection.js.map","var defineProperty_IE8 = false;\nif (Object.defineProperty) {\n try {\n Object.defineProperty({}, \"x\", {});\n }\n catch (e) {\n defineProperty_IE8 = true;\n }\n}\nif (!Function.prototype.bind) {\n Function.prototype.bind = function (oThis) {\n if (typeof this !== 'function') {\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function () { }, fBound = function () {\n return fToBind.apply(this instanceof fNOP && oThis\n ? this\n : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n fNOP.prototype = this.prototype;\n fBound.prototype = new fNOP();\n return fBound;\n };\n}\nvar EventEmitter = require('events').EventEmitter;\nvar inherits = require('inherits');\nvar packers = require('./packers');\nvar Mapper = require('./Mapper');\nvar BASE_TIMEOUT = 5000;\nfunction unifyResponseMethods(responseMethods) {\n if (!responseMethods)\n return {};\n for (var key in responseMethods) {\n var value = responseMethods[key];\n if (typeof value == 'string')\n responseMethods[key] =\n {\n response: value\n };\n }\n ;\n return responseMethods;\n}\n;\nfunction unifyTransport(transport) {\n if (!transport)\n return;\n if (transport instanceof Function)\n return { send: transport };\n if (transport.send instanceof Function)\n return transport;\n if (transport.postMessage instanceof Function) {\n transport.send = transport.postMessage;\n return transport;\n }\n if (transport.write instanceof Function) {\n transport.send = transport.write;\n return transport;\n }\n if (transport.onmessage !== undefined)\n return;\n if (transport.pause instanceof Function)\n return;\n throw new SyntaxError(\"Transport is not a function nor a valid object\");\n}\n;\nfunction RpcNotification(method, params) {\n if (defineProperty_IE8) {\n this.method = method;\n this.params = params;\n }\n else {\n Object.defineProperty(this, 'method', { value: method, enumerable: true });\n Object.defineProperty(this, 'params', { value: params, enumerable: true });\n }\n}\n;\nfunction RpcBuilder(packer, options, transport, onRequest) {\n var self = this;\n if (!packer)\n throw new SyntaxError('Packer is not defined');\n if (!packer.pack || !packer.unpack)\n throw new SyntaxError('Packer is invalid');\n var responseMethods = unifyResponseMethods(packer.responseMethods);\n if (options instanceof Function) {\n if (transport != undefined)\n throw new SyntaxError(\"There can't be parameters after onRequest\");\n onRequest = options;\n transport = undefined;\n options = undefined;\n }\n ;\n if (options && options.send instanceof Function) {\n if (transport && !(transport instanceof Function))\n throw new SyntaxError(\"Only a function can be after transport\");\n onRequest = transport;\n transport = options;\n options = undefined;\n }\n ;\n if (transport instanceof Function) {\n if (onRequest != undefined)\n throw new SyntaxError(\"There can't be parameters after onRequest\");\n onRequest = transport;\n transport = undefined;\n }\n ;\n if (transport && transport.send instanceof Function)\n if (onRequest && !(onRequest instanceof Function))\n throw new SyntaxError(\"Only a function can be after transport\");\n options = options || {};\n EventEmitter.call(this);\n if (onRequest)\n this.on('request', onRequest);\n if (defineProperty_IE8)\n this.peerID = options.peerID;\n else\n Object.defineProperty(this, 'peerID', { value: options.peerID });\n var max_retries = options.max_retries || 0;\n function transportMessage(event) {\n self.decode(event.data || event);\n }\n ;\n this.getTransport = function () {\n return transport;\n };\n this.setTransport = function (value) {\n if (transport) {\n if (transport.removeEventListener)\n transport.removeEventListener('message', transportMessage);\n else if (transport.removeListener)\n transport.removeListener('data', transportMessage);\n }\n ;\n if (value) {\n if (value.addEventListener)\n value.addEventListener('message', transportMessage);\n else if (value.addListener)\n value.addListener('data', transportMessage);\n }\n ;\n transport = unifyTransport(value);\n };\n if (!defineProperty_IE8)\n Object.defineProperty(this, 'transport', {\n get: this.getTransport.bind(this),\n set: this.setTransport.bind(this)\n });\n this.setTransport(transport);\n var request_timeout = options.request_timeout || BASE_TIMEOUT;\n var ping_request_timeout = options.ping_request_timeout || request_timeout;\n var response_timeout = options.response_timeout || BASE_TIMEOUT;\n var duplicates_timeout = options.duplicates_timeout || BASE_TIMEOUT;\n var requestID = 0;\n var requests = new Mapper();\n var responses = new Mapper();\n var processedResponses = new Mapper();\n var message2Key = {};\n function storeResponse(message, id, dest) {\n var response = {\n message: message,\n timeout: setTimeout(function () {\n responses.remove(id, dest);\n }, response_timeout)\n };\n responses.set(response, id, dest);\n }\n ;\n function storeProcessedResponse(ack, from) {\n var timeout = setTimeout(function () {\n processedResponses.remove(ack, from);\n }, duplicates_timeout);\n processedResponses.set(timeout, ack, from);\n }\n ;\n function RpcRequest(method, params, id, from, transport) {\n RpcNotification.call(this, method, params);\n this.getTransport = function () {\n return transport;\n };\n this.setTransport = function (value) {\n transport = unifyTransport(value);\n };\n if (!defineProperty_IE8)\n Object.defineProperty(this, 'transport', {\n get: this.getTransport.bind(this),\n set: this.setTransport.bind(this)\n });\n var response = responses.get(id, from);\n if (!(transport || self.getTransport())) {\n if (defineProperty_IE8)\n this.duplicated = Boolean(response);\n else\n Object.defineProperty(this, 'duplicated', {\n value: Boolean(response)\n });\n }\n var responseMethod = responseMethods[method];\n this.pack = packer.pack.bind(packer, this, id);\n this.reply = function (error, result, transport) {\n if (error instanceof Function || error && error.send instanceof Function) {\n if (result != undefined)\n throw new SyntaxError(\"There can't be parameters after callback\");\n transport = error;\n result = null;\n error = undefined;\n }\n else if (result instanceof Function\n || result && result.send instanceof Function) {\n if (transport != undefined)\n throw new SyntaxError(\"There can't be parameters after callback\");\n transport = result;\n result = null;\n }\n ;\n transport = unifyTransport(transport);\n if (response)\n clearTimeout(response.timeout);\n if (from != undefined) {\n if (error)\n error.dest = from;\n if (result)\n result.dest = from;\n }\n ;\n var message;\n if (error || result != undefined) {\n if (self.peerID != undefined) {\n if (error)\n error.from = self.peerID;\n else\n result.from = self.peerID;\n }\n if (responseMethod) {\n if (responseMethod.error == undefined && error)\n message =\n {\n error: error\n };\n else {\n var method = error\n ? responseMethod.error\n : responseMethod.response;\n message =\n {\n method: method,\n params: error || result\n };\n }\n }\n else\n message =\n {\n error: error,\n result: result\n };\n message = packer.pack(message, id);\n }\n else if (response)\n message = response.message;\n else\n message = packer.pack({ result: null }, id);\n storeResponse(message, id, from);\n transport = transport || this.getTransport() || self.getTransport();\n if (transport)\n return transport.send(message);\n return message;\n };\n }\n ;\n inherits(RpcRequest, RpcNotification);\n function cancel(message) {\n var key = message2Key[message];\n if (!key)\n return;\n delete message2Key[message];\n var request = requests.pop(key.id, key.dest);\n if (!request)\n return;\n clearTimeout(request.timeout);\n storeProcessedResponse(key.id, key.dest);\n }\n ;\n this.cancel = function (message) {\n if (message)\n return cancel(message);\n for (var message in message2Key)\n cancel(message);\n };\n this.close = function () {\n var transport = this.getTransport();\n if (transport && transport.close)\n transport.close();\n this.cancel();\n processedResponses.forEach(clearTimeout);\n responses.forEach(function (response) {\n clearTimeout(response.timeout);\n });\n };\n this.encode = function (method, params, dest, transport, callback) {\n if (params instanceof Function) {\n if (dest != undefined)\n throw new SyntaxError(\"There can't be parameters after callback\");\n callback = params;\n transport = undefined;\n dest = undefined;\n params = undefined;\n }\n else if (dest instanceof Function) {\n if (transport != undefined)\n throw new SyntaxError(\"There can't be parameters after callback\");\n callback = dest;\n transport = undefined;\n dest = undefined;\n }\n else if (transport instanceof Function) {\n if (callback != undefined)\n throw new SyntaxError(\"There can't be parameters after callback\");\n callback = transport;\n transport = undefined;\n }\n ;\n if (self.peerID != undefined) {\n params = params || {};\n params.from = self.peerID;\n }\n ;\n if (dest != undefined) {\n params = params || {};\n params.dest = dest;\n }\n ;\n var message = {\n method: method,\n params: params\n };\n if (callback) {\n var id = requestID++;\n var retried = 0;\n message = packer.pack(message, id);\n function dispatchCallback(error, result) {\n self.cancel(message);\n callback(error, result);\n }\n ;\n var request = {\n message: message,\n callback: dispatchCallback,\n responseMethods: responseMethods[method] || {}\n };\n var encode_transport = unifyTransport(transport);\n function sendRequest(transport) {\n var rt = (method === 'ping' ? ping_request_timeout : request_timeout);\n request.timeout = setTimeout(timeout, rt * Math.pow(2, retried++));\n message2Key[message] = { id: id, dest: dest };\n requests.set(request, id, dest);\n transport = transport || encode_transport || self.getTransport();\n if (transport)\n return transport.send(message);\n return message;\n }\n ;\n function retry(transport) {\n transport = unifyTransport(transport);\n console.warn(retried + ' retry for request message:', message);\n var timeout = processedResponses.pop(id, dest);\n clearTimeout(timeout);\n return sendRequest(transport);\n }\n ;\n function timeout() {\n if (retried < max_retries)\n return retry(transport);\n var error = new Error('Request has timed out');\n error.request = message;\n error.retry = retry;\n dispatchCallback(error);\n }\n ;\n return sendRequest(transport);\n }\n ;\n message = packer.pack(message);\n transport = transport || this.getTransport();\n if (transport)\n return transport.send(message);\n return message;\n };\n this.decode = function (message, transport) {\n if (!message)\n throw new TypeError(\"Message is not defined\");\n try {\n message = packer.unpack(message);\n }\n catch (e) {\n return console.debug(e, message);\n }\n ;\n var id = message.id;\n var ack = message.ack;\n var method = message.method;\n var params = message.params || {};\n var from = params.from;\n var dest = params.dest;\n if (self.peerID != undefined && from == self.peerID)\n return;\n if (id == undefined && ack == undefined) {\n var notification = new RpcNotification(method, params);\n if (self.emit('request', notification))\n return;\n return notification;\n }\n ;\n function processRequest() {\n transport = unifyTransport(transport) || self.getTransport();\n if (transport) {\n var response = responses.get(id, from);\n if (response)\n return transport.send(response.message);\n }\n ;\n var idAck = (id != undefined) ? id : ack;\n var request = new RpcRequest(method, params, idAck, from, transport);\n if (self.emit('request', request))\n return;\n return request;\n }\n ;\n function processResponse(request, error, result) {\n request.callback(error, result);\n }\n ;\n function duplicatedResponse(timeout) {\n console.warn(\"Response already processed\", message);\n clearTimeout(timeout);\n storeProcessedResponse(ack, from);\n }\n ;\n if (method) {\n if (dest == undefined || dest == self.peerID) {\n var request = requests.get(ack, from);\n if (request) {\n var responseMethods = request.responseMethods;\n if (method == responseMethods.error)\n return processResponse(request, params);\n if (method == responseMethods.response)\n return processResponse(request, null, params);\n return processRequest();\n }\n var processed = processedResponses.get(ack, from);\n if (processed)\n return duplicatedResponse(processed);\n }\n return processRequest();\n }\n ;\n var error = message.error;\n var result = message.result;\n if (error && error.dest && error.dest != self.peerID)\n return;\n if (result && result.dest && result.dest != self.peerID)\n return;\n var request = requests.get(ack, from);\n if (!request) {\n var processed = processedResponses.get(ack, from);\n if (processed)\n return duplicatedResponse(processed);\n return console.warn(\"No callback was defined for this message\", message);\n }\n ;\n processResponse(request, error, result);\n };\n}\n;\ninherits(RpcBuilder, EventEmitter);\nRpcBuilder.RpcNotification = RpcNotification;\nmodule.exports = RpcBuilder;\nvar clients = require('./clients');\nvar transports = require('./clients/transports');\nRpcBuilder.clients = clients;\nRpcBuilder.clients.transports = transports;\nRpcBuilder.packers = packers;\n//# sourceMappingURL=index.js.map","function pack(message, id) {\n var result = {\n jsonrpc: \"2.0\"\n };\n if (message.method) {\n result.method = message.method;\n if (message.params)\n result.params = message.params;\n if (id != undefined)\n result.id = id;\n }\n else if (id != undefined) {\n if (message.error) {\n if (message.result !== undefined)\n throw new TypeError(\"Both result and error are defined\");\n result.error = message.error;\n }\n else if (message.result !== undefined)\n result.result = message.result;\n else\n throw new TypeError(\"No result or error is defined\");\n result.id = id;\n }\n ;\n return JSON.stringify(result);\n}\n;\nfunction unpack(message) {\n var result = message;\n if (typeof message === 'string' || message instanceof String) {\n result = JSON.parse(message);\n }\n var version = result.jsonrpc;\n if (version !== '2.0')\n throw new TypeError(\"Invalid JsonRPC version '\" + version + \"': \" + message);\n if (result.method == undefined) {\n if (result.id == undefined)\n throw new TypeError(\"Invalid message: \" + message);\n var result_defined = result.result !== undefined;\n var error_defined = result.error !== undefined;\n if (result_defined && error_defined)\n throw new TypeError(\"Both result and error are defined: \" + message);\n if (!result_defined && !error_defined)\n throw new TypeError(\"No result or error is defined: \" + message);\n result.ack = result.id;\n delete result.id;\n }\n return result;\n}\n;\nexports.pack = pack;\nexports.unpack = unpack;\n//# sourceMappingURL=JsonRPC.js.map","function pack(message) {\n throw new TypeError(\"Not yet implemented\");\n}\n;\nfunction unpack(message) {\n throw new TypeError(\"Not yet implemented\");\n}\n;\nexports.pack = pack;\nexports.unpack = unpack;\n//# sourceMappingURL=XmlRPC.js.map","var JsonRPC = require('./JsonRPC');\nvar XmlRPC = require('./XmlRPC');\nexports.JsonRPC = JsonRPC;\nexports.XmlRPC = XmlRPC;\n//# sourceMappingURL=index.js.map","window.getScreenId = function (callback, custom_parameter) {\n if (navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob)) {\n callback({\n video: true\n });\n return;\n }\n if (!!navigator.mozGetUserMedia) {\n callback(null, 'firefox', {\n video: {\n mozMediaSource: 'window',\n mediaSource: 'window'\n }\n });\n return;\n }\n window.addEventListener('message', onIFrameCallback);\n function onIFrameCallback(event) {\n if (!event.data)\n return;\n if (event.data.chromeMediaSourceId) {\n if (event.data.chromeMediaSourceId === 'PermissionDeniedError') {\n callback('permission-denied');\n }\n else {\n callback(null, event.data.chromeMediaSourceId, getScreenConstraints(null, event.data.chromeMediaSourceId, event.data.canRequestAudioTrack));\n }\n window.removeEventListener('message', onIFrameCallback);\n }\n if (event.data.chromeExtensionStatus) {\n callback(event.data.chromeExtensionStatus, null, getScreenConstraints(event.data.chromeExtensionStatus));\n window.removeEventListener('message', onIFrameCallback);\n }\n }\n if (!custom_parameter) {\n setTimeout(postGetSourceIdMessage, 100);\n }\n else {\n setTimeout(function () {\n postGetSourceIdMessage(custom_parameter);\n }, 100);\n }\n};\nfunction getScreenConstraints(error, sourceId, canRequestAudioTrack) {\n var screen_constraints = {\n audio: false,\n video: {\n mandatory: {\n chromeMediaSource: error ? 'screen' : 'desktop',\n maxWidth: window.screen.width > 1920 ? window.screen.width : 1920,\n maxHeight: window.screen.height > 1080 ? window.screen.height : 1080\n },\n optional: []\n }\n };\n if (!!canRequestAudioTrack) {\n screen_constraints.audio = {\n mandatory: {\n chromeMediaSource: error ? 'screen' : 'desktop',\n },\n optional: []\n };\n }\n if (sourceId) {\n screen_constraints.video.mandatory.chromeMediaSourceId = sourceId;\n if (screen_constraints.audio && screen_constraints.audio.mandatory) {\n screen_constraints.audio.mandatory.chromeMediaSourceId = sourceId;\n }\n }\n return screen_constraints;\n}\nfunction postGetSourceIdMessage(custom_parameter) {\n if (!iframe) {\n loadIFrame(function () {\n postGetSourceIdMessage(custom_parameter);\n });\n return;\n }\n if (!iframe.isLoaded) {\n setTimeout(function () {\n postGetSourceIdMessage(custom_parameter);\n }, 100);\n return;\n }\n if (!custom_parameter) {\n iframe.contentWindow.postMessage({\n captureSourceId: true\n }, '*');\n }\n else if (!!custom_parameter.forEach) {\n iframe.contentWindow.postMessage({\n captureCustomSourceId: custom_parameter\n }, '*');\n }\n else {\n iframe.contentWindow.postMessage({\n captureSourceIdWithAudio: true\n }, '*');\n }\n}\nvar iframe;\nwindow.getScreenConstraints = function (callback) {\n loadIFrame(function () {\n getScreenId(function (error, sourceId, screen_constraints) {\n if (!screen_constraints) {\n screen_constraints = {\n video: true\n };\n }\n callback(error, screen_constraints.video);\n });\n });\n};\nfunction loadIFrame(loadCallback) {\n if (iframe) {\n loadCallback();\n return;\n }\n iframe = document.createElement('iframe');\n iframe.onload = function () {\n iframe.isLoaded = true;\n loadCallback();\n };\n iframe.src = 'https://openvidu.github.io/openvidu-screen-sharing-chrome-extension/';\n iframe.style.display = 'none';\n (document.body || document.documentElement).appendChild(iframe);\n}\nwindow.getChromeExtensionStatus = function (callback) {\n if (!!navigator.mozGetUserMedia) {\n callback('installed-enabled');\n return;\n }\n window.addEventListener('message', onIFrameCallback);\n function onIFrameCallback(event) {\n if (!event.data)\n return;\n if (event.data.chromeExtensionStatus) {\n callback(event.data.chromeExtensionStatus);\n window.removeEventListener('message', onIFrameCallback);\n }\n }\n setTimeout(postGetChromeExtensionStatusMessage, 100);\n};\nfunction postGetChromeExtensionStatusMessage() {\n if (!iframe) {\n loadIFrame(postGetChromeExtensionStatusMessage);\n return;\n }\n if (!iframe.isLoaded) {\n setTimeout(postGetChromeExtensionStatusMessage, 100);\n return;\n }\n iframe.contentWindow.postMessage({\n getChromeExtensionStatus: true\n }, '*');\n}\nexports.getScreenId = getScreenId;\n//# sourceMappingURL=Screen-Capturing-Auto.js.map","var chromeMediaSource = 'screen';\nvar sourceId;\nvar screenCallback;\nvar isFirefox = typeof window.InstallTrigger !== 'undefined';\nvar isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\nvar isChrome = !!window.chrome && !isOpera;\nwindow.addEventListener('message', function (event) {\n if (event.origin != window.location.origin) {\n return;\n }\n onMessageCallback(event.data);\n});\nfunction onMessageCallback(data) {\n if (data == 'PermissionDeniedError') {\n if (screenCallback)\n return screenCallback('PermissionDeniedError');\n else\n throw new Error('PermissionDeniedError');\n }\n if (data == 'rtcmulticonnection-extension-loaded') {\n chromeMediaSource = 'desktop';\n }\n if (data.sourceId && screenCallback) {\n screenCallback(sourceId = data.sourceId, data.canRequestAudioTrack === true);\n }\n}\nfunction isChromeExtensionAvailable(callback) {\n if (!callback)\n return;\n if (chromeMediaSource == 'desktop')\n return callback(true);\n window.postMessage('are-you-there', '*');\n setTimeout(function () {\n if (chromeMediaSource == 'screen') {\n callback(false);\n }\n else\n callback(true);\n }, 2000);\n}\nfunction getSourceId(callback) {\n if (!callback)\n throw '\"callback\" parameter is mandatory.';\n if (sourceId)\n return callback(sourceId);\n screenCallback = callback;\n window.postMessage('get-sourceId', '*');\n}\nfunction getCustomSourceId(arr, callback) {\n if (!arr || !arr.forEach)\n throw '\"arr\" parameter is mandatory and it must be an array.';\n if (!callback)\n throw '\"callback\" parameter is mandatory.';\n if (sourceId)\n return callback(sourceId);\n screenCallback = callback;\n window.postMessage({\n 'get-custom-sourceId': arr\n }, '*');\n}\nfunction getSourceIdWithAudio(callback) {\n if (!callback)\n throw '\"callback\" parameter is mandatory.';\n if (sourceId)\n return callback(sourceId);\n screenCallback = callback;\n window.postMessage('audio-plus-tab', '*');\n}\nfunction getChromeExtensionStatus(extensionid, callback) {\n if (isFirefox)\n return callback('not-chrome');\n if (arguments.length != 2) {\n callback = extensionid;\n extensionid = 'lfcgfepafnobdloecchnfaclibenjold';\n }\n var image = document.createElement('img');\n image.src = 'chrome-extension://' + extensionid + '/icon.png';\n image.onload = function () {\n chromeMediaSource = 'screen';\n window.postMessage('are-you-there', '*');\n setTimeout(function () {\n if (chromeMediaSource == 'screen') {\n callback('installed-disabled');\n }\n else\n callback('installed-enabled');\n }, 2000);\n };\n image.onerror = function () {\n callback('not-installed');\n };\n}\nfunction getScreenConstraintsWithAudio(callback) {\n getScreenConstraints(callback, true);\n}\nfunction getScreenConstraints(callback, captureSourceIdWithAudio) {\n sourceId = '';\n var firefoxScreenConstraints = {\n mozMediaSource: 'window',\n mediaSource: 'window'\n };\n if (isFirefox)\n return callback(null, firefoxScreenConstraints);\n var screen_constraints = {\n mandatory: {\n chromeMediaSource: chromeMediaSource,\n maxWidth: screen.width > 1920 ? screen.width : 1920,\n maxHeight: screen.height > 1080 ? screen.height : 1080\n },\n optional: []\n };\n if (chromeMediaSource == 'desktop' && !sourceId) {\n if (captureSourceIdWithAudio) {\n getSourceIdWithAudio(function (sourceId, canRequestAudioTrack) {\n screen_constraints.mandatory.chromeMediaSourceId = sourceId;\n if (canRequestAudioTrack) {\n screen_constraints.canRequestAudioTrack = true;\n }\n callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);\n });\n }\n else {\n getSourceId(function (sourceId) {\n screen_constraints.mandatory.chromeMediaSourceId = sourceId;\n callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);\n });\n }\n return;\n }\n if (chromeMediaSource == 'desktop') {\n screen_constraints.mandatory.chromeMediaSourceId = sourceId;\n }\n callback(null, screen_constraints);\n}\nexports.getScreenConstraints = getScreenConstraints;\nexports.getScreenConstraintsWithAudio = getScreenConstraintsWithAudio;\nexports.isChromeExtensionAvailable = isChromeExtensionAvailable;\nexports.getChromeExtensionStatus = getChromeExtensionStatus;\nexports.getSourceId = getSourceId;\n//# sourceMappingURL=Screen-Capturing.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar freeice = require(\"freeice\");\nvar uuid = require(\"uuid\");\nvar platform = require(\"platform\");\nvar WebRtcPeer = /** @class */ (function () {\n function WebRtcPeer(configuration) {\n var _this = this;\n this.configuration = configuration;\n this.remoteCandidatesQueue = [];\n this.localCandidatesQueue = [];\n this.iceCandidateList = [];\n this.candidategatheringdone = false;\n this.configuration.iceServers = (!!this.configuration.iceServers && this.configuration.iceServers.length > 0) ? this.configuration.iceServers : freeice();\n this.pc = new RTCPeerConnection({ iceServers: this.configuration.iceServers });\n this.id = !!configuration.id ? configuration.id : uuid.v4();\n this.pc.onicecandidate = function (event) {\n var candidate = event.candidate;\n if (candidate) {\n _this.localCandidatesQueue.push({ candidate: candidate.candidate });\n _this.candidategatheringdone = false;\n _this.configuration.onicecandidate(event.candidate);\n }\n else if (!_this.candidategatheringdone) {\n _this.candidategatheringdone = true;\n }\n };\n this.pc.onsignalingstatechange = function () {\n if (_this.pc.signalingState === 'stable') {\n while (_this.iceCandidateList.length > 0) {\n _this.pc.addIceCandidate(_this.iceCandidateList.shift());\n }\n }\n };\n this.start();\n }\n /**\n * This function creates the RTCPeerConnection object taking into account the\n * properties received in the constructor. It starts the SDP negotiation\n * process: generates the SDP offer and invokes the onsdpoffer callback. This\n * callback is expected to send the SDP offer, in order to obtain an SDP\n * answer from another peer.\n */\n WebRtcPeer.prototype.start = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.pc.signalingState === 'closed') {\n reject('The peer connection object is in \"closed\" state. This is most likely due to an invocation of the dispose method before accepting in the dialogue');\n }\n if (!!_this.configuration.mediaStream) {\n _this.pc.addStream(_this.configuration.mediaStream);\n }\n // [Hack] https://code.google.com/p/chromium/issues/detail?id=443558\n if (_this.configuration.mode === 'sendonly' &&\n (platform.name === 'Chrome' && platform.version.toString().substring(0, 2) === '39')) {\n _this.configuration.mode = 'sendrecv';\n }\n resolve();\n });\n };\n /**\n * This method frees the resources used by WebRtcPeer\n */\n WebRtcPeer.prototype.dispose = function () {\n var _this = this;\n console.debug('Disposing WebRtcPeer');\n try {\n if (this.pc) {\n if (this.pc.signalingState === 'closed') {\n return;\n }\n this.remoteCandidatesQueue = [];\n this.localCandidatesQueue = [];\n this.pc.getLocalStreams().forEach(function (str) {\n _this.streamStop(str);\n });\n // FIXME This is not yet implemented in firefox\n // if(videoStream) pc.removeStream(videoStream);\n // if(audioStream) pc.removeStream(audioStream);\n this.pc.close();\n }\n }\n catch (err) {\n console.warn('Exception disposing webrtc peer ' + err);\n }\n };\n /**\n * 1) Function that creates an offer, sets it as local description and returns the offer param\n * to send to OpenVidu Server (will be the remote description of other peer)\n */\n WebRtcPeer.prototype.generateOffer = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var offerAudio, offerVideo = true;\n // Constraints must have both blocks\n if (!!_this.configuration.mediaConstraints) {\n offerAudio = (typeof _this.configuration.mediaConstraints.audio === 'boolean') ?\n _this.configuration.mediaConstraints.audio : true;\n offerVideo = (typeof _this.configuration.mediaConstraints.video === 'boolean') ?\n _this.configuration.mediaConstraints.video : true;\n }\n var constraints = {\n offerToReceiveAudio: +(_this.configuration.mode !== 'sendonly' && offerAudio),\n offerToReceiveVideo: +(_this.configuration.mode !== 'sendonly' && offerVideo)\n };\n console.debug('RTCPeerConnection constraints: ' + JSON.stringify(constraints));\n _this.pc.createOffer(constraints).then(function (offer) {\n console.debug('Created SDP offer');\n return _this.pc.setLocalDescription(offer);\n }).then(function () {\n var localDescription = _this.pc.localDescription;\n if (!!localDescription) {\n console.debug('Local description set', localDescription.sdp);\n resolve(localDescription.sdp);\n }\n else {\n reject('Local description is not defined');\n }\n })[\"catch\"](function (error) { return reject(error); });\n });\n };\n /**\n * 2) Function to invoke when a SDP offer is received. Sets it as remote description,\n * generates and answer and returns it to send it to OpenVidu Server\n */\n WebRtcPeer.prototype.processOffer = function (sdpOffer) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var offer = {\n type: 'offer',\n sdp: sdpOffer\n };\n console.debug('SDP offer received, setting remote description');\n if (_this.pc.signalingState === 'closed') {\n reject('PeerConnection is closed');\n }\n _this.pc.setRemoteDescription(offer)\n .then(function () {\n return _this.pc.createAnswer();\n }).then(function (answer) {\n console.debug('Created SDP answer');\n return _this.pc.setLocalDescription(answer);\n }).then(function () {\n var localDescription = _this.pc.localDescription;\n if (!!localDescription) {\n console.debug('Local description set', localDescription.sdp);\n resolve(localDescription.sdp);\n }\n else {\n reject('Local description is not defined');\n }\n })[\"catch\"](function (error) { return reject(error); });\n });\n };\n /**\n * 3) Function invoked when a SDP answer is received. Final step in SDP negotiation, the peer\n * just needs to set the answer as its remote description\n */\n WebRtcPeer.prototype.processAnswer = function (sdpAnswer) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var answer = {\n type: 'answer',\n sdp: sdpAnswer\n };\n console.debug('SDP answer received, setting remote description');\n if (_this.pc.signalingState === 'closed') {\n reject('RTCPeerConnection is closed');\n }\n _this.pc.setRemoteDescription(answer).then(function () { return resolve(); })[\"catch\"](function (error) { return reject(error); });\n });\n };\n /**\n * Callback function invoked when an ICE candidate is received\n */\n WebRtcPeer.prototype.addIceCandidate = function (iceCandidate) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n console.debug('Remote ICE candidate received', iceCandidate);\n _this.remoteCandidatesQueue.push(iceCandidate);\n switch (_this.pc.signalingState) {\n case 'closed':\n reject(new Error('PeerConnection object is closed'));\n break;\n case 'stable':\n if (!!_this.pc.remoteDescription) {\n _this.pc.addIceCandidate(iceCandidate).then(function () { return resolve(); })[\"catch\"](function (error) { return reject(error); });\n }\n break;\n default:\n _this.iceCandidateList.push(iceCandidate);\n resolve();\n }\n });\n };\n WebRtcPeer.prototype.streamStop = function (stream) {\n stream.getTracks().forEach(function (track) {\n track.stop();\n stream.removeTrack(track);\n });\n };\n return WebRtcPeer;\n}());\nexports.WebRtcPeer = WebRtcPeer;\nvar WebRtcPeerRecvonly = /** @class */ (function (_super) {\n __extends(WebRtcPeerRecvonly, _super);\n function WebRtcPeerRecvonly(configuration) {\n var _this = this;\n configuration.mode = 'recvonly';\n _this = _super.call(this, configuration) || this;\n return _this;\n }\n return WebRtcPeerRecvonly;\n}(WebRtcPeer));\nexports.WebRtcPeerRecvonly = WebRtcPeerRecvonly;\nvar WebRtcPeerSendonly = /** @class */ (function (_super) {\n __extends(WebRtcPeerSendonly, _super);\n function WebRtcPeerSendonly(configuration) {\n var _this = this;\n configuration.mode = 'sendonly';\n _this = _super.call(this, configuration) || this;\n return _this;\n }\n return WebRtcPeerSendonly;\n}(WebRtcPeer));\nexports.WebRtcPeerSendonly = WebRtcPeerSendonly;\nvar WebRtcPeerSendrecv = /** @class */ (function (_super) {\n __extends(WebRtcPeerSendrecv, _super);\n function WebRtcPeerSendrecv(configuration) {\n var _this = this;\n configuration.mode = 'sendrecv';\n _this = _super.call(this, configuration) || this;\n return _this;\n }\n return WebRtcPeerSendrecv;\n}(WebRtcPeer));\nexports.WebRtcPeerSendrecv = WebRtcPeerSendrecv;\n//# sourceMappingURL=WebRtcPeer.js.map","\"use strict\";\n/*\n * (C) Copyright 2017-2018 OpenVidu (https://openvidu.io/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\nexports.__esModule = true;\nvar platform = require(\"platform\");\nvar WebRtcStats = /** @class */ (function () {\n function WebRtcStats(stream) {\n this.stream = stream;\n this.webRtcStatsEnabled = false;\n this.statsInterval = 1;\n this.stats = {\n inbound: {\n audio: {\n bytesReceived: 0,\n packetsReceived: 0,\n packetsLost: 0\n },\n video: {\n bytesReceived: 0,\n packetsReceived: 0,\n packetsLost: 0,\n framesDecoded: 0,\n nackCount: 0\n }\n },\n outbound: {\n audio: {\n bytesSent: 0,\n packetsSent: 0\n },\n video: {\n bytesSent: 0,\n packetsSent: 0,\n framesEncoded: 0,\n nackCount: 0\n }\n }\n };\n }\n WebRtcStats.prototype.isEnabled = function () {\n return this.webRtcStatsEnabled;\n };\n WebRtcStats.prototype.initWebRtcStats = function () {\n var _this = this;\n var elastestInstrumentation = localStorage.getItem('elastest-instrumentation');\n if (elastestInstrumentation) {\n // ElasTest instrumentation object found in local storage\n console.warn('WebRtc stats enabled for stream ' + this.stream.streamId + ' of connection ' + this.stream.connection.connectionId);\n this.webRtcStatsEnabled = true;\n var instrumentation_1 = JSON.parse(elastestInstrumentation);\n this.statsInterval = instrumentation_1.webrtc.interval; // Interval in seconds\n console.warn('localStorage item: ' + JSON.stringify(instrumentation_1));\n this.webRtcStatsIntervalId = setInterval(function () {\n _this.sendStatsToHttpEndpoint(instrumentation_1);\n }, this.statsInterval * 1000);\n return;\n }\n console.debug('WebRtc stats not enabled');\n };\n WebRtcStats.prototype.stopWebRtcStats = function () {\n if (this.webRtcStatsEnabled) {\n clearInterval(this.webRtcStatsIntervalId);\n console.warn('WebRtc stats stopped for disposed stream ' + this.stream.streamId + ' of connection ' + this.stream.connection.connectionId);\n }\n };\n WebRtcStats.prototype.getSelectedIceCandidateInfo = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.getStatsAgnostic(_this.stream.getRTCPeerConnection(), function (stats) {\n if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {\n var localCandidateId = void 0, remoteCandidateId = void 0, googCandidatePair = void 0;\n var localCandidates = {};\n var remoteCandidates = {};\n for (var key in stats) {\n var stat = stats[key];\n if (stat.type === 'localcandidate') {\n localCandidates[stat.id] = stat;\n }\n else if (stat.type === 'remotecandidate') {\n remoteCandidates[stat.id] = stat;\n }\n else if (stat.type === 'googCandidatePair' && (stat.googActiveConnection === 'true')) {\n googCandidatePair = stat;\n localCandidateId = stat.localCandidateId;\n remoteCandidateId = stat.remoteCandidateId;\n }\n }\n var finalLocalCandidate_1 = localCandidates[localCandidateId];\n if (!!finalLocalCandidate_1) {\n var candList = _this.stream.getLocalIceCandidateList();\n var cand = candList.filter(function (c) {\n return (!!c.candidate &&\n c.candidate.indexOf(finalLocalCandidate_1.ipAddress) >= 0 &&\n c.candidate.indexOf(finalLocalCandidate_1.portNumber) >= 0 &&\n c.candidate.indexOf(finalLocalCandidate_1.priority) >= 0);\n });\n finalLocalCandidate_1.raw = !!cand[0] ? cand[0].candidate : 'ERROR: Cannot find local candidate in list of sent ICE candidates';\n }\n else {\n finalLocalCandidate_1 = 'ERROR: No active local ICE candidate. Probably ICE-TCP is being used';\n }\n var finalRemoteCandidate_1 = remoteCandidates[remoteCandidateId];\n if (!!finalRemoteCandidate_1) {\n var candList = _this.stream.getRemoteIceCandidateList();\n var cand = candList.filter(function (c) {\n return (!!c.candidate &&\n c.candidate.indexOf(finalRemoteCandidate_1.ipAddress) >= 0 &&\n c.candidate.indexOf(finalRemoteCandidate_1.portNumber) >= 0 &&\n c.candidate.indexOf(finalRemoteCandidate_1.priority) >= 0);\n });\n finalRemoteCandidate_1.raw = !!cand[0] ? cand[0].candidate : 'ERROR: Cannot find remote candidate in list of received ICE candidates';\n }\n else {\n finalRemoteCandidate_1 = 'ERROR: No active remote ICE candidate. Probably ICE-TCP is being used';\n }\n resolve({\n googCandidatePair: googCandidatePair,\n localCandidate: finalLocalCandidate_1,\n remoteCandidate: finalRemoteCandidate_1\n });\n }\n else {\n reject('Selected ICE candidate info only available for Chrome');\n }\n }, function (error) {\n reject(error);\n });\n });\n };\n WebRtcStats.prototype.sendStatsToHttpEndpoint = function (instrumentation) {\n var _this = this;\n var sendPost = function (json) {\n var http = new XMLHttpRequest();\n var url = instrumentation.webrtc.httpEndpoint;\n http.open('POST', url, true);\n http.setRequestHeader('Content-type', 'application/json');\n http.onreadystatechange = function () {\n if (http.readyState === 4 && http.status === 200) {\n console.log('WebRtc stats successfully sent to ' + url + ' for stream ' + _this.stream.streamId + ' of connection ' + _this.stream.connection.connectionId);\n }\n };\n http.send(json);\n };\n var f = function (stats) {\n if (platform.name.indexOf('Firefox') !== -1) {\n stats.forEach(function (stat) {\n var json = {};\n if ((stat.type === 'inbound-rtp') &&\n (\n // Avoid firefox empty outbound-rtp statistics\n stat.nackCount !== null &&\n stat.isRemote === false &&\n stat.id.startsWith('inbound') &&\n stat.remoteId.startsWith('inbound'))) {\n var metricId = 'webrtc_inbound_' + stat.mediaType + '_' + stat.ssrc;\n var jit = stat.jitter * 1000;\n var metrics = {\n bytesReceived: (stat.bytesReceived - _this.stats.inbound[stat.mediaType].bytesReceived) / _this.statsInterval,\n jitter: jit,\n packetsReceived: (stat.packetsReceived - _this.stats.inbound[stat.mediaType].packetsReceived) / _this.statsInterval,\n packetsLost: (stat.packetsLost - _this.stats.inbound[stat.mediaType].packetsLost) / _this.statsInterval\n };\n var units = {\n bytesReceived: 'bytes',\n jitter: 'ms',\n packetsReceived: 'packets',\n packetsLost: 'packets'\n };\n if (stat.mediaType === 'video') {\n metrics['framesDecoded'] = (stat.framesDecoded - _this.stats.inbound.video.framesDecoded) / _this.statsInterval;\n metrics['nackCount'] = (stat.nackCount - _this.stats.inbound.video.nackCount) / _this.statsInterval;\n units['framesDecoded'] = 'frames';\n units['nackCount'] = 'packets';\n _this.stats.inbound.video.framesDecoded = stat.framesDecoded;\n _this.stats.inbound.video.nackCount = stat.nackCount;\n }\n _this.stats.inbound[stat.mediaType].bytesReceived = stat.bytesReceived;\n _this.stats.inbound[stat.mediaType].packetsReceived = stat.packetsReceived;\n _this.stats.inbound[stat.mediaType].packetsLost = stat.packetsLost;\n json = {\n '@timestamp': new Date(stat.timestamp).toISOString(),\n 'exec': instrumentation.exec,\n 'component': instrumentation.component,\n 'stream': 'webRtc',\n 'type': metricId,\n 'stream_type': 'composed_metrics',\n 'units': units\n };\n json[metricId] = metrics;\n sendPost(JSON.stringify(json));\n }\n else if ((stat.type === 'outbound-rtp') &&\n (\n // Avoid firefox empty inbound-rtp statistics\n stat.isRemote === false &&\n stat.id.toLowerCase().includes('outbound'))) {\n var metricId = 'webrtc_outbound_' + stat.mediaType + '_' + stat.ssrc;\n var metrics = {\n bytesSent: (stat.bytesSent - _this.stats.outbound[stat.mediaType].bytesSent) / _this.statsInterval,\n packetsSent: (stat.packetsSent - _this.stats.outbound[stat.mediaType].packetsSent) / _this.statsInterval\n };\n var units = {\n bytesSent: 'bytes',\n packetsSent: 'packets'\n };\n if (stat.mediaType === 'video') {\n metrics['framesEncoded'] = (stat.framesEncoded - _this.stats.outbound.video.framesEncoded) / _this.statsInterval;\n units['framesEncoded'] = 'frames';\n _this.stats.outbound.video.framesEncoded = stat.framesEncoded;\n }\n _this.stats.outbound[stat.mediaType].bytesSent = stat.bytesSent;\n _this.stats.outbound[stat.mediaType].packetsSent = stat.packetsSent;\n json = {\n '@timestamp': new Date(stat.timestamp).toISOString(),\n 'exec': instrumentation.exec,\n 'component': instrumentation.component,\n 'stream': 'webRtc',\n 'type': metricId,\n 'stream_type': 'composed_metrics',\n 'units': units\n };\n json[metricId] = metrics;\n sendPost(JSON.stringify(json));\n }\n });\n }\n else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {\n for (var _i = 0, _a = Object.keys(stats); _i < _a.length; _i++) {\n var key = _a[_i];\n var stat = stats[key];\n if (stat.type === 'ssrc') {\n var json = {};\n if ('bytesReceived' in stat && ((stat.mediaType === 'audio' && 'audioOutputLevel' in stat) ||\n (stat.mediaType === 'video' && 'qpSum' in stat))) {\n // inbound-rtp\n var metricId = 'webrtc_inbound_' + stat.mediaType + '_' + stat.ssrc;\n var metrics = {\n bytesReceived: (stat.bytesReceived - _this.stats.inbound[stat.mediaType].bytesReceived) / _this.statsInterval,\n jitter: stat.googJitterBufferMs,\n packetsReceived: (stat.packetsReceived - _this.stats.inbound[stat.mediaType].packetsReceived) / _this.statsInterval,\n packetsLost: (stat.packetsLost - _this.stats.inbound[stat.mediaType].packetsLost) / _this.statsInterval\n };\n var units = {\n bytesReceived: 'bytes',\n jitter: 'ms',\n packetsReceived: 'packets',\n packetsLost: 'packets'\n };\n if (stat.mediaType === 'video') {\n metrics['framesDecoded'] = (stat.framesDecoded - _this.stats.inbound.video.framesDecoded) / _this.statsInterval;\n metrics['nackCount'] = (stat.googNacksSent - _this.stats.inbound.video.nackCount) / _this.statsInterval;\n units['framesDecoded'] = 'frames';\n units['nackCount'] = 'packets';\n _this.stats.inbound.video.framesDecoded = stat.framesDecoded;\n _this.stats.inbound.video.nackCount = stat.googNacksSent;\n }\n _this.stats.inbound[stat.mediaType].bytesReceived = stat.bytesReceived;\n _this.stats.inbound[stat.mediaType].packetsReceived = stat.packetsReceived;\n _this.stats.inbound[stat.mediaType].packetsLost = stat.packetsLost;\n json = {\n '@timestamp': new Date(stat.timestamp).toISOString(),\n 'exec': instrumentation.exec,\n 'component': instrumentation.component,\n 'stream': 'webRtc',\n 'type': metricId,\n 'stream_type': 'composed_metrics',\n 'units': units\n };\n json[metricId] = metrics;\n sendPost(JSON.stringify(json));\n }\n else if ('bytesSent' in stat) {\n // outbound-rtp\n var metricId = 'webrtc_outbound_' + stat.mediaType + '_' + stat.ssrc;\n var metrics = {\n bytesSent: (stat.bytesSent - _this.stats.outbound[stat.mediaType].bytesSent) / _this.statsInterval,\n packetsSent: (stat.packetsSent - _this.stats.outbound[stat.mediaType].packetsSent) / _this.statsInterval\n };\n var units = {\n bytesSent: 'bytes',\n packetsSent: 'packets'\n };\n if (stat.mediaType === 'video') {\n metrics['framesEncoded'] = (stat.framesEncoded - _this.stats.outbound.video.framesEncoded) / _this.statsInterval;\n units['framesEncoded'] = 'frames';\n _this.stats.outbound.video.framesEncoded = stat.framesEncoded;\n }\n _this.stats.outbound[stat.mediaType].bytesSent = stat.bytesSent;\n _this.stats.outbound[stat.mediaType].packetsSent = stat.packetsSent;\n json = {\n '@timestamp': new Date(stat.timestamp).toISOString(),\n 'exec': instrumentation.exec,\n 'component': instrumentation.component,\n 'stream': 'webRtc',\n 'type': metricId,\n 'stream_type': 'composed_metrics',\n 'units': units\n };\n json[metricId] = metrics;\n sendPost(JSON.stringify(json));\n }\n }\n }\n }\n };\n this.getStatsAgnostic(this.stream.getRTCPeerConnection(), f, function (error) { console.log(error); });\n };\n WebRtcStats.prototype.standardizeReport = function (response) {\n console.log(response);\n var standardReport = {};\n if (platform.name.indexOf('Firefox') !== -1) {\n Object.keys(response).forEach(function (key) {\n console.log(response[key]);\n });\n return response;\n }\n response.result().forEach(function (report) {\n var standardStats = {\n id: report.id,\n timestamp: report.timestamp,\n type: report.type\n };\n report.names().forEach(function (name) {\n standardStats[name] = report.stat(name);\n });\n standardReport[standardStats.id] = standardStats;\n });\n return standardReport;\n };\n WebRtcStats.prototype.getStatsAgnostic = function (pc, successCb, failureCb) {\n var _this = this;\n if (platform.name.indexOf('Firefox') !== -1) {\n // getStats takes args in different order in Chrome and Firefox\n return pc.getStats(null).then(function (response) {\n var report = _this.standardizeReport(response);\n successCb(report);\n })[\"catch\"](failureCb);\n }\n else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {\n // In Chrome, the first two arguments are reversed\n return pc.getStats(function (response) {\n var report = _this.standardizeReport(response);\n successCb(report);\n }, null, failureCb);\n }\n };\n return WebRtcStats;\n}());\nexports.WebRtcStats = WebRtcStats;\n//# sourceMappingURL=WebRtcStats.js.map","\"use strict\";\nexports.__esModule = true;\nvar OpenVidu_1 = require(\"./OpenVidu/OpenVidu\");\nexports.OpenVidu = OpenVidu_1.OpenVidu;\nvar Session_1 = require(\"./OpenVidu/Session\");\nexports.Session = Session_1.Session;\nvar Publisher_1 = require(\"./OpenVidu/Publisher\");\nexports.Publisher = Publisher_1.Publisher;\nvar Subscriber_1 = require(\"./OpenVidu/Subscriber\");\nexports.Subscriber = Subscriber_1.Subscriber;\nvar StreamManager_1 = require(\"./OpenVidu/StreamManager\");\nexports.StreamManager = StreamManager_1.StreamManager;\nvar Stream_1 = require(\"./OpenVidu/Stream\");\nexports.Stream = Stream_1.Stream;\nvar Connection_1 = require(\"./OpenVidu/Connection\");\nexports.Connection = Connection_1.Connection;\nvar LocalRecorder_1 = require(\"./OpenVidu/LocalRecorder\");\nexports.LocalRecorder = LocalRecorder_1.LocalRecorder;\nvar LocalRecorderState_1 = require(\"./OpenViduInternal/Enums/LocalRecorderState\");\nexports.LocalRecorderState = LocalRecorderState_1.LocalRecorderState;\nvar OpenViduError_1 = require(\"./OpenViduInternal/Enums/OpenViduError\");\nexports.OpenViduError = OpenViduError_1.OpenViduError;\nvar VideoInsertMode_1 = require(\"./OpenViduInternal/Enums/VideoInsertMode\");\nexports.VideoInsertMode = VideoInsertMode_1.VideoInsertMode;\nvar Event_1 = require(\"./OpenViduInternal/Events/Event\");\nexports.Event = Event_1.Event;\nvar ConnectionEvent_1 = require(\"./OpenViduInternal/Events/ConnectionEvent\");\nexports.ConnectionEvent = ConnectionEvent_1.ConnectionEvent;\nvar PublisherSpeakingEvent_1 = require(\"./OpenViduInternal/Events/PublisherSpeakingEvent\");\nexports.PublisherSpeakingEvent = PublisherSpeakingEvent_1.PublisherSpeakingEvent;\nvar RecordingEvent_1 = require(\"./OpenViduInternal/Events/RecordingEvent\");\nexports.RecordingEvent = RecordingEvent_1.RecordingEvent;\nvar SessionDisconnectedEvent_1 = require(\"./OpenViduInternal/Events/SessionDisconnectedEvent\");\nexports.SessionDisconnectedEvent = SessionDisconnectedEvent_1.SessionDisconnectedEvent;\nvar SignalEvent_1 = require(\"./OpenViduInternal/Events/SignalEvent\");\nexports.SignalEvent = SignalEvent_1.SignalEvent;\nvar StreamEvent_1 = require(\"./OpenViduInternal/Events/StreamEvent\");\nexports.StreamEvent = StreamEvent_1.StreamEvent;\nvar StreamManagerEvent_1 = require(\"./OpenViduInternal/Events/StreamManagerEvent\");\nexports.StreamManagerEvent = StreamManagerEvent_1.StreamManagerEvent;\nvar VideoElementEvent_1 = require(\"./OpenViduInternal/Events/VideoElementEvent\");\nexports.VideoElementEvent = VideoElementEvent_1.VideoElementEvent;\nvar StreamPropertyChangedEvent_1 = require(\"./OpenViduInternal/Events/StreamPropertyChangedEvent\");\nexports.StreamPropertyChangedEvent = StreamPropertyChangedEvent_1.StreamPropertyChangedEvent;\n//# sourceMappingURL=index.js.map","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error('Cannot find module \"' + req + '\".');\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./src/$$_lazy_route_resource lazy recursive\";","module.exports = \"\"","module.exports = \"\\n \\n\"","import { Component, OnInit, OnDestroy, HostListener } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { InfoService } from 'app/services/info.service';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n\n}\n","import { NgModule } from '@angular/core';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport {\n MatButtonModule,\n MatIconModule,\n MatCheckboxModule,\n MatCardModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatTooltipModule,\n MatDialogModule,\n MatSlideToggleModule,\n MatListModule\n} from '@angular/material';\n\n@NgModule({\n imports: [\n BrowserAnimationsModule,\n MatButtonModule,\n MatIconModule,\n MatCheckboxModule,\n MatCardModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatTooltipModule,\n MatDialogModule,\n MatSlideToggleModule,\n MatListModule\n ],\n exports: [\n BrowserAnimationsModule,\n MatButtonModule,\n MatIconModule,\n MatCheckboxModule,\n MatCardModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatTooltipModule,\n MatDialogModule,\n MatSlideToggleModule,\n MatListModule\n ],\n})\nexport class AppMaterialModule { }\n","import { BrowserModule } from '@angular/platform-browser';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { HttpModule } from '@angular/http';\nimport { RouterModule } from '@angular/router';\nimport 'hammerjs';\n\nimport { routing } from './app.routing';\nimport { AppMaterialModule } from 'app/app.material.module';\n\nimport { InfoService } from './services/info.service';\nimport { RestService } from './services/rest.service';\n\nimport { AppComponent } from './app.component';\nimport { DashboardComponent } from './components/dashboard/dashboard.component';\nimport { SessionDetailsComponent } from './components/session-details/session-details.component';\nimport { CredentialsDialogComponent } from './components/dashboard/credentials-dialog.component';\nimport { LayoutBestFitComponent } from './components/layouts/layout-best-fit/layout-best-fit.component';\nimport { OpenViduVideoComponent } from './components/layouts/ov-video.component';\n\n\n@NgModule({\n declarations: [\n AppComponent,\n DashboardComponent,\n SessionDetailsComponent,\n CredentialsDialogComponent,\n LayoutBestFitComponent,\n OpenViduVideoComponent,\n ],\n imports: [\n BrowserModule,\n FormsModule,\n HttpModule,\n routing,\n AppMaterialModule,\n FlexLayoutModule\n ],\n entryComponents: [\n CredentialsDialogComponent,\n ],\n providers: [InfoService, RestService],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n","import { ModuleWithProviders } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { DashboardComponent } from 'app/components/dashboard/dashboard.component';\nimport { SessionDetailsComponent } from 'app/components/session-details/session-details.component';\nimport { LayoutBestFitComponent } from 'app/components/layouts/layout-best-fit/layout-best-fit.component';\n\nconst appRoutes: Routes = [\n {\n path: '',\n component: DashboardComponent,\n pathMatch: 'full'\n },\n {\n path: 'session/:sessionId',\n component: SessionDetailsComponent,\n pathMatch: 'full'\n },\n {\n path: 'layout-best-fit/:sessionId/:secret',\n component: LayoutBestFitComponent,\n pathMatch: 'full'\n }\n];\n\nexport const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true });\n\n","import { Component } from '@angular/core';\nimport { MatDialogRef } from '@angular/material';\n\n@Component({\n selector: 'app-credentials-dialog',\n template: `\n