Skip to content

Commit

Permalink
Merge branch 'main' into report-low-power-and-thermal-info
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian-mkd committed Dec 18, 2024
2 parents d9626f3 + b3d1454 commit c36a1f7
Show file tree
Hide file tree
Showing 26 changed files with 730 additions and 411 deletions.
11 changes: 11 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.12.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.3...@stream-io/video-client-1.12.4) (2024-12-17)


* improve test coverage reporting ([#1624](https://github.com/GetStream/stream-video-js/issues/1624)) ([32bb870](https://github.com/GetStream/stream-video-js/commit/32bb870187f0627c32d2b5692ce3de633d743582))


### Bug Fixes

* adjust dynascale debouncing for upscaling and downscaling ([#1621](https://github.com/GetStream/stream-video-js/issues/1621)) [skip ci] ([7b3a721](https://github.com/GetStream/stream-video-js/commit/7b3a72192fab79d8af8d1c392a9f0135e2d25b16))
* prevent auto-dropping already accepted or rejected calls ([#1619](https://github.com/GetStream/stream-video-js/issues/1619)) ([113406a](https://github.com/GetStream/stream-video-js/commit/113406a9ba7fdf2e193a1933b73963e0011f28f0))

## [1.12.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.2...@stream-io/video-client-1.12.3) (2024-12-13)


Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-client",
"version": "1.12.3",
"version": "1.12.4",
"packageManager": "[email protected]",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
70 changes: 40 additions & 30 deletions packages/client/src/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,18 @@ export class Call {
);

this.leaveCallHooks.add(
// watch for auto drop cancellation
createSubscription(this.state.callingState$, (callingState) => {
// cancel auto-drop when call is
createSubscription(this.state.session$, (session) => {
if (!this.ringing) return;
if (
callingState === CallingState.JOINED ||
callingState === CallingState.JOINING ||
callingState === CallingState.LEFT
) {
clearTimeout(this.dropTimeout);
this.dropTimeout = undefined;

const receiverId = this.clientStore.connectedUser?.id;
if (!receiverId) return;

const isAcceptedByMe = Boolean(session?.accepted_by[receiverId]);
const isRejectedByMe = Boolean(session?.rejected_by[receiverId]);

if (isAcceptedByMe || isRejectedByMe) {
this.cancelAutoDrop();
}
}),
);
Expand Down Expand Up @@ -2004,28 +2006,36 @@ export class Call {
* Applicable only for ringing calls.
*/
private scheduleAutoDrop = () => {
clearTimeout(this.dropTimeout);
this.leaveCallHooks.add(
createSubscription(this.state.settings$, (settings) => {
if (!settings) return;
// ignore if the call is not ringing
if (this.state.callingState !== CallingState.RINGING) return;

const timeoutInMs = this.isCreatedByMe
? settings.ring.auto_cancel_timeout_ms
: settings.ring.incoming_call_timeout_ms;

// 0 means no auto-drop
if (timeoutInMs <= 0) return;
this.cancelAutoDrop();

const settings = this.state.settings;
if (!settings) return;
// ignore if the call is not ringing
if (this.state.callingState !== CallingState.RINGING) return;

const timeoutInMs = this.isCreatedByMe
? settings.ring.auto_cancel_timeout_ms
: settings.ring.incoming_call_timeout_ms;

// 0 means no auto-drop
if (timeoutInMs <= 0) return;

this.dropTimeout = setTimeout(() => {
// the call might have stopped ringing by this point,
// e.g. it was already accepted and joined
if (this.state.callingState !== CallingState.RINGING) return;
this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
this.logger('error', 'Failed to drop call', err);
});
}, timeoutInMs);
};

clearTimeout(this.dropTimeout);
this.dropTimeout = setTimeout(() => {
this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
this.logger('error', 'Failed to drop call', err);
});
}, timeoutInMs);
}),
);
/**
* Cancels a scheduled auto-drop timeout.
*/
private cancelAutoDrop = () => {
clearTimeout(this.dropTimeout);
this.dropTimeout = undefined;
};

/**
Expand Down
24 changes: 19 additions & 5 deletions packages/client/src/helpers/DynascaleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,14 @@ export class DynascaleManager {
});
});

let lastDimensions: string | undefined;
let lastDimensions: VideoDimension | undefined;
const resizeObserver = boundParticipant.isLocalParticipant
? null
: new ResizeObserver(() => {
const currentDimensions = `${videoElement.clientWidth},${videoElement.clientHeight}`;
const currentDimensions = {
width: videoElement.clientWidth,
height: videoElement.clientHeight,
};

// skip initial trigger
if (!lastDimensions) {
Expand All @@ -384,13 +387,24 @@ export class DynascaleManager {
}

if (
lastDimensions === currentDimensions ||
(lastDimensions.width === currentDimensions.width &&
lastDimensions.height === currentDimensions.height) ||
viewportVisibilityState === VisibilityState.INVISIBLE
) {
return;
}

requestTrackWithDimensions(DebounceType.SLOW, {
const relativeDelta = Math.max(
currentDimensions.width / lastDimensions.width,
currentDimensions.height / lastDimensions.height,
);
// Low quality video in an upscaled video element is very noticable.
// We try to upscale faster, and downscale slower. We also update debounce
// more if the size change is not significant, gurading against fast-firing
// resize events.
const debounceType =
relativeDelta > 1.2 ? DebounceType.IMMEDIATE : DebounceType.MEDIUM;
requestTrackWithDimensions(debounceType, {
width: videoElement.clientWidth,
height: videoElement.clientHeight,
});
Expand All @@ -413,7 +427,7 @@ export class DynascaleManager {
.subscribe((isPublishing) => {
if (isPublishing) {
// the participant just started to publish a track
requestTrackWithDimensions(DebounceType.FAST, {
requestTrackWithDimensions(DebounceType.IMMEDIATE, {
width: videoElement.clientWidth,
height: videoElement.clientHeight,
});
Expand Down
5 changes: 5 additions & 0 deletions packages/react-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.2.14](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.2.13...@stream-io/video-react-bindings-1.2.14) (2024-12-17)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.12.4`
## [1.2.13](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.2.12...@stream-io/video-react-bindings-1.2.13) (2024-12-13)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/react-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-react-bindings",
"version": "1.2.13",
"version": "1.2.14",
"packageManager": "[email protected]",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
Expand Down
20 changes: 20 additions & 0 deletions packages/react-native-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.4.21](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.4.20...@stream-io/video-react-native-sdk-1.4.21) (2024-12-17)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.12.4`
* `@stream-io/video-react-bindings` updated to version `1.2.14`
## [1.4.20](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.4.19...@stream-io/video-react-native-sdk-1.4.20) (2024-12-16)


### Bug Fixes

* **expo:** tools not present when notifee service is added ([edccf62](https://github.com/GetStream/stream-video-js/commit/edccf62261183198871f3962ef19650ed4fc1729))

## [1.4.19](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.4.18...@stream-io/video-react-native-sdk-1.4.19) (2024-12-16)


### Bug Fixes

* **rn:** break cyclic dependencies issue ([#1626](https://github.com/GetStream/stream-video-js/issues/1626)) ([ef30579](https://github.com/GetStream/stream-video-js/commit/ef3057949648581a5e17775661c859f693191f92))

## [1.4.18](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.4.17...@stream-io/video-react-native-sdk-1.4.18) (2024-12-16)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import {
withAndroidManifest,
} from '@expo/config-plugins';
import { ConfigProps } from './common/types';
const { prefixAndroidKeys, getMainApplicationOrThrow, getMainActivityOrThrow } =
AndroidConfig.Manifest;
const {
prefixAndroidKeys,
getMainApplicationOrThrow,
getMainActivityOrThrow,
ensureToolsAvailable,
} = AndroidConfig.Manifest;

// extract the type from array
type Unpacked<T> =
Expand Down Expand Up @@ -46,6 +50,7 @@ const withStreamVideoReactNativeSDKManifest: ConfigPlugin<ConfigProps> = (
const androidManifest = config.modResults;
const mainApplication = getMainApplicationOrThrow(androidManifest);
if (props?.ringingPushNotifications || props?.androidKeepCallAlive) {
ensureToolsAvailable(androidManifest);
/* Add the notifee foreground Service */
let services = mainApplication.service ?? [];
// we filter out the existing notifee service (if any) so that we can override it
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-react-native-sdk",
"version": "1.4.18",
"version": "1.4.21",
"packageManager": "[email protected]",
"main": "dist/commonjs/index.js",
"module": "dist/module/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react';
import { View, Animated, StyleSheet } from 'react-native';
import { useTheme } from '../../..';
import { useTheme } from '../../../contexts';

/**
* Props for the SpeechIndicator component.
Expand Down
6 changes: 6 additions & 0 deletions packages/react-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.8.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.8.4...@stream-io/video-react-sdk-1.8.5) (2024-12-17)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.12.4`
* `@stream-io/video-react-bindings` updated to version `1.2.14`
## [1.8.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.8.3...@stream-io/video-react-sdk-1.8.4) (2024-12-13)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/react-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-react-sdk",
"version": "1.8.4",
"version": "1.8.5",
"packageManager": "[email protected]",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
Expand Down
2 changes: 1 addition & 1 deletion sample-apps/react-native/dogfood/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-react-native-dogfood",
"version": "4.9.7",
"version": "4.9.10",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ dependencies {
} else {
implementation jscFlavor
}

implementation project(':notifee_react-native')
}

if (rnVersion < versionToNumber(0, 75, 0)) {
Expand Down
Loading

0 comments on commit c36a1f7

Please sign in to comment.