Skip to content

Commit

Permalink
fix: simplify condition
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Sep 23, 2024
1 parent a1a7b00 commit a8a8fd5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/hms-video-store/src/media/tracks/HMSRemoteVideoTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
}

private async updateLayer(source: string) {
const newLayer =
(!this.enabled || !this.hasSinks()) && !this.disableNoneLayerRequest
? HMSSimulcastLayer.NONE
: this.preferredLayer;
let newLayer: HMSSimulcastLayer = this.preferredLayer;
if (this.enabled || this.hasSinks()) {
newLayer = this.preferredLayer;
// send none only when the flag is not set
} else if (!this.disableNoneLayerRequest) {
newLayer = HMSSimulcastLayer.NONE;
}
if (!this.shouldSendVideoLayer(newLayer, source)) {
return;
}
Expand Down

0 comments on commit a8a8fd5

Please sign in to comment.