@techsee/techsee-media-service 0.21.2 → 0.22.0-alphagb2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/lib/LocalStreamManager.js +435 -317
  2. package/lib/LocalStreamManager.js.map +1 -1
  3. package/lib/MediaConstants.js +72 -44
  4. package/lib/MediaConstants.js.map +1 -1
  5. package/lib/MediaContracts.js +3 -3
  6. package/lib/MediaContracts.js.map +1 -1
  7. package/lib/MediaPublisher.js +45 -35
  8. package/lib/MediaPublisher.js.map +1 -1
  9. package/lib/MediaServiceBase.js +922 -706
  10. package/lib/MediaServiceBase.js.map +1 -1
  11. package/lib/MediaSession/MediaServer.js +512 -379
  12. package/lib/MediaSession/MediaServer.js.map +1 -1
  13. package/lib/MediaSession/MediaSessionBase.js +123 -88
  14. package/lib/MediaSession/MediaSessionBase.js.map +1 -1
  15. package/lib/MediaSession/SessionOpentok.js +499 -384
  16. package/lib/MediaSession/SessionOpentok.js.map +1 -1
  17. package/lib/MediaSession/SessionTurn.js +606 -466
  18. package/lib/MediaSession/SessionTurn.js.map +1 -1
  19. package/lib/MediaSession/TurnConstants.js +30 -30
  20. package/lib/MediaSession/TurnConstants.js.map +1 -1
  21. package/lib/MediaSubscriber.js +235 -192
  22. package/lib/MediaSubscriber.js.map +1 -1
  23. package/lib/MediaUtils/Compatibility.js +127 -90
  24. package/lib/MediaUtils/Compatibility.js.map +1 -1
  25. package/lib/MediaUtils/MediaDomUtils.js +230 -179
  26. package/lib/MediaUtils/MediaDomUtils.js.map +1 -1
  27. package/lib/MediaUtils/MediaTracer.js +8 -4
  28. package/lib/MediaUtils/MediaTracer.js.map +1 -1
  29. package/lib/MultiParty/Contracts.js +3 -3
  30. package/lib/MultiParty/Contracts.js.map +1 -1
  31. package/lib/MultiParty/DetectWebRtcService.js +66 -50
  32. package/lib/MultiParty/DetectWebRtcService.js.map +1 -1
  33. package/lib/MultiParty/MediaCapabilitiesHelper.js +258 -154
  34. package/lib/MultiParty/MediaCapabilitiesHelper.js.map +1 -1
  35. package/lib/MultiParty/MultiParty.d.ts +1 -8
  36. package/lib/MultiParty/MultiParty.d.ts.map +1 -1
  37. package/lib/MultiParty/MultiParty.js +221 -128
  38. package/lib/MultiParty/MultiParty.js.map +1 -1
  39. package/lib/MultiParty/MultipartyFactory.d.ts +1 -2
  40. package/lib/MultiParty/MultipartyFactory.d.ts.map +1 -1
  41. package/lib/MultiParty/MultipartyFactory.js +12 -7
  42. package/lib/MultiParty/MultipartyFactory.js.map +1 -1
  43. package/lib/MultiParty/OpentokMultiparty.js +611 -384
  44. package/lib/MultiParty/OpentokMultiparty.js.map +1 -1
  45. package/lib/TechseeMediaStream.js +58 -53
  46. package/lib/TechseeMediaStream.js.map +1 -1
  47. package/lib/oldCode/constants.js +20 -15
  48. package/lib/oldCode/constants.js.map +1 -1
  49. package/lib/oldCode/event-emitter.js +45 -22
  50. package/lib/oldCode/event-emitter.js.map +1 -1
  51. package/lib/oldCode/index.js +48 -52
  52. package/lib/oldCode/index.js.map +1 -1
  53. package/lib/oldCode/opentok/session.js +261 -236
  54. package/lib/oldCode/opentok/session.js.map +1 -1
  55. package/lib/oldCode/opentok/stream.js +283 -269
  56. package/lib/oldCode/opentok/stream.js.map +1 -1
  57. package/lib/oldCode/publisher.js +96 -71
  58. package/lib/oldCode/publisher.js.map +1 -1
  59. package/lib/oldCode/service.js +294 -272
  60. package/lib/oldCode/service.js.map +1 -1
  61. package/lib/oldCode/session.js +82 -60
  62. package/lib/oldCode/session.js.map +1 -1
  63. package/lib/oldCode/stream.js +153 -125
  64. package/lib/oldCode/stream.js.map +1 -1
  65. package/lib/oldCode/subscriber.js +60 -35
  66. package/lib/oldCode/subscriber.js.map +1 -1
  67. package/lib/oldCode/tracer.js +179 -138
  68. package/lib/oldCode/tracer.js.map +1 -1
  69. package/lib/oldCode/utils/ImageFixer.js +66 -44
  70. package/lib/oldCode/utils/ImageFixer.js.map +1 -1
  71. package/lib/oldCode/webrtc/constants.js +102 -110
  72. package/lib/oldCode/webrtc/constants.js.map +1 -1
  73. package/lib/oldCode/webrtc/helper.js +176 -124
  74. package/lib/oldCode/webrtc/helper.js.map +1 -1
  75. package/lib/oldCode/webrtc/session-kms.js +408 -393
  76. package/lib/oldCode/webrtc/session-kms.js.map +1 -1
  77. package/lib/oldCode/webrtc/session-loopback.js +245 -227
  78. package/lib/oldCode/webrtc/session-loopback.js.map +1 -1
  79. package/lib/oldCode/webrtc/session-turn.js +705 -658
  80. package/lib/oldCode/webrtc/session-turn.js.map +1 -1
  81. package/lib/oldCode/webrtc/session-turn.v2.js +480 -471
  82. package/lib/oldCode/webrtc/session-turn.v2.js.map +1 -1
  83. package/lib/oldCode/webrtc/session.js +12 -6
  84. package/lib/oldCode/webrtc/session.js.map +1 -1
  85. package/lib/oldCode/webrtc/stream.js +526 -504
  86. package/lib/oldCode/webrtc/stream.js.map +1 -1
  87. package/lib/oldCode/webrtc/temasys/adapter-loader.js +5 -6
  88. package/lib/oldCode/webrtc/temasys/adapter-loader.js.map +1 -1
  89. package/lib/oldCode/webrtc/temasys/adapter.js +5264 -5192
  90. package/lib/oldCode/webrtc/temasys/adapter.js.map +1 -1
  91. package/lib/oldCode/webrtc/webrtc-ie-shim.js +3357 -2927
  92. package/lib/oldCode/webrtc/webrtc-ie-shim.js.map +1 -1
  93. package/lib/qos/raw-qos.js +348 -274
  94. package/lib/qos/raw-qos.js.map +1 -1
  95. package/lib/webrtc-ie-shim.js +3386 -2985
  96. package/lib/webrtc-ie-shim.js.map +1 -1
  97. package/package.json +12 -15
@@ -1,31 +1,46 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.TsMediaStream = exports.EVENTS = undefined;
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5
4
 
6
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.TsMediaStream = exports.EVENTS = void 0;
7
9
 
8
- var _eventEmitter = require('./event-emitter');
10
+ var _eventEmitter = require("./event-emitter");
9
11
 
10
- var _session = require('./session');
12
+ var _session = require("./session");
11
13
 
12
- var _subscriber = require('./subscriber');
14
+ var _subscriber = require("./subscriber");
13
15
 
14
- var _tsEnvironmentDetect = require('@techsee/techsee-common/lib/helpers/ts-environment-detect');
16
+ var _tsEnvironmentDetect = require("@techsee/techsee-common/lib/helpers/ts-environment-detect");
15
17
 
16
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
19
 
18
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
20
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
21
 
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
22
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23
+
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
+
26
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
+
28
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
29
+
30
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
+
32
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
+
34
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
+
36
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
37
 
22
38
  /**
23
39
  * @enum STREAM_EVENTS
24
40
  */
25
41
  var STREAM_EVENTS = {
26
- PROPERTY_CHANGED: 'PROPERTY_CHANGED'
42
+ PROPERTY_CHANGED: 'PROPERTY_CHANGED'
27
43
  };
28
-
29
44
  exports.EVENTS = STREAM_EVENTS;
30
45
 
31
46
  /**
@@ -40,97 +55,116 @@ exports.EVENTS = STREAM_EVENTS;
40
55
  * @see TsOpenTokStream
41
56
  * @see TsWebRTCStream
42
57
  */
58
+ var TsMediaStream = /*#__PURE__*/function (_EventEmitter) {
59
+ _inherits(TsMediaStream, _EventEmitter);
43
60
 
44
- var TsMediaStream = exports.TsMediaStream = function (_EventEmitter) {
45
- _inherits(TsMediaStream, _EventEmitter);
46
-
47
- function TsMediaStream(id, session) {
48
- var isRemote = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
49
- var videoTrackSettings = arguments[3];
61
+ var _super = _createSuper(TsMediaStream);
50
62
 
51
- _classCallCheck(this, TsMediaStream);
63
+ function TsMediaStream(id, session) {
64
+ var _this;
52
65
 
53
- var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));
66
+ var isRemote = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
67
+ var videoTrackSettings = arguments.length > 3 ? arguments[3] : undefined;
54
68
 
55
- session.registerStream(id, _this);
56
- _this.remote = isRemote;
69
+ _classCallCheck(this, TsMediaStream);
57
70
 
58
- if (videoTrackSettings) {
59
- _this._width = videoTrackSettings.width;
60
- _this._height = videoTrackSettings.height;
61
- }
71
+ _this = _super.call(this);
72
+ session.registerStream(id, _assertThisInitialized(_this));
73
+ _this.remote = isRemote;
62
74
 
63
- /**
64
- * Environment detector
65
- *
66
- * @protected
67
- * @member { Object }
68
- */
69
- _this._environment = new _tsEnvironmentDetect.TsEnvironmentDetect();
70
- return _this;
75
+ if (videoTrackSettings) {
76
+ _this._width = videoTrackSettings.width;
77
+ _this._height = videoTrackSettings.height;
71
78
  }
72
-
73
79
  /**
74
- * Stream video dimensions
80
+ * Environment detector
75
81
  *
82
+ * @protected
76
83
  * @member { Object }
77
- * @type { Object }
78
84
  */
79
85
 
80
86
 
81
- TsMediaStream.prototype._updateVideoDimensions = function _updateVideoDimensions(videoEl) {
82
- if (videoEl) {
83
- this._width = videoEl.videoWidth;
84
- this._height = videoEl.videoHeight;
85
-
86
- var stream = this;
87
- var property = 'videoDimensions';
88
- var value = this.videoDimensions;
89
-
90
- this._session.emit(_session.EVENTS.STREAM_PROPERTY_CHANGED, { stream: stream, property: property, value: value });
91
- }
92
- };
93
-
94
- TsMediaStream.prototype.setupDimensionsListener = function setupDimensionsListener(videoEl, subscriber) {
95
- var _this2 = this;
96
-
97
- this._clearUpdateDimensionsInterval();
98
-
87
+ _this._environment = new _tsEnvironmentDetect.TsEnvironmentDetect();
88
+ return _this;
89
+ }
90
+ /**
91
+ * Stream video dimensions
92
+ *
93
+ * @member { Object }
94
+ * @type { Object }
95
+ */
96
+
97
+
98
+ _createClass(TsMediaStream, [{
99
+ key: "videoDimensions",
100
+ get: function get() {
101
+ // FIXME the fallback dimensions should be removed, and the Opentok/Webrtc implementations
102
+ // should pass the dimensions just like loopback does. I suspect current behavior is
103
+ // the cause of the video element "jumping" (change size) on initial connection
104
+ return {
105
+ width: this._width || 480,
106
+ height: this._height || 640
107
+ };
108
+ }
109
+ }, {
110
+ key: "_updateVideoDimensions",
111
+ value: function _updateVideoDimensions(videoEl) {
112
+ if (videoEl) {
99
113
  this._width = videoEl.videoWidth;
100
114
  this._height = videoEl.videoHeight;
101
-
102
- if (!subscriber && !this._environment.isIE11() && !this._environment.isIOS()) {
103
- $(videoEl).on('resize', function () {
104
- return _this2._updateVideoDimensions(videoEl);
105
- });
106
- } else {
107
- this.intervalId = setInterval(function () {
108
- if (subscriber && !(subscriber.stream && subscriber.stream.hasVideo)) {
109
- return;
110
- }
111
-
112
- if (_this2._width !== videoEl.videoWidth || _this2._height !== videoEl.videoHeight) {
113
- _this2._updateVideoDimensions(videoEl);
114
- }
115
- }, 500);
116
- }
117
-
118
- if (subscriber && this.intervalId) {
119
- subscriber.on(_subscriber.EVENTS.DESTROYED, function () {
120
- _this2._clearUpdateDimensionsInterval();
121
- });
122
- }
123
- };
124
-
125
- TsMediaStream.prototype._clearUpdateDimensionsInterval = function _clearUpdateDimensionsInterval() {
126
- if (this.intervalId) {
127
- clearInterval(this.intervalId);
128
-
129
- this.intervalId = null;
130
- }
131
- };
132
-
115
+ var stream = this;
116
+ var property = 'videoDimensions';
117
+ var value = this.videoDimensions;
118
+
119
+ this._session.emit(_session.EVENTS.STREAM_PROPERTY_CHANGED, {
120
+ stream: stream,
121
+ property: property,
122
+ value: value
123
+ });
124
+ }
125
+ }
126
+ }, {
127
+ key: "setupDimensionsListener",
128
+ value: function setupDimensionsListener(videoEl, subscriber) {
129
+ var _this2 = this;
130
+
131
+ this._clearUpdateDimensionsInterval();
132
+
133
+ this._width = videoEl.videoWidth;
134
+ this._height = videoEl.videoHeight;
135
+
136
+ if (!subscriber && !this._environment.isIE11() && !this._environment.isIOS()) {
137
+ $(videoEl).on('resize', function () {
138
+ return _this2._updateVideoDimensions(videoEl);
139
+ });
140
+ } else {
141
+ this.intervalId = setInterval(function () {
142
+ if (subscriber && !(subscriber.stream && subscriber.stream.hasVideo)) {
143
+ return;
144
+ }
145
+
146
+ if (_this2._width !== videoEl.videoWidth || _this2._height !== videoEl.videoHeight) {
147
+ _this2._updateVideoDimensions(videoEl);
148
+ }
149
+ }, 500);
150
+ }
151
+
152
+ if (subscriber && this.intervalId) {
153
+ subscriber.on(_subscriber.EVENTS.DESTROYED, function () {
154
+ _this2._clearUpdateDimensionsInterval();
155
+ });
156
+ }
157
+ }
158
+ }, {
159
+ key: "_clearUpdateDimensionsInterval",
160
+ value: function _clearUpdateDimensionsInterval() {
161
+ if (this.intervalId) {
162
+ clearInterval(this.intervalId);
163
+ this.intervalId = null;
164
+ }
165
+ }
133
166
  /* eslint-disable no-unused-vars */
167
+
134
168
  /**
135
169
  * Get snapshot of the current frame in the media stream
136
170
  *
@@ -150,46 +184,40 @@ var TsMediaStream = exports.TsMediaStream = function (_EventEmitter) {
150
184
  * @returns { Promise<String> } snapshot
151
185
  */
152
186
 
153
-
154
- TsMediaStream.prototype.getSnapshot = function getSnapshot(tsMediaElement) {
155
- var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
156
-
157
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
158
- _ref$format = _ref.format,
159
- format = _ref$format === undefined ? 'image/png' : _ref$format,
160
- _ref$quality = _ref.quality,
161
- quality = _ref$quality === undefined ? 0.92 : _ref$quality,
162
- x = _ref.x,
163
- y = _ref.y,
164
- w = _ref.w,
165
- h = _ref.h;
166
-
167
- throw new TypeError('The method \'getSnapshot\' is not implemented');
168
- };
169
-
170
- TsMediaStream.prototype.turnFlashlight = function turnFlashlight() {
171
- var isTorchOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
172
-
173
- throw new TypeError('The method \'turnFlashlight\' is not implemented');
174
- };
175
-
176
- TsMediaStream.prototype.setAutoLightOffTimer = function setAutoLightOffTimer(flashlightTimeout) {
177
- throw new TypeError('The method \'setAutoLightOffTimer\' is not implemented');
178
- };
179
-
187
+ }, {
188
+ key: "getSnapshot",
189
+ value: function getSnapshot(tsMediaElement) {
190
+ var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
191
+
192
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
193
+ _ref$format = _ref.format,
194
+ format = _ref$format === void 0 ? 'image/png' : _ref$format,
195
+ _ref$quality = _ref.quality,
196
+ quality = _ref$quality === void 0 ? 0.92 : _ref$quality,
197
+ x = _ref.x,
198
+ y = _ref.y,
199
+ w = _ref.w,
200
+ h = _ref.h;
201
+
202
+ throw new TypeError('The method \'getSnapshot\' is not implemented');
203
+ }
204
+ }, {
205
+ key: "turnFlashlight",
206
+ value: function turnFlashlight() {
207
+ var isTorchOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
208
+ throw new TypeError('The method \'turnFlashlight\' is not implemented');
209
+ }
210
+ }, {
211
+ key: "setAutoLightOffTimer",
212
+ value: function setAutoLightOffTimer(flashlightTimeout) {
213
+ throw new TypeError('The method \'setAutoLightOffTimer\' is not implemented');
214
+ }
180
215
  /* eslint-enable no-unused-vars */
181
216
 
217
+ }]);
182
218
 
183
- _createClass(TsMediaStream, [{
184
- key: 'videoDimensions',
185
- get: function get() {
186
- // FIXME the fallback dimensions should be removed, and the Opentok/Webrtc implementations
187
- // should pass the dimensions just like loopback does. I suspect current behavior is
188
- // the cause of the video element "jumping" (change size) on initial connection
189
- return { width: this._width || 480, height: this._height || 640 };
190
- }
191
- }]);
192
-
193
- return TsMediaStream;
219
+ return TsMediaStream;
194
220
  }(_eventEmitter.EventEmitter);
221
+
222
+ exports.TsMediaStream = TsMediaStream;
195
223
  //# sourceMappingURL=stream.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["oldCode/stream.js"],"names":["STREAM_EVENTS","PROPERTY_CHANGED","EVENTS","TsMediaStream","id","session","isRemote","videoTrackSettings","registerStream","remote","_width","width","_height","height","_environment","TsEnvironmentDetect","_updateVideoDimensions","videoEl","videoWidth","videoHeight","stream","property","value","videoDimensions","_session","emit","SESSION_EVENTS","STREAM_PROPERTY_CHANGED","setupDimensionsListener","subscriber","_clearUpdateDimensionsInterval","isIE11","isIOS","$","on","intervalId","setInterval","hasVideo","SUBSCRIBER_EVENTS","DESTROYED","clearInterval","getSnapshot","tsMediaElement","timeout","format","quality","x","y","w","h","TypeError","turnFlashlight","isTorchOn","setAutoLightOffTimer","flashlightTimeout","EventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAIA;;AAIA;;;;;;;;AAEA;;;AAGA,IAAMA,gBAAgB;AAClBC,sBAAkB;AADA,CAAtB;;QAIyBC,M,GAAjBF,a;;AAER;;;;;;;;;;;;;IAYaG,a,WAAAA,a;;;AACT,2BAAYC,EAAZ,EAAgBC,OAAhB,EAA8D;AAAA,YAArCC,QAAqC,uEAA1B,IAA0B;AAAA,YAApBC,kBAAoB;;AAAA;;AAAA,qDAC1D,wBAD0D;;AAG1DF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ourcesContent":["import {EventEmitter} from './event-emitter';\n\nimport {\n EVENTS as SESSION_EVENTS\n} from './session';\n\nimport {\n EVENTS as SUBSCRIBER_EVENTS\n} from './subscriber';\n\nimport {TsEnvironmentDetect} from '@techsee/techsee-common/lib/helpers/ts-environment-detect';\n\n/**\n * @enum STREAM_EVENTS\n */\nconst STREAM_EVENTS = {\n PROPERTY_CHANGED: 'PROPERTY_CHANGED'\n};\n\nexport {STREAM_EVENTS as EVENTS};\n\n/**\n * Media stream wrapper.\n *\n * Represents video or audio stream, local or remote.\n *\n * General interface for the specific implementations - TsOpenTokStream or TsWebRTCStream\n *\n * @interface\n *\n * @see TsOpenTokStream\n * @see TsWebRTCStream\n */\nexport class TsMediaStream extends EventEmitter {\n constructor(id, session, isRemote = true, videoTrackSettings) {\n super();\n\n session.registerStream(id, this);\n this.remote = isRemote;\n\n if (videoTrackSettings) {\n this._width = videoTrackSettings.width;\n this._height = videoTrackSettings.height;\n }\n\n /**\n * Environment detector\n *\n * @protected\n * @member { Object }\n */\n this._environment = new TsEnvironmentDetect();\n }\n\n /**\n * Stream video dimensions\n *\n * @member { Object }\n * @type { Object }\n */\n get videoDimensions() {\n // FIXME the fallback dimensions should be removed, and the Opentok/Webrtc implementations\n // should pass the dimensions just like loopback does. I suspect current behavior is\n // the cause of the video element \"jumping\" (change size) on initial connection\n return {width: this._width || 480, height: this._height || 640};\n }\n\n _updateVideoDimensions(videoEl) {\n if (videoEl) {\n this._width = videoEl.videoWidth;\n this._height = videoEl.videoHeight;\n\n const stream = this;\n const property = 'videoDimensions';\n const value = this.videoDimensions;\n\n this._session.emit(SESSION_EVENTS.STREAM_PROPERTY_CHANGED, {stream, property, value});\n }\n }\n\n setupDimensionsListener(videoEl, subscriber) {\n this._clearUpdateDimensionsInterval();\n\n this._width = videoEl.videoWidth;\n this._height = videoEl.videoHeight;\n\n if (!subscriber && !this._environment.isIE11() && !this._environment.isIOS()) {\n $(videoEl).on('resize', () => this._updateVideoDimensions(videoEl));\n } else {\n this.intervalId = setInterval(() => {\n if (subscriber && !(subscriber.stream && subscriber.stream.hasVideo)) {\n return;\n }\n\n if (this._width !== videoEl.videoWidth || this._height !== videoEl.videoHeight) {\n this._updateVideoDimensions(videoEl);\n }\n }, 500);\n }\n\n if (subscriber && this.intervalId) {\n subscriber.on(SUBSCRIBER_EVENTS.DESTROYED, () => {\n this._clearUpdateDimensionsInterval();\n });\n }\n }\n\n _clearUpdateDimensionsInterval() {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n\n this.intervalId = null;\n }\n }\n\n /* eslint-disable no-unused-vars */\n /**\n * Get snapshot of the current frame in the media stream\n *\n * Used internally in (TsMediaPublisher | TsMediaSubscriber).getSnapshot\n *\n * @method\n * @param { TsMediaPublisher | TsMediaSubscriber } tsMediaElement\n * @param { Number } timeout Usually used in IE. Time between video element transformation and snapshot.\n * @param { Object } options\n * format: Output MIME type (image/png or image/jpeg; default: image/png).\n * quality: Output quality (between 0 and 1; default: 0.92; applies only when the format is image/jpeg).\n * x: The x coordinate of the crop starting position.\n * y: The y coordinate of the crop starting position.\n * w: Crop width.\n * h: Crop Height.\n *\n * @returns { Promise<String> } snapshot\n */\n getSnapshot(tsMediaElement, timeout = 0, {format = 'image/png', quality = 0.92, x, y, w, h} = {}) {\n throw new TypeError('The method \\'getSnapshot\\' is not implemented');\n }\n\n turnFlashlight(isTorchOn = true) {\n throw new TypeError('The method \\'turnFlashlight\\' is not implemented');\n }\n\n setAutoLightOffTimer(flashlightTimeout) {\n throw new TypeError('The method \\'setAutoLightOffTimer\\' is not implemented');\n }\n\n /* eslint-enable no-unused-vars */\n}\n\n"]}
1
+ {"version":3,"sources":["oldCode/stream.js"],"names":["STREAM_EVENTS","PROPERTY_CHANGED","TsMediaStream","id","session","isRemote","videoTrackSettings","registerStream","remote","_width","width","_height","height","_environment","TsEnvironmentDetect","videoEl","videoWidth","videoHeight","stream","property","value","videoDimensions","_session","emit","SESSION_EVENTS","STREAM_PROPERTY_CHANGED","subscriber","_clearUpdateDimensionsInterval","isIE11","isIOS","$","on","_updateVideoDimensions","intervalId","setInterval","hasVideo","SUBSCRIBER_EVENTS","DESTROYED","clearInterval","tsMediaElement","timeout","format","quality","x","y","w","h","TypeError","isTorchOn","flashlightTimeout","EventEmitter"],"mappings":";;;;;;;;;AAAA;;AAEA;;AAIA;;AAIA;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,IAAMA,aAAa,GAAG;AAClBC,EAAAA,gBAAgB,EAAE;AADA,CAAtB;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaC,a;;;;;AACT,yBAAYC,EAAZ,EAAgBC,OAAhB,EAA8D;AAAA;;AAAA,QAArCC,QAAqC,uEAA1B,IAA0B;AAAA,QAApBC,kBAAoB;;AAAA;;AAC1D;AAEAF,IAAAA,OAAO,CAACG,cAAR,CAAuBJ,EAAvB;AACA,UAAKK,MAAL,GAAcH,QAAd;;AAEA,QAAIC,kBAAJ,EAAwB;AACpB,YAAKG,MAAL,GAAcH,kBAAkB,CAACI,KAAjC;AACA,YAAKC,OAAL,GAAeL,kBAAkB,CAACM,MAAlC;AACH;AAED;AACR;AACA;AACA;AACA;AACA;;;AACQ,UAAKC,YAAL,GAAoB,IAAIC,wCAAJ,EAApB;AAjB0D;AAkB7D;AAED;AACJ;AACA;AACA;AACA;AACA;;;;;SACI,eAAsB;AAClB;AACA;AACA;AACA,aAAO;AAACJ,QAAAA,KAAK,EAAE,KAAKD,MAAL,IAAe,GAAvB;AAA4BG,QAAAA,MAAM,EAAE,KAAKD,OAAL,IAAgB;AAApD,OAAP;AACH;;;WAED,gCAAuBI,OAAvB,EAAgC;AAC5B,UAAIA,OAAJ,EAAa;AACT,aAAKN,MAAL,GAAcM,OAAO,CAACC,UAAtB;AACA,aAAKL,OAAL,GAAeI,OAAO,CAACE,WAAvB;AAEA,YAAMC,MAAM,GAAG,IAAf;AACA,YAAMC,QAAQ,GAAG,iBAAjB;AAC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;WAED,0CAAiC;AAC7B,UAAI,KAAKM,UAAT,EAAqB;AACjBK,QAAAA,aAAa,CAAC,KAAKL,UAAN,CAAb;AAEA,aAAKA,UAAL,GAAkB,IAAlB;AACH;AACJ;AAED;;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,qBAAYM,cAAZ,EAAkG;AAAA,UAAtEC,OAAsE,uEAA5D,CAA4D;;AAAA,qFAAJ,EAAI;AAAA,6BAAxDC,MAAwD;AAAA,UAAxDA,MAAwD,4BAA/C,WAA+C;AAAA,8BAAlCC,OAAkC;AAAA,UAAlCA,OAAkC,6BAAxB,IAAwB;AAAA,UAAlBC,CAAkB,QAAlBA,CAAkB;AAAA,UAAfC,CAAe,QAAfA,CAAe;AAAA,UAAZC,CAAY,QAAZA,CAAY;AAAA,UAATC,CAAS,QAATA,CAAS;;AAC9F,YAAM,IAAIC,SAAJ,CAAc,+CAAd,CAAN;AACH;;;WAED,0BAAiC;AAAA,UAAlBC,SAAkB,uEAAN,IAAM;AAC7B,YAAM,IAAID,SAAJ,CAAc,kDAAd,CAAN;AACH;;;WAED,8BAAqBE,iBAArB,EAAwC;AACpC,YAAM,IAAIF,SAAJ,CAAc,wDAAd,CAAN;AACH;AAED;;;;;EAjH+BG,0B","sourcesContent":["import {EventEmitter} from './event-emitter';\n\nimport {\n EVENTS as SESSION_EVENTS\n} from './session';\n\nimport {\n EVENTS as SUBSCRIBER_EVENTS\n} from './subscriber';\n\nimport {TsEnvironmentDetect} from '@techsee/techsee-common/lib/helpers/ts-environment-detect';\n\n/**\n * @enum STREAM_EVENTS\n */\nconst STREAM_EVENTS = {\n PROPERTY_CHANGED: 'PROPERTY_CHANGED'\n};\n\nexport {STREAM_EVENTS as EVENTS};\n\n/**\n * Media stream wrapper.\n *\n * Represents video or audio stream, local or remote.\n *\n * General interface for the specific implementations - TsOpenTokStream or TsWebRTCStream\n *\n * @interface\n *\n * @see TsOpenTokStream\n * @see TsWebRTCStream\n */\nexport class TsMediaStream extends EventEmitter {\n constructor(id, session, isRemote = true, videoTrackSettings) {\n super();\n\n session.registerStream(id, this);\n this.remote = isRemote;\n\n if (videoTrackSettings) {\n this._width = videoTrackSettings.width;\n this._height = videoTrackSettings.height;\n }\n\n /**\n * Environment detector\n *\n * @protected\n * @member { Object }\n */\n this._environment = new TsEnvironmentDetect();\n }\n\n /**\n * Stream video dimensions\n *\n * @member { Object }\n * @type { Object }\n */\n get videoDimensions() {\n // FIXME the fallback dimensions should be removed, and the Opentok/Webrtc implementations\n // should pass the dimensions just like loopback does. I suspect current behavior is\n // the cause of the video element \"jumping\" (change size) on initial connection\n return {width: this._width || 480, height: this._height || 640};\n }\n\n _updateVideoDimensions(videoEl) {\n if (videoEl) {\n this._width = videoEl.videoWidth;\n this._height = videoEl.videoHeight;\n\n const stream = this;\n const property = 'videoDimensions';\n const value = this.videoDimensions;\n\n this._session.emit(SESSION_EVENTS.STREAM_PROPERTY_CHANGED, {stream, property, value});\n }\n }\n\n setupDimensionsListener(videoEl, subscriber) {\n this._clearUpdateDimensionsInterval();\n\n this._width = videoEl.videoWidth;\n this._height = videoEl.videoHeight;\n\n if (!subscriber && !this._environment.isIE11() && !this._environment.isIOS()) {\n $(videoEl).on('resize', () => this._updateVideoDimensions(videoEl));\n } else {\n this.intervalId = setInterval(() => {\n if (subscriber && !(subscriber.stream && subscriber.stream.hasVideo)) {\n return;\n }\n\n if (this._width !== videoEl.videoWidth || this._height !== videoEl.videoHeight) {\n this._updateVideoDimensions(videoEl);\n }\n }, 500);\n }\n\n if (subscriber && this.intervalId) {\n subscriber.on(SUBSCRIBER_EVENTS.DESTROYED, () => {\n this._clearUpdateDimensionsInterval();\n });\n }\n }\n\n _clearUpdateDimensionsInterval() {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n\n this.intervalId = null;\n }\n }\n\n /* eslint-disable no-unused-vars */\n /**\n * Get snapshot of the current frame in the media stream\n *\n * Used internally in (TsMediaPublisher | TsMediaSubscriber).getSnapshot\n *\n * @method\n * @param { TsMediaPublisher | TsMediaSubscriber } tsMediaElement\n * @param { Number } timeout Usually used in IE. Time between video element transformation and snapshot.\n * @param { Object } options\n * format: Output MIME type (image/png or image/jpeg; default: image/png).\n * quality: Output quality (between 0 and 1; default: 0.92; applies only when the format is image/jpeg).\n * x: The x coordinate of the crop starting position.\n * y: The y coordinate of the crop starting position.\n * w: Crop width.\n * h: Crop Height.\n *\n * @returns { Promise<String> } snapshot\n */\n getSnapshot(tsMediaElement, timeout = 0, {format = 'image/png', quality = 0.92, x, y, w, h} = {}) {\n throw new TypeError('The method \\'getSnapshot\\' is not implemented');\n }\n\n turnFlashlight(isTorchOn = true) {\n throw new TypeError('The method \\'turnFlashlight\\' is not implemented');\n }\n\n setAutoLightOffTimer(flashlightTimeout) {\n throw new TypeError('The method \\'setAutoLightOffTimer\\' is not implemented');\n }\n\n /* eslint-enable no-unused-vars */\n}\n\n"],"file":"stream.js"}
@@ -1,24 +1,41 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.TsMediaSubscriber = exports.EVENTS = undefined;
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5
4
 
6
- var _eventEmitter = require('./event-emitter');
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.TsMediaSubscriber = exports.EVENTS = void 0;
9
+
10
+ var _eventEmitter = require("./event-emitter");
7
11
 
8
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
13
 
10
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
14
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
15
+
16
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
17
+
18
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
19
+
20
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
+
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+
24
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
11
25
 
12
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
26
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
+
28
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
+
30
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
13
31
 
14
32
  /**
15
33
  * @enum SUBSCRIBER_EVENTS
16
34
  */
17
35
  var SUBSCRIBER_EVENTS = {
18
- DESTROYED: 'DESTROYED',
19
- DISCONNECTED: 'DISCONNECTED'
36
+ DESTROYED: 'DESTROYED',
37
+ DISCONNECTED: 'DISCONNECTED'
20
38
  };
21
-
22
39
  exports.EVENTS = SUBSCRIBER_EVENTS;
23
40
 
24
41
  /**
@@ -32,30 +49,34 @@ exports.EVENTS = SUBSCRIBER_EVENTS;
32
49
  *
33
50
  * @see TsMediaStream
34
51
  */
52
+ var TsMediaSubscriber = /*#__PURE__*/function (_EventEmitter) {
53
+ _inherits(TsMediaSubscriber, _EventEmitter);
35
54
 
36
- var TsMediaSubscriber = exports.TsMediaSubscriber = function (_EventEmitter) {
37
- _inherits(TsMediaSubscriber, _EventEmitter);
55
+ var _super = _createSuper(TsMediaSubscriber);
38
56
 
39
- function TsMediaSubscriber(data) {
40
- _classCallCheck(this, TsMediaSubscriber);
57
+ function TsMediaSubscriber(data) {
58
+ var _this;
41
59
 
42
- var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));
60
+ _classCallCheck(this, TsMediaSubscriber);
43
61
 
44
- _.assign(_this, data);
45
- return _this;
46
- }
62
+ _this = _super.call(this);
47
63
 
48
- /**
49
- * Unsubscribe from the media stream and destroy subscriber's view
50
- *
51
- * @method
52
- */
64
+ _.assign(_assertThisInitialized(_this), data);
53
65
 
66
+ return _this;
67
+ }
68
+ /**
69
+ * Unsubscribe from the media stream and destroy subscriber's view
70
+ *
71
+ * @method
72
+ */
54
73
 
55
- TsMediaSubscriber.prototype.destroy = function destroy() {
56
- return this.stream.destroySubscriber(this);
57
- };
58
74
 
75
+ _createClass(TsMediaSubscriber, [{
76
+ key: "destroy",
77
+ value: function destroy() {
78
+ return this.stream.destroySubscriber(this);
79
+ }
59
80
  /**
60
81
  * Get snapshot of the current frame in the media stream
61
82
  *
@@ -68,11 +89,11 @@ var TsMediaSubscriber = exports.TsMediaSubscriber = function (_EventEmitter) {
68
89
  * @returns { Promise<String> } snapshot
69
90
  */
70
91
 
71
-
72
- TsMediaSubscriber.prototype.getSnapshot = function getSnapshot(timeout, options) {
73
- return this.stream.getSnapshot(this, timeout, options);
74
- };
75
-
92
+ }, {
93
+ key: "getSnapshot",
94
+ value: function getSnapshot(timeout, options) {
95
+ return this.stream.getSnapshot(this, timeout, options);
96
+ }
76
97
  /**
77
98
  * Get statistics of the media subscription like bytes received.
78
99
  *
@@ -80,11 +101,15 @@ var TsMediaSubscriber = exports.TsMediaSubscriber = function (_EventEmitter) {
80
101
  * @returns { Promise<ToBeDefined> } stats
81
102
  */
82
103
 
104
+ }, {
105
+ key: "getStats",
106
+ value: function getStats() {
107
+ return this.stream.getStats(this);
108
+ }
109
+ }]);
83
110
 
84
- TsMediaSubscriber.prototype.getStats = function getStats() {
85
- return this.stream.getStats(this);
86
- };
87
-
88
- return TsMediaSubscriber;
111
+ return TsMediaSubscriber;
89
112
  }(_eventEmitter.EventEmitter);
113
+
114
+ exports.TsMediaSubscriber = TsMediaSubscriber;
90
115
  //# sourceMappingURL=subscriber.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["oldCode/subscriber.js"],"names":["SUBSCRIBER_EVENTS","DESTROYED","DISCONNECTED","EVENTS","TsMediaSubscriber","data","_","assign","destroy","stream","destroySubscriber","getSnapshot","timeout","options","getStats","EventEmitter"],"mappings":";;;;;AAAA;;;;;;;;AAEA;;;AAGA,IAAMA,oBAAoB;AACtBC,eAAW,WADW;AAEtBC,kBAAc;AAFQ,CAA1B;;QAK8BC,M,GAArBH,iB;;AAET;;;;;;;;;;;;IAWaI,iB,WAAAA,iB;;;AACT,+BAAYC,IAAZ,EAAkB;AAAA;;AAAA,qDACd,wBADc;;AAGdC,UAAEC,MAAF,QAAeF,IAAf;AAHc;AAIjB;;AAED;;;;;;;gCAKAG,O,sBAAU;AACN,eAAO,KAAKC,MAAL,CAAYC,iBAAZ,CAA8B,IAA9B,CAAP;AACH,K;;AAED;;;;;;;;;;;;;gCAWAC,W,wBAAYC,O,EAASC,O,EAAS;AAC1B,eAAO,KAAKJ,MAAL,CAAYE,WAAZ,CAAwB,IAAxB,EAA8BC,OAA9B,EAAuCC,OAAvC,CAAP;AACH,K;;AAED;;;;;;;;gCAMAC,Q,uBAAW;AACP,eAAO,KAAKL,MAAL,CAAYK,QAAZ,CAAqB,IAArB,CAAP;AACH,K;;;EAvCkCC,0B","file":"subscriber.js","sourcesContent":["import { EventEmitter } from './event-emitter';\n\n/**\n * @enum SUBSCRIBER_EVENTS\n */\nconst SUBSCRIBER_EVENTS = {\n DESTROYED: 'DESTROYED',\n DISCONNECTED: 'DISCONNECTED',\n};\n\nexport { SUBSCRIBER_EVENTS as EVENTS };\n\n/**\n * Subscriber object represents subscription to a media stream.\n *\n * Exposes session and stream wrapper methods specific for media subscription.\n *\n * Instance is returned by TsMediaStream.subscribe() call\n *\n * @class\n *\n * @see TsMediaStream\n */\nexport class TsMediaSubscriber extends EventEmitter {\n constructor(data) {\n super();\n\n _.assign(this, data);\n }\n\n /**\n * Unsubscribe from the media stream and destroy subscriber's view\n *\n * @method\n */\n destroy() {\n return this.stream.destroySubscriber(this);\n }\n\n /**\n * Get snapshot of the current frame in the media stream\n *\n * @method\n * @param { Number } timeout Usually used in IE.\n * Time between video element transformation and snapshot.\n *\n * @param { Object } options Snapshot options: format, quality and crop positions\n *\n * @returns { Promise<String> } snapshot\n */\n getSnapshot(timeout, options) {\n return this.stream.getSnapshot(this, timeout, options);\n }\n\n /**\n * Get statistics of the media subscription like bytes received.\n *\n * @method\n * @returns { Promise<ToBeDefined> } stats\n */\n getStats() {\n return this.stream.getStats(this);\n }\n}\n\n"]}
1
+ {"version":3,"sources":["oldCode/subscriber.js"],"names":["SUBSCRIBER_EVENTS","DESTROYED","DISCONNECTED","TsMediaSubscriber","data","_","assign","stream","destroySubscriber","timeout","options","getSnapshot","getStats","EventEmitter"],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,IAAMA,iBAAiB,GAAG;AACtBC,EAAAA,SAAS,EAAE,WADW;AAEtBC,EAAAA,YAAY,EAAE;AAFQ,CAA1B;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaC,iB;;;;;AACT,6BAAYC,IAAZ,EAAkB;AAAA;;AAAA;;AACd;;AAEAC,IAAAA,CAAC,CAACC,MAAF,gCAAeF,IAAf;;AAHc;AAIjB;AAED;AACJ;AACA;AACA;AACA;;;;;WACI,mBAAU;AACN,aAAO,KAAKG,MAAL,CAAYC,iBAAZ,CAA8B,IAA9B,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,qBAAYC,OAAZ,EAAqBC,OAArB,EAA8B;AAC1B,aAAO,KAAKH,MAAL,CAAYI,WAAZ,CAAwB,IAAxB,EAA8BF,OAA9B,EAAuCC,OAAvC,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,oBAAW;AACP,aAAO,KAAKH,MAAL,CAAYK,QAAZ,CAAqB,IAArB,CAAP;AACH;;;;EAvCkCC,0B","sourcesContent":["import { EventEmitter } from './event-emitter';\n\n/**\n * @enum SUBSCRIBER_EVENTS\n */\nconst SUBSCRIBER_EVENTS = {\n DESTROYED: 'DESTROYED',\n DISCONNECTED: 'DISCONNECTED',\n};\n\nexport { SUBSCRIBER_EVENTS as EVENTS };\n\n/**\n * Subscriber object represents subscription to a media stream.\n *\n * Exposes session and stream wrapper methods specific for media subscription.\n *\n * Instance is returned by TsMediaStream.subscribe() call\n *\n * @class\n *\n * @see TsMediaStream\n */\nexport class TsMediaSubscriber extends EventEmitter {\n constructor(data) {\n super();\n\n _.assign(this, data);\n }\n\n /**\n * Unsubscribe from the media stream and destroy subscriber's view\n *\n * @method\n */\n destroy() {\n return this.stream.destroySubscriber(this);\n }\n\n /**\n * Get snapshot of the current frame in the media stream\n *\n * @method\n * @param { Number } timeout Usually used in IE.\n * Time between video element transformation and snapshot.\n *\n * @param { Object } options Snapshot options: format, quality and crop positions\n *\n * @returns { Promise<String> } snapshot\n */\n getSnapshot(timeout, options) {\n return this.stream.getSnapshot(this, timeout, options);\n }\n\n /**\n * Get statistics of the media subscription like bytes received.\n *\n * @method\n * @returns { Promise<ToBeDefined> } stats\n */\n getStats() {\n return this.stream.getStats(this);\n }\n}\n\n"],"file":"subscriber.js"}