Update to version v2.1.0

pull/73/head v2.1.0
jenkinsopenvidu 2018-06-01 13:01:08 +00:00
parent 08dd9eaca6
commit dcae9a0ac3
15 changed files with 10496 additions and 10411 deletions

View File

@ -1,52 +1,52 @@
{ {
"author": "OpenVidu", "author": "OpenVidu",
"dependencies": { "dependencies": {
"@types/node": "^9.6.7", "@types/node": "^9.6.7",
"@types/platform": "^1.3.1", "@types/platform": "^1.3.1",
"freeice": "2.2.0", "freeice": "2.2.0",
"hark": "1.2.0", "hark": "1.2.0",
"inherits": "2.0.3", "inherits": "2.0.3",
"merge": "1.2.0", "merge": "1.2.0",
"platform": "^1.3.5", "platform": "^1.3.5",
"sdp-translator": "0.1.24", "sdp-translator": "0.1.24",
"ua-parser-js": "0.7.18", "ua-parser-js": "0.7.18",
"uuid": "3.2.1", "uuid": "3.2.1",
"webrtc-adapter": "6.1.5", "webrtc-adapter": "6.1.5",
"wolfy87-eventemitter": "5.2.4" "wolfy87-eventemitter": "5.2.4"
}, },
"description": "OpenVidu Browser", "description": "OpenVidu Browser",
"devDependencies": { "devDependencies": {
"browserify": "16.1.1", "browserify": "16.1.1",
"grunt": "1.0.2", "grunt": "1.0.2",
"grunt-autoprefixer": "3.0.4", "grunt-autoprefixer": "3.0.4",
"grunt-cli": "1.2.0", "grunt-cli": "1.2.0",
"grunt-contrib-copy": "1.0.0", "grunt-contrib-copy": "1.0.0",
"grunt-contrib-sass": "1.0.0", "grunt-contrib-sass": "1.0.0",
"grunt-contrib-uglify": "3.3.0", "grunt-contrib-uglify": "3.3.0",
"grunt-contrib-watch": "1.1.0", "grunt-contrib-watch": "1.1.0",
"grunt-string-replace": "1.3.1", "grunt-string-replace": "1.3.1",
"grunt-ts": "6.0.0-beta.19", "grunt-ts": "6.0.0-beta.19",
"tsify": "4.0.0", "tsify": "4.0.0",
"tslint": "5.10.0", "tslint": "5.10.0",
"typedoc": "0.11.1", "typedoc": "0.11.1",
"typedoc-plugin-sourcefile-url": "1.0.3", "typedoc-plugin-sourcefile-url": "1.0.3",
"typescript": "2.8.3", "typescript": "2.8.3",
"uglify-js": "3.3.25" "uglify-js": "3.3.25"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "lib/index.js", "main": "lib/index.js",
"name": "openvidu-browser", "name": "openvidu-browser",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/OpenVidu/openvidu" "url": "git://github.com/OpenVidu/openvidu"
}, },
"scripts": { "scripts": {
"browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v", "browserify": "VERSION=${VERSION:-}; cd src && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
"browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js", "browserify-prod": "VERSION=${VERSION:-}; cd src && browserify --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
"build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost", "build": "cd src/OpenVidu && tsc && cd ../.. && tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
"docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser", "docs": "grunt --gruntfile config/typedoc/custom-theme/gruntfile.js && typedoc --options ./config/typedoc/typedoc.js --out ./docs ./src && rm -rf ../../openvidu.io/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io/api/openvidu-browser",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
"version": "2.0.0" "version": "2.1.0"
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<name>OpenVidu Server</name> <name>OpenVidu Server</name>
<version>2.0.0</version> <version>2.1.0</version>
<description>OpenVidu Server</description> <description>OpenVidu Server</description>
<url>https://github.com/OpenVidu/openvidu</url> <url>https://github.com/OpenVidu/openvidu</url>

View File

@ -14,7 +14,7 @@
"@angular/router": "5.0.5", "@angular/router": "5.0.5",
"core-js": "2.5.1", "core-js": "2.5.1",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"openvidu-browser": "2.0.0", "openvidu-browser": "2.1.0",
"rxjs": "5.5.3", "rxjs": "5.5.3",
"zone.js": "0.8.18" "zone.js": "0.8.18"
}, },

View File

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

View File

@ -528,12 +528,13 @@ var OpenVidu = /** @class */ (function () {
* *
* The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not. * The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not.
* *
* The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (if `targetElement` not *null* or *undefined*) * The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (only if you
* [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.
* *
* The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing * The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing. See [[StreamManagerEvent]] to learn more.
* *
* @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 * @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.
* (you can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own) * 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)
* @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails.
* `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event * `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event
*/ */
@ -1411,7 +1412,7 @@ var Session = /** @class */ (function () {
*/ */
function Session(openvidu) { function Session(openvidu) {
/** /**
* Collection of all StreamManagers of this Session ([[Publishers]] and [[Subscribers]]) * Collection of all StreamManagers of this Session ([[Publisher]] and [[Subscriber]])
*/ */
this.streamManagers = []; this.streamManagers = [];
// This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification // This map is only used to avoid race condition between 'joinRoom' response and 'onParticipantPublished' notification
@ -1486,21 +1487,23 @@ var Session = /** @class */ (function () {
* *
* The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event. * The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.
* 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) * 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)
* and also deletes any HTML video element associated to each Subscriber (only if it was created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[subscribe]] or * 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)).
* by calling [[Subscriber.createVideoElement]]). * For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself. See [[SessionDisconnectedEvent]] to learn more. * Call `event.preventDefault()` uppon event `sessionDisconnected` to avoid this behaviour and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete any HTML video element associated to it (only if it was created by OpenVidu Browser, either by passing a valid parameter as `targetElement` * 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)).
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). * For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` 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()` * Call `event.preventDefault()` uppon 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()`
* or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] to learn more. * or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and and also deletes any HTML video element associated to that Subscriber (only if it was created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[subscribe]] or * 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)).
* by calling [[Subscriber.createVideoElement]]). * For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. See [[StreamEvent]] to learn more. * Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself.
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more. * The [[Session]] object of every other participant connected to the session will dispatch a `connectionDestroyed` event in any case. See [[ConnectionEvent]] to learn more.
*/ */
@ -1512,15 +1515,14 @@ var Session = /** @class */ (function () {
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (if `targetElement` not *null* or *undefined*) * The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (only if you
* [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.
* *
* The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing * The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing. See [[StreamManagerEvent]] to learn more.
*
* See [[VideoElementEvent]] to learn more.
* *
* @param stream Stream object to subscribe to * @param stream Stream object to subscribe to
* @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 * @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.
* (you can always call method [[Stream.addVideoElement]] for the object [[Subscriber.stream]] to manage the video elements on your own) * 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)
* @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails. * @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails.
*/ */
Session.prototype.subscribe = function (stream, targetElement, param3, param4) { Session.prototype.subscribe = function (stream, targetElement, param3, param4) {
@ -1585,11 +1587,14 @@ var Session = /** @class */ (function () {
}); });
}; };
/** /**
* Unsubscribes from `subscriber`, automatically removing its HTML video element. * Unsubscribes from `subscriber`, automatically removing its associated HTML video elements.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Subscriber]] object will dispatch a `videoElementDestroyed` event (only if it previously dispatched a `videoElementCreated` event). See [[VideoElementEvent]] to learn more * The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.
* Only videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
*
* See [[VideoElementEvent]] to learn more
*/ */
Session.prototype.unsubscribe = function (subscriber) { Session.prototype.unsubscribe = function (subscriber) {
var connectionId = subscriber.stream.connection.connectionId; var connectionId = subscriber.stream.connection.connectionId;
@ -1607,7 +1612,7 @@ var Session = /** @class */ (function () {
subscriber.stream.streamManager.removeAllVideos(); subscriber.stream.streamManager.removeAllVideos();
}; };
/** /**
* Publishes the participant's audio-video stream contained in `publisher` object to the session * Publishes to the Session the Publisher object
* *
* #### Events dispatched * #### Events dispatched
* *
@ -1617,7 +1622,7 @@ var Session = /** @class */ (function () {
* *
* 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. * 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.
* *
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the publisher was successfully published and rejected with an Error object if not * @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
*/ */
Session.prototype.publish = function (publisher) { Session.prototype.publish = function (publisher) {
var _this = this; var _this = this;
@ -1653,19 +1658,23 @@ var Session = /** @class */ (function () {
}); });
}; };
/** /**
* Unpublishes the participant's audio-video stream contained in `publisher` object. * Unpublishes from the Session the Publisher object.
* *
* #### Events dispatched * #### Events dispatched
* *
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event. * The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.
* This event will automatically stop all media tracks and delete the HTML video element associated to it. * This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* Call `event.preventDefault()` if you want clean the Publisher object yourself or re-publish it in a different Session. * (only those videos [created by OpenVidu Browser](/docs/how-do-i/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.
* *
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event. * The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and delete the HTML video element associated to it. * This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
* Call `event.preventDefault()` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object yourself. * 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)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` uppon event `streamDestroyed` to avoid this default behaviour and take care of disposing and cleaning the Subscriber object on your own.
* *
* See [[StreamEvent]] to learn more. * See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*/ */
Session.prototype.unpublish = function (publisher) { Session.prototype.unpublish = function (publisher) {
var stream = publisher.stream; var stream = publisher.stream;
@ -2210,7 +2219,7 @@ var kurentoUtils = __webpack_require__("../../../../openvidu-browser/lib/OpenVid
/** /**
* Represents each one of the media streams available in OpenVidu Server for certain session. * Represents each one of the media streams available in OpenVidu Server for certain session.
* Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access
* to at least one of them (sending and receiving it, respectively) * to one of them (sending and receiving it, respectively)
*/ */
var Stream = /** @class */ (function () { var Stream = /** @class */ (function () {
/** /**
@ -2780,9 +2789,8 @@ var StreamManager = /** @class */ (function () {
return this; return this;
}; };
/** /**
* Makes `video` element parameter display this Stream. This is useful when you are managing the video elements on your own * Makes `video` element parameter display this [[stream]]. This is useful when you are
* (parameter `targetElement` of methods [[OpenVidu.initPublisher]] or [[Session.subscribe]] is set to *null* or *undefined*) * [managing the video elements on your own](/docs/how-do-i/manage-videos/#you-take-care-of-the-video-players)
* or if you want to have multiple video elements displaying the same media stream.
* *
* Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be * Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
* disassociated from that previous Publisher/Subscriber and to be associated to this one. * disassociated from that previous Publisher/Subscriber and to be associated to this one.
@ -2820,11 +2828,11 @@ var StreamManager = /** @class */ (function () {
return returnNumber; return returnNumber;
}; };
/** /**
* Creates a new video element displaying this Stream. This allows you to have multiple video elements displaying the same media stream. * Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.
* *
* #### Events dispatched * #### Events dispatched
* *
* The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM * The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]
* *
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted * @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted
* @param insertMode How the video element will be inserted accordingly to `targetElemet` * @param insertMode How the video element will be inserted accordingly to `targetElemet`
@ -3111,18 +3119,68 @@ exports.__esModule = true;
*/ */
var OpenViduErrorName; var OpenViduErrorName;
(function (OpenViduErrorName) { (function (OpenViduErrorName) {
/**
* Browser is not supported by OpenVidu.
* Returned uppon unsuccessful [[Session.connect]]
*/
OpenViduErrorName["BROWSER_NOT_SUPPORTED"] = "BROWSER_NOT_SUPPORTED"; OpenViduErrorName["BROWSER_NOT_SUPPORTED"] = "BROWSER_NOT_SUPPORTED";
/**
* The user hasn't granted permissions to the required input device when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
OpenViduErrorName["DEVICE_ACCESS_DENIED"] = "DEVICE_ACCESS_DENIED"; OpenViduErrorName["DEVICE_ACCESS_DENIED"] = "DEVICE_ACCESS_DENIED";
/**
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
OpenViduErrorName["SCREEN_CAPTURE_DENIED"] = "SCREEN_CAPTURE_DENIED"; OpenViduErrorName["SCREEN_CAPTURE_DENIED"] = "SCREEN_CAPTURE_DENIED";
/**
* Browser does not support screen sharing.
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_SHARING_NOT_SUPPORTED"] = "SCREEN_SHARING_NOT_SUPPORTED"; OpenViduErrorName["SCREEN_SHARING_NOT_SUPPORTED"] = "SCREEN_SHARING_NOT_SUPPORTED";
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_EXTENSION_NOT_INSTALLED"] = "SCREEN_EXTENSION_NOT_INSTALLED"; OpenViduErrorName["SCREEN_EXTENSION_NOT_INSTALLED"] = "SCREEN_EXTENSION_NOT_INSTALLED";
/**
* Only for Chrome, the screen sharing extension is installed but is disabled
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["SCREEN_EXTENSION_DISABLED"] = "SCREEN_EXTENSION_DISABLED"; OpenViduErrorName["SCREEN_EXTENSION_DISABLED"] = "SCREEN_EXTENSION_DISABLED";
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["INPUT_VIDEO_DEVICE_NOT_FOUND"] = "INPUT_VIDEO_DEVICE_NOT_FOUND"; OpenViduErrorName["INPUT_VIDEO_DEVICE_NOT_FOUND"] = "INPUT_VIDEO_DEVICE_NOT_FOUND";
/**
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["INPUT_AUDIO_DEVICE_NOT_FOUND"] = "INPUT_AUDIO_DEVICE_NOT_FOUND"; OpenViduErrorName["INPUT_AUDIO_DEVICE_NOT_FOUND"] = "INPUT_AUDIO_DEVICE_NOT_FOUND";
/**
* Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of
* [[PublisherProperties]] parameter both set to *false* or *null*
*/
OpenViduErrorName["NO_INPUT_SOURCE_SET"] = "NO_INPUT_SOURCE_SET"; OpenViduErrorName["NO_INPUT_SOURCE_SET"] = "NO_INPUT_SOURCE_SET";
/**
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
* Returned uppon unsuccessful [[OpenVidu.initPublisher]]
*/
OpenViduErrorName["PUBLISHER_PROPERTIES_ERROR"] = "PUBLISHER_PROPERTIES_ERROR"; OpenViduErrorName["PUBLISHER_PROPERTIES_ERROR"] = "PUBLISHER_PROPERTIES_ERROR";
/**
* _Not in use yet_
*/
OpenViduErrorName["OPENVIDU_PERMISSION_DENIED"] = "OPENVIDU_PERMISSION_DENIED"; OpenViduErrorName["OPENVIDU_PERMISSION_DENIED"] = "OPENVIDU_PERMISSION_DENIED";
/**
* _Not in use yet_
*/
OpenViduErrorName["OPENVIDU_NOT_CONNECTED"] = "OPENVIDU_NOT_CONNECTED"; OpenViduErrorName["OPENVIDU_NOT_CONNECTED"] = "OPENVIDU_NOT_CONNECTED";
/**
* _Not in use yet_
*/
OpenViduErrorName["GENERIC_ERROR"] = "GENERIC_ERROR"; OpenViduErrorName["GENERIC_ERROR"] = "GENERIC_ERROR";
})(OpenViduErrorName = exports.OpenViduErrorName || (exports.OpenViduErrorName = {})); })(OpenViduErrorName = exports.OpenViduErrorName || (exports.OpenViduErrorName = {}));
/** /**
@ -3296,10 +3354,17 @@ var Event = /** @class */ (function () {
}; };
/** /**
* Prevents the default behaviour of the event. The following events have a default behaviour: * Prevents the default behaviour of the event. The following events have a default behaviour:
* - `sessionDisconnected`: automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) *
* and also deletes the HTML video element associated to it. * - `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)
* - `streamDestroyed`: if dispatched by a [[Publisher]] (_you_ have unpublished), automatically stops all media tracks and deletes the HTML video element associated to the stream. If dispatched by [[Session]], * 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
* (_other user_ has unpublished), automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and deletes the HTML video element associated to it. * by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
*
* - `streamDestroyed`:
* - 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`
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
* - 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)
* 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
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
*/ */
Event.prototype.preventDefault = function () { Event.prototype.preventDefault = function () {
// tslint:disable-next-line:no-empty // tslint:disable-next-line:no-empty
@ -3764,8 +3829,9 @@ exports.__esModule = true;
var Event_1 = __webpack_require__("../../../../openvidu-browser/lib/OpenViduInternal/Events/Event.js"); var Event_1 = __webpack_require__("../../../../openvidu-browser/lib/OpenViduInternal/Events/Event.js");
/** /**
* Defines the following events: * Defines the following events:
* - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM * - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM * [Manage video players](/docs/how-do-i/manage-videos) section.
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.
*/ */
var VideoElementEvent = /** @class */ (function (_super) { var VideoElementEvent = /** @class */ (function (_super) {
__extends(VideoElementEvent, _super); __extends(VideoElementEvent, _super);

File diff suppressed because one or more lines are too long

View File

@ -160627,8 +160627,8 @@ function __generator(thisArg, body) {
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false }; case 4: _.label++; return { value: op[1], done: false };
@ -160696,7 +160696,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); } function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); } function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
@ -160705,13 +160705,15 @@ function __asyncGenerator(thisArg, _arguments, generator) {
function __asyncDelegator(o) { function __asyncDelegator(o) {
var i, p; var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; } function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
} }
function __asyncValues(o) { function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator]; var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
} }
function __makeTemplateObject(cooked, raw) { function __makeTemplateObject(cooked, raw) {

File diff suppressed because one or more lines are too long

View File

@ -1,47 +1,47 @@
{ {
"dependencies": { "dependencies": {
"@angular/animations": "5.2.10", "@angular/animations": "5.2.10",
"@angular/cdk": "5.2.5", "@angular/cdk": "5.2.5",
"@angular/common": "5.2.10", "@angular/common": "5.2.10",
"@angular/compiler": "5.2.10", "@angular/compiler": "5.2.10",
"@angular/core": "5.2.10", "@angular/core": "5.2.10",
"@angular/flex-layout": "5.0.0-beta.14", "@angular/flex-layout": "5.0.0-beta.14",
"@angular/forms": "5.2.10", "@angular/forms": "5.2.10",
"@angular/http": "5.2.10", "@angular/http": "5.2.10",
"@angular/material": "5.2.5", "@angular/material": "5.2.5",
"@angular/platform-browser": "5.2.10", "@angular/platform-browser": "5.2.10",
"@angular/platform-browser-dynamic": "5.2.10", "@angular/platform-browser-dynamic": "5.2.10",
"@angular/router": "5.2.10", "@angular/router": "5.2.10",
"colormap": "^2.2.0", "colormap": "^2.2.0",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"openvidu-browser": "2.0.0", "openvidu-browser": "2.1.0",
"openvidu-node-client": "2.0.0", "openvidu-node-client": "2.0.0",
"rxjs": "5.5.9", "rxjs": "5.5.9",
"zone.js": "0.8.26" "zone.js": "0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "1.7.4", "@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.10", "@angular/compiler-cli": "5.2.10",
"@angular/language-service": "5.2.10", "@angular/language-service": "5.2.10",
"@types/jasmine": "2.8.7", "@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3", "@types/jasminewd2": "2.0.3",
"@types/node": "10.0.8", "@types/node": "10.0.8",
"codelyzer": "4.3.0", "codelyzer": "4.3.0",
"ts-node": "6.0.3", "ts-node": "6.0.3",
"tslint": "5.10.0", "tslint": "5.10.0",
"typescript": "2.7.2" "typescript": "2.7.2"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"name": "openvidu-testapp", "name": "openvidu-testapp",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "ng build", "build": "ng build",
"e2e": "ng e2e", "e2e": "ng e2e",
"lint": "ng lint", "lint": "ng lint",
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"test": "ng test" "test": "ng test"
}, },
"version": "2.0.0" "version": "2.1.0"
} }