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) {
|
||||
this.videoStream = null;
|
||||
this.videoType = undefined;
|
||||
}
|
||||
|
||||
this.updateView();
|
||||
|
@ -484,7 +483,6 @@ export default class RemoteVideo extends SmallVideo {
|
|||
|
||||
if (isVideo) {
|
||||
this.videoStream = stream;
|
||||
this.videoType = stream.videoType;
|
||||
} else {
|
||||
this.audioStream = stream;
|
||||
}
|
||||
|
|
|
@ -243,6 +243,10 @@ export default class SmallVideo {
|
|||
* or hidden
|
||||
*/
|
||||
setScreenSharing(isScreenSharing) {
|
||||
if (isScreenSharing === this.isScreenSharing) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isScreenSharing = isScreenSharing;
|
||||
this.updateView();
|
||||
this.updateStatusBar();
|
||||
|
|
|
@ -489,7 +489,7 @@ const VideoLayout = {
|
|||
onVideoTypeChanged(id, newVideoType) {
|
||||
const remoteVideo = remoteVideos[id];
|
||||
|
||||
if (!remoteVideo || remoteVideo.videoType === newVideoType) {
|
||||
if (!remoteVideo) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue