Merge branch 'feature_sfu' into feature_simulcast

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2023-01-07 09:49:21 +01:00
commit 53b21688b9
No known key found for this signature in database
GPG key ID: D1D45825D60C24D2
22 changed files with 168 additions and 44 deletions

View file

@ -31,14 +31,15 @@ export const AudioSink: React.FC<Props> = ({
tileDescriptor,
audioOutput,
}: Props) => {
const { audioMuted, localVolume, stream } = useCallFeed(
tileDescriptor.callFeed
);
const { localVolume, stream } = useCallFeed(tileDescriptor.callFeed);
const audioElementRef = useMediaStream(
stream,
audioOutput,
audioMuted,
// We don't compare the audioMuted flag of useCallFeed here, since unmuting
// depends on to-device messages which may lag behind the audio actually
// starting to flow over the stream
tileDescriptor.isLocal,
localVolume
);

View file

@ -106,8 +106,8 @@ function isInside([x, y]: number[], targetTile: TilePosition): boolean {
return true;
}
const getPipGap = (gridAspectRatio: number): number =>
gridAspectRatio < 1 ? 12 : 24;
const getPipGap = (gridAspectRatio: number, gridWidth: number): number =>
gridAspectRatio < 1 || gridWidth < 700 ? 12 : 24;
function getTilePositions(
tileCount: number,
@ -155,9 +155,10 @@ function getOneOnOneLayoutTilePositions(
const gridAspectRatio = gridWidth / gridHeight;
const pipWidth = gridAspectRatio < 1 ? 114 : 230;
const pipHeight = gridAspectRatio < 1 ? 163 : 155;
const pipGap = getPipGap(gridAspectRatio);
const smallPip = gridAspectRatio < 1 || gridWidth < 700;
const pipWidth = smallPip ? 114 : 230;
const pipHeight = smallPip ? 163 : 155;
const pipGap = getPipGap(gridAspectRatio, gridWidth);
const pipMinX = remotePosition.x + pipGap;
const pipMinY = remotePosition.y + pipGap;
@ -1045,7 +1046,10 @@ export function VideoGrid({
if (last) {
const remotePosition = tilePositions[1];
const pipGap = getPipGap(gridBounds.width / gridBounds.height);
const pipGap = getPipGap(
gridBounds.width / gridBounds.height,
gridBounds.width
);
const pipMinX = remotePosition.x + pipGap;
const pipMinY = remotePosition.y + pipGap;
const pipMaxX =