Skip to content

Commit

Permalink
fix(plugin-meetings): skip requesting max fs update when width/height…
Browse files Browse the repository at this point in the history
… are zero (#3980)
  • Loading branch information
k-wasniowski authored Nov 19, 2024
1 parent 045b1ac commit d5445fe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ export class RemoteMedia extends EventsScope {
* to restrict the requested resolution to this size
* @param width width of the video element
* @param height height of the video element
* @note width/height of 0 will be ignored
*/
public setSizeHint(width, height) {
// only base on height for now
let fs: number;

if (width === 0 || height === 0) {
return;
}

if (height < 135) {
fs = 60;
} else if (height < 270) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {RemoteMedia, RemoteMediaEvents} from '@webex/plugin-meetings/src/multist
import {ReceiveSlotEvents} from '@webex/plugin-meetings/src/multistream/receiveSlot';
import sinon from 'sinon';
import {assert} from '@webex/test-helper-chai';
import { forEach } from 'lodash';
import {forEach} from 'lodash';

describe('RemoteMedia', () => {
let remoteMedia;
Expand Down Expand Up @@ -227,12 +227,26 @@ describe('RemoteMedia', () => {
});

describe('setSizeHint()', () => {

it('works if the receive slot is undefined', () => {
remoteMedia.receiveSlot = undefined;
remoteMedia.setSizeHint(100, 100);
});

forEach(
[
{width: 0, height: 0},
{width: 135, height: 0},
{width: 0, height: 240},
],
({width, height}) => {
it(`skip updating the max fs when applied ${width}:${height}`, () => {
remoteMedia.setSizeHint(width, height);

assert.notCalled(fakeReceiveSlot.setMaxFs);
});
}
);

forEach(
[
{height: 134, fs: 60},
Expand Down

0 comments on commit d5445fe

Please sign in to comment.