|
@@ -90,13 +90,13 @@ export default class RemoteVideo extends SmallVideo {
|
90
|
90
|
this._isRemoteControlSessionActive = false;
|
91
|
91
|
|
92
|
92
|
/**
|
93
|
|
- * The flag is set to <tt>true</tt> after the 'onplay' event has been
|
|
93
|
+ * The flag is set to <tt>true</tt> after the 'canplay' event has been
|
94
|
94
|
* triggered on the current video element. It goes back to <tt>false</tt>
|
95
|
95
|
* when the stream is removed. It is used to determine whether the video
|
96
|
96
|
* playback has ever started.
|
97
|
97
|
* @type {boolean}
|
98
|
98
|
*/
|
99
|
|
- this.wasVideoPlayed = false;
|
|
99
|
+ this._canPlayEventReceived = false;
|
100
|
100
|
|
101
|
101
|
/**
|
102
|
102
|
* The flag is set to <tt>true</tt> if remote participant's video gets muted
|
|
@@ -366,7 +366,7 @@ export default class RemoteVideo extends SmallVideo {
|
366
|
366
|
|
367
|
367
|
select.remove();
|
368
|
368
|
if (isVideo) {
|
369
|
|
- this.wasVideoPlayed = false;
|
|
369
|
+ this._canPlayEventReceived = false;
|
370
|
370
|
}
|
371
|
371
|
|
372
|
372
|
logger.info(`${isVideo ? 'Video' : 'Audio'} removed ${this.id}`, select);
|
|
@@ -390,13 +390,10 @@ export default class RemoteVideo extends SmallVideo {
|
390
|
390
|
}
|
391
|
391
|
|
392
|
392
|
/**
|
393
|
|
- * The remote video is considered "playable" once the stream has started
|
394
|
|
- * according to the {@link #hasVideoStarted} result.
|
395
|
|
- * It will be allowed to display video also in
|
396
|
|
- * {@link JitsiParticipantConnectionStatus.INTERRUPTED} if the video was ever
|
397
|
|
- * played and was not muted while not in ACTIVE state. This basically means
|
398
|
|
- * that there is stalled video image cached that could be displayed. It's used
|
399
|
|
- * to show "grey video image" in user's thumbnail when there are connectivity
|
|
393
|
+ * The remote video is considered "playable" once the can play event has been received. It will be allowed to
|
|
394
|
+ * display video also in {@link JitsiParticipantConnectionStatus.INTERRUPTED} if the video has received the canplay
|
|
395
|
+ * event and was not muted while not in ACTIVE state. This basically means that there is stalled video image cached
|
|
396
|
+ * that could be displayed. It's used to show "grey video image" in user's thumbnail when there are connectivity
|
400
|
397
|
* issues.
|
401
|
398
|
*
|
402
|
399
|
* @inheritdoc
|
|
@@ -406,7 +403,7 @@ export default class RemoteVideo extends SmallVideo {
|
406
|
403
|
const connectionState = APP.conference.getParticipantConnectionStatus(this.id);
|
407
|
404
|
|
408
|
405
|
return super.isVideoPlayable()
|
409
|
|
- && this.hasVideoStarted()
|
|
406
|
+ && this._canPlayEventReceived
|
410
|
407
|
&& (connectionState === JitsiParticipantConnectionStatus.ACTIVE
|
411
|
408
|
|| (connectionState === JitsiParticipantConnectionStatus.INTERRUPTED && !this.mutedWhileDisconnected));
|
412
|
409
|
}
|
|
@@ -459,26 +456,16 @@ export default class RemoteVideo extends SmallVideo {
|
459
|
456
|
return;
|
460
|
457
|
}
|
461
|
458
|
|
462
|
|
- streamElement.onplaying = () => {
|
463
|
|
- this.wasVideoPlayed = true;
|
|
459
|
+ streamElement.oncanplay = () => {
|
|
460
|
+ this._canPlayEventReceived = true;
|
464
|
461
|
this.VideoLayout.remoteVideoActive(streamElement, this.id);
|
465
|
|
- streamElement.onplaying = null;
|
|
462
|
+ streamElement.oncanplay = undefined;
|
466
|
463
|
|
467
|
464
|
// Refresh to show the video
|
468
|
465
|
this.updateView();
|
469
|
466
|
};
|
470
|
467
|
}
|
471
|
468
|
|
472
|
|
- /**
|
473
|
|
- * Checks whether the video stream has started for this RemoteVideo instance.
|
474
|
|
- *
|
475
|
|
- * @returns {boolean} true if this RemoteVideo has a video stream for which
|
476
|
|
- * the playback has been started.
|
477
|
|
- */
|
478
|
|
- hasVideoStarted() {
|
479
|
|
- return this.wasVideoPlayed;
|
480
|
|
- }
|
481
|
|
-
|
482
|
469
|
/**
|
483
|
470
|
*
|
484
|
471
|
* @param {*} stream
|
|
@@ -504,10 +491,10 @@ export default class RemoteVideo extends SmallVideo {
|
504
|
491
|
return;
|
505
|
492
|
}
|
506
|
493
|
|
507
|
|
- const streamElement = SmallVideo.createStreamElement(stream);
|
|
494
|
+ let streamElement = SmallVideo.createStreamElement(stream);
|
508
|
495
|
|
509
|
496
|
// Put new stream element always in front
|
510
|
|
- UIUtils.prependChild(this.container, streamElement);
|
|
497
|
+ streamElement = UIUtils.prependChild(this.container, streamElement);
|
511
|
498
|
|
512
|
499
|
$(streamElement).hide();
|
513
|
500
|
|