Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into codec-negotiation
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz committed Nov 1, 2024
2 parents f313515 + c3a8bc3 commit 5a41f52
Show file tree
Hide file tree
Showing 21 changed files with 122 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/react-native-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
name: Deploy iOS
needs: build_ios
timeout-minutes: 60
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/PBE-5855-feat/react-native-video-design-v2' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## [1.10.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.1...@stream-io/video-client-1.10.2) (2024-11-01)


### Bug Fixes

* camera not enabled on foreground notifications ([#1546](https://github.com/GetStream/stream-video-js/issues/1546)) ([67c920a](https://github.com/GetStream/stream-video-js/commit/67c920ac4bca35a414b88f6c9829b08396a6260b))

## [1.10.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.0...@stream-io/video-client-1.10.1) (2024-10-30)


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.10.1",
"version": "1.10.2",
"packageManager": "[email protected]",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/devices/InputMediaDeviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export abstract class InputMediaDeviceManager<
* Starts stream.
*/
async enable() {
this.state.prevStatus = this.state.optimisticStatus;
if (this.state.optimisticStatus === 'enabled') {
return;
}

this.state.setPendingStatus('enabled');

await withCancellation(this.statusChangeConcurrencyTag, async (signal) => {
Expand All @@ -97,7 +97,7 @@ export abstract class InputMediaDeviceManager<
* @param {boolean} [forceStop=false] when true, stops the tracks regardless of the state.disableMode
*/
async disable(forceStop: boolean = false) {
this.state.prevStatus = this.state.status;
this.state.prevStatus = this.state.optimisticStatus;
if (!forceStop && this.state.optimisticStatus === 'disabled') {
return;
}
Expand Down Expand Up @@ -131,7 +131,7 @@ export abstract class InputMediaDeviceManager<
async resume() {
if (
this.state.prevStatus === 'enabled' &&
this.state.status === 'disabled'
this.state.status !== 'enabled'
) {
await this.enable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ describe('InputMediaDeviceManager.test', () => {
expect(manager.enable).toHaveBeenCalledOnce();
});

it(`should resume if enable was cancelled due to disable call`, async () => {
vi.spyOn(manager, 'enable');

manager.enable();

expect(manager.enable).toHaveBeenCalledOnce();

// enable was not awaited so cancelled by disabled
await manager.disable();

manager.resume();

expect(manager.enable).toBeCalledTimes(2);

// this disable is not awaited, but will cancel the enable anyway
// so resume must work here too
manager.disable();

manager.resume();

expect(manager.enable).toBeCalledTimes(3);
});

it('should provide default constraints to `getStream` method', () => {
manager.setDefaultConstraints({
echoCancellation: true,
Expand Down
12 changes: 12 additions & 0 deletions packages/react-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## [1.1.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.1.11...@stream-io/video-react-bindings-1.1.12) (2024-11-01)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.10.2`
## [1.1.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.1.10...@stream-io/video-react-bindings-1.1.11) (2024-11-01)


### Bug Fixes

* move useToggleCallRecording to react-bindings ([#1545](https://github.com/GetStream/stream-video-js/issues/1545)) ([73014ca](https://github.com/GetStream/stream-video-js/commit/73014ca6a4585680f581c4e9481c2d286f2fcd37))

## [1.1.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.1.9...@stream-io/video-react-bindings-1.1.10) (2024-10-30)

### 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.1.10",
"version": "1.1.12",
"packageManager": "[email protected]",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { useCallback, useEffect, useState } from 'react';
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';

/**
* Custom hook for toggling call recording in a video call.
*
* This hook provides functionality to start and stop call recording,
* along with state management for tracking the recording status
* and the loading indicator while awaiting a response.
*/
export const useToggleCallRecording = () => {
const call = useCall();
const { useIsCallRecordingInProgress } = useCallStateHooks();
Expand Down
1 change: 1 addition & 0 deletions packages/react-bindings/src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as CallStateHooks from './callStateHooks';

export * from './store';
export * from './callUtilHooks';

/**
* A hook-alike function that exposes all call state hooks.
Expand Down
16 changes: 16 additions & 0 deletions packages/react-native-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

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

## [1.2.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.2.8...@stream-io/video-react-native-sdk-1.2.9) (2024-11-01)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.10.2`
* `@stream-io/video-react-bindings` updated to version `1.1.12`

### Bug Fixes

* camera not enabled on foreground notifications ([#1546](https://github.com/GetStream/stream-video-js/issues/1546)) ([67c920a](https://github.com/GetStream/stream-video-js/commit/67c920ac4bca35a414b88f6c9829b08396a6260b))

## [1.2.8](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.2.7...@stream-io/video-react-native-sdk-1.2.8) (2024-11-01)

### Dependency Updates

* `@stream-io/video-react-bindings` updated to version `1.1.11`
## [1.2.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.2.6...@stream-io/video-react-native-sdk-1.2.7) (2024-10-30)

### Dependency Updates
Expand Down
3 changes: 2 additions & 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.2.7",
"version": "1.2.9",
"packageManager": "[email protected]",
"main": "dist/commonjs/index.js",
"module": "dist/module/index.js",
Expand Down Expand Up @@ -51,6 +51,7 @@
"intl-pluralrules": "2.0.1",
"lodash.merge": "^4.6.2",
"react-native-url-polyfill": "1.3.0",
"rxjs": "~7.8.1",
"text-encoding-polyfill": "0.6.7"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-sdk/src/contexts/ThemeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, {
useMemo,
} from 'react';

import merge from 'lodash/merge';
import merge from 'lodash.merge';

import { defaultTheme, Theme } from '../theme/theme';

Expand Down
12 changes: 10 additions & 2 deletions packages/react-native-sdk/src/providers/StreamCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ const AppStateListener = () => {
// in Android, we need to check if we are in PiP mode
// in PiP mode, we don't want to disable the camera
NativeModules?.StreamVideoReactNative?.isInPiPMode().then(
async (isInPiP: boolean | null | undefined) => {
(isInPiP: boolean | null | undefined) => {
if (!isInPiP) {
await call?.camera?.disable();
const currentState = appState.current;
if (currentState === 'active') {
// this is to handle the case that the app became active as soon as it went to background
// in this case, we dont want to disable the camera
// this happens on foreground push notifications
return;
}
call?.camera?.disable();
}
}
);
} else {
// shouldDisableIOSLocalVideoOnBackgroundRef is false, if local video is enabled on PiP
if (shouldDisableIOSLocalVideoOnBackgroundRef.current) {
call?.camera?.disable();
}
Expand Down
16 changes: 16 additions & 0 deletions packages/react-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

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

## [1.7.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.6...@stream-io/video-react-sdk-1.7.7) (2024-11-01)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.10.2`
* `@stream-io/video-react-bindings` updated to version `1.1.12`
## [1.7.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.5...@stream-io/video-react-sdk-1.7.6) (2024-11-01)

### Dependency Updates

* `@stream-io/video-react-bindings` updated to version `1.1.11`

### Bug Fixes

* move useToggleCallRecording to react-bindings ([#1545](https://github.com/GetStream/stream-video-js/issues/1545)) ([73014ca](https://github.com/GetStream/stream-video-js/commit/73014ca6a4585680f581c4e9481c2d286f2fcd37))

## [1.7.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.4...@stream-io/video-react-sdk-1.7.5) (2024-10-30)

### 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.7.5",
"version": "1.7.7",
"packageManager": "[email protected]",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { forwardRef } from 'react';

import { OwnCapability } from '@stream-io/video-client';
import { Restricted, useI18n } from '@stream-io/video-react-bindings';
import {
Restricted,
useI18n,
useToggleCallRecording,
} from '@stream-io/video-react-bindings';
import { CompositeButton } from '../Button/';
import { Icon } from '../Icon';
import {
Expand All @@ -11,7 +15,6 @@ import {
useMenuContext,
} from '../Menu';
import { LoadingIndicator } from '../LoadingIndicator';
import { useToggleCallRecording } from '../../hooks';
import { WithTooltip } from '../Tooltip';

export type RecordCallButtonProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { PropsWithChildren, useEffect, useState } from 'react';
import { useI18n } from '@stream-io/video-react-bindings';
import { useToggleCallRecording } from '../../hooks';
import {
useI18n,
useToggleCallRecording,
} from '@stream-io/video-react-bindings';
import { Notification } from './Notification';

export type RecordingInProgressNotificationProps = {
Expand Down
1 change: 0 additions & 1 deletion packages/react-sdk/src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './useFloatingUIPreset';
export * from './usePersistedDevicePreferences';
export * from './useScrollPosition';
export * from './useToggleCallRecording';
export * from './useRequestPermission';
17 changes: 9 additions & 8 deletions sample-apps/react-native/dogfood/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ PODS:
- React-Core
- react-native-netinfo (11.3.0):
- React-Core
- react-native-safe-area-context (4.8.2):
- react-native-safe-area-context (4.10.5):
- React-Core
- react-native-video (6.0.0-beta.5):
- React-Core
Expand Down Expand Up @@ -1126,15 +1126,16 @@ PODS:
- React-Core
- RNReactNativeHapticFeedback (2.0.3):
- React-Core
- RNReanimated (3.7.0):
- RNReanimated (3.10.1):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNScreens (3.29.0):
- RNScreens (3.31.1):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- React-RCTImage
- RNSVG (13.9.0):
- React-Core
- RNVoipPushNotification (3.3.2):
Expand All @@ -1148,7 +1149,7 @@ PODS:
- stream-react-native-webrtc (124.0.0-rc.1):
- JitsiWebRTC (~> 124.0.0)
- React-Core
- stream-video-react-native (1.1.4):
- stream-video-react-native (1.2.7):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1439,7 +1440,7 @@ SPEC CHECKSUMS:
react-native-image-resizer: d9fb629a867335bdc13230ac2a58702bb8c8828f
react-native-mmkv: 7da5e18e55c04a9af9a7e0ab9792a1e8d33765a1
react-native-netinfo: 299dad906cdbf3b67bcc6f693c807f98bdd127cc
react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89
react-native-safe-area-context: a240ad4b683349e48b1d51fed1611138d1bdad97
react-native-video: df7d8a4c8568ed4a31b28e6cd2bfa4a98b186e36
React-nativeconfig: ca8b90c736cf3be019cb332ca42d93dd95b32e05
React-NativeModulesApple: 1fdffcce7772e274baeab33a1900f45feba86cbd
Expand Down Expand Up @@ -1472,14 +1473,14 @@ SPEC CHECKSUMS:
RNNotifee: f3c01b391dd8e98e67f539f9a35a9cbcd3bae744
RNPermissions: 4d64d2c763b20e5db08dfb8f1ef541f95c0d28c1
RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df
RNReanimated: ea7e98bf4f1167ca3cd3c348604d34dc4294e848
RNScreens: 2b73f5eb2ac5d94fbd61fa4be0bfebd345716825
RNReanimated: 8cd12e58bbedca2b0b62a3c3872d3629fc2e1583
RNScreens: 35f3344904f6bba888c0e61532278436e275de3c
RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315
RNVoipPushNotification: 543e18f83089134a35e7f1d2eba4c8b1f7776b08
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
stream-io-video-filters-react-native: 8c345e6adf5164646696d45f9962c4199b2fe3b9
stream-react-native-webrtc: 1380525629fae21f4894535189573fb4ddb7984a
stream-video-react-native: 25880e3ff2889deca42fba87f6fa0c434fc6e5fa
stream-video-react-native: 7948f9d3bfd695f46d90f7d05b982b31b0c304a8
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312

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.4.7",
"version": "4.4.9",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8072,6 +8072,7 @@ __metadata:
react-native-voip-push-notification: 3.3.1
react-test-renderer: ^18.2.0
rimraf: ^5.0.7
rxjs: ~7.8.1
text-encoding-polyfill: 0.6.7
ts-jest: ^29.1.5
ts-node: ^10.9.2
Expand Down

0 comments on commit 5a41f52

Please sign in to comment.