Skip to content

Commit

Permalink
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian-mkd committed Nov 5, 2024
2 parents b31cc6f + 4ec9488 commit 0b10d27
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 7 deletions.
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.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.2...@stream-io/video-client-1.10.3) (2024-11-05)


### Bug Fixes

* camera flip did not work in react-native ([#1554](https://github.com/GetStream/stream-video-js/issues/1554)) ([423890c](https://github.com/GetStream/stream-video-js/commit/423890cb2d1925366d8a63c29f93c4c92c8104ad)), closes [#1521](https://github.com/GetStream/stream-video-js/issues/1521)

## [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)


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.2",
"version": "1.10.3",
"packageManager": "[email protected]",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
14 changes: 12 additions & 2 deletions packages/client/src/devices/CameraManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getVideoDevices, getVideoStream } from './devices';
import { TrackType } from '../gen/video/sfu/models/models';
import { PreferredCodec } from '../types';
import { isMobile } from '../compatibility';
import { isReactNative } from '../helpers/platforms';

export class CameraManager extends InputMediaDeviceManager<CameraManagerState> {
private targetResolution = {
Expand All @@ -22,13 +23,17 @@ export class CameraManager extends InputMediaDeviceManager<CameraManagerState> {
super(call, new CameraManagerState(), TrackType.VIDEO);
}

private isDirectionSupportedByDevice() {
return isReactNative() || isMobile();
}

/**
* Select the camera direction.
*
* @param direction the direction of the camera to select.
*/
async selectDirection(direction: Exclude<CameraDirection, undefined>) {
if (isMobile()) {
if (this.isDirectionSupportedByDevice()) {
this.state.setDirection(direction);
// Providing both device id and direction doesn't work, so we deselect the device
this.state.setDevice(undefined);
Expand Down Expand Up @@ -102,7 +107,12 @@ export class CameraManager extends InputMediaDeviceManager<CameraManagerState> {
constraints.height = this.targetResolution.height;
// We can't set both device id and facing mode
// Device id has higher priority
if (!constraints.deviceId && this.state.direction && isMobile()) {

if (
!constraints.deviceId &&
this.state.direction &&
this.isDirectionSupportedByDevice()
) {
constraints.facingMode =
this.state.direction === 'front' ? 'user' : 'environment';
}
Expand Down
7 changes: 7 additions & 0 deletions packages/client/src/devices/__tests__/CameraManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ vi.mock('../../compatibility.ts', () => {
};
});

vi.mock('../../helpers/platforms', () => {
console.log('MOCKING mobile device');
return {
isReactNative: () => false,
};
});

describe('CameraManager', () => {
let manager: CameraManager;

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.1.14](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.1.13...@stream-io/video-react-bindings-1.1.14) (2024-11-05)

### Dependency Updates

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


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.13",
"version": "1.1.14",
"packageManager": "[email protected]",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-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.2.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.2.11...@stream-io/video-react-native-sdk-1.2.12) (2024-11-05)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.10.3`
* `@stream-io/video-react-bindings` updated to version `1.1.14`
## [1.2.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.2.10...@stream-io/video-react-native-sdk-1.2.11) (2024-11-04)


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.2.11",
"version": "1.2.12",
"packageManager": "[email protected]",
"main": "dist/commonjs/index.js",
"module": "dist/module/index.js",
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.7.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.8...@stream-io/video-react-sdk-1.7.9) (2024-11-05)

### Dependency Updates

* `@stream-io/video-client` updated to version `1.10.3`
* `@stream-io/video-react-bindings` updated to version `1.1.14`
## [1.7.8](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.7...@stream-io/video-react-sdk-1.7.8) (2024-11-01)

### 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.8",
"version": "1.7.9",
"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.4.11",
"version": "4.4.12",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down

0 comments on commit 0b10d27

Please sign in to comment.