fix(SmallVideo) screen-sharing indicator
The stream is attached before the video type change event is fired, so comparing them is too late. Unconditionally update the screen-sharing indicator, and perform the check for a change right there, to avoid re-renders.
This commit is contained in:
parent
188771751d
commit
119b79fd84
|
@ -373,7 +373,6 @@ export default class RemoteVideo extends SmallVideo {
|
||||||
|
|
||||||
if (stream === this.videoStream) {
|
if (stream === this.videoStream) {
|
||||||
this.videoStream = null;
|
this.videoStream = null;
|
||||||
this.videoType = undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateView();
|
this.updateView();
|
||||||
|
@ -484,7 +483,6 @@ export default class RemoteVideo extends SmallVideo {
|
||||||
|
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
this.videoStream = stream;
|
this.videoStream = stream;
|
||||||
this.videoType = stream.videoType;
|
|
||||||
} else {
|
} else {
|
||||||
this.audioStream = stream;
|
this.audioStream = stream;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,6 +243,10 @@ export default class SmallVideo {
|
||||||
* or hidden
|
* or hidden
|
||||||
*/
|
*/
|
||||||
setScreenSharing(isScreenSharing) {
|
setScreenSharing(isScreenSharing) {
|
||||||
|
if (isScreenSharing === this.isScreenSharing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.isScreenSharing = isScreenSharing;
|
this.isScreenSharing = isScreenSharing;
|
||||||
this.updateView();
|
this.updateView();
|
||||||
this.updateStatusBar();
|
this.updateStatusBar();
|
||||||
|
|
|
@ -489,7 +489,7 @@ const VideoLayout = {
|
||||||
onVideoTypeChanged(id, newVideoType) {
|
onVideoTypeChanged(id, newVideoType) {
|
||||||
const remoteVideo = remoteVideos[id];
|
const remoteVideo = remoteVideos[id];
|
||||||
|
|
||||||
if (!remoteVideo || remoteVideo.videoType === newVideoType) {
|
if (!remoteVideo) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue