|
|
@@ -216,6 +216,28 @@ export class VideoContainer extends LargeContainer {
|
|
216
|
216
|
// copied between new <object> elements
|
|
217
|
217
|
//this.$video.on('play', onPlay);
|
|
218
|
218
|
this.$video[0].onplay = onPlayCallback;
|
|
|
219
|
+
|
|
|
220
|
+ /**
|
|
|
221
|
+ * A Set of functions to invoke when the video element resizes.
|
|
|
222
|
+ *
|
|
|
223
|
+ * @private
|
|
|
224
|
+ */
|
|
|
225
|
+ this._resizeListeners = new Set();
|
|
|
226
|
+
|
|
|
227
|
+ // As of May 16, 2017, temasys does not support resize events.
|
|
|
228
|
+ this.$video[0].onresize = this._onResize.bind(this);
|
|
|
229
|
+ }
|
|
|
230
|
+
|
|
|
231
|
+ /**
|
|
|
232
|
+ * Adds a function to the known subscribers of video element resize
|
|
|
233
|
+ * events.
|
|
|
234
|
+ *
|
|
|
235
|
+ * @param {Function} callback - The subscriber to notify when the video
|
|
|
236
|
+ * element resizes.
|
|
|
237
|
+ * @returns {void}
|
|
|
238
|
+ */
|
|
|
239
|
+ addResizeListener(callback) {
|
|
|
240
|
+ this._resizeListeners.add(callback);
|
|
219
|
241
|
}
|
|
220
|
242
|
|
|
221
|
243
|
/**
|
|
|
@@ -344,6 +366,18 @@ export class VideoContainer extends LargeContainer {
|
|
344
|
366
|
});
|
|
345
|
367
|
}
|
|
346
|
368
|
|
|
|
369
|
+ /**
|
|
|
370
|
+ * Removes a function from the known subscribers of video element resize
|
|
|
371
|
+ * events.
|
|
|
372
|
+ *
|
|
|
373
|
+ * @param {Function} callback - The callback to remove from known
|
|
|
374
|
+ * subscribers of video resize events.
|
|
|
375
|
+ * @returns {void}
|
|
|
376
|
+ */
|
|
|
377
|
+ removeResizeListener(callback) {
|
|
|
378
|
+ this._resizeListeners.delete(callback);
|
|
|
379
|
+ }
|
|
|
380
|
+
|
|
347
|
381
|
/**
|
|
348
|
382
|
* Update video stream.
|
|
349
|
383
|
* @param {JitsiTrack?} stream new stream
|
|
|
@@ -502,4 +536,14 @@ export class VideoContainer extends LargeContainer {
|
|
502
|
536
|
(this.videoType === VIDEO_CONTAINER_TYPE && !isAvatar)
|
|
503
|
537
|
? "#000" : interfaceConfig.DEFAULT_BACKGROUND);
|
|
504
|
538
|
}
|
|
|
539
|
+
|
|
|
540
|
+ /**
|
|
|
541
|
+ * Callback invoked when the video element changes dimensions.
|
|
|
542
|
+ *
|
|
|
543
|
+ * @private
|
|
|
544
|
+ * @returns {void}
|
|
|
545
|
+ */
|
|
|
546
|
+ _onResize() {
|
|
|
547
|
+ this._resizeListeners.forEach(callback => callback());
|
|
|
548
|
+ }
|
|
505
|
549
|
}
|