Skip to content

Commit

Permalink
Merge branch 'main' into vp9-publish
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/client/src/rtc/videoLayers.ts
  • Loading branch information
oliverlaz committed Sep 5, 2024
2 parents c9d292e + 2f9cd2e commit 86aacd7
Show file tree
Hide file tree
Showing 202 changed files with 9,487 additions and 5,265 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/version-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
push:
branches:
- main
paths-ignore:
- '!**/docusaurus/**'
- 'sample-apps/**'
paths:
- 'packages/**'

workflow_dispatch:

concurrency:
group: version-and-release-${{ github.ref }}
Expand Down Expand Up @@ -50,7 +51,6 @@ jobs:
run: yarn test:ci:libs

- name: Version and release packages
if: ${{ github.ref_name == 'main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@
"sample:react:tutorial": "yarn workspace @stream-io/stream-video-react-tutorial run dev",
"start:docs:react": "yarn workspace @stream-io/video-react-sdk run start:docs ",
"release": "nx run-many --target version --parallel=1",
"release:react-bindings": "yarn workspace @stream-io/video-react-bindings npm publish --access=public",
"release:react-sdk": "yarn workspace @stream-io/video-react-sdk npm publish --access=public",
"release:react-native-sdk": "yarn workspace @stream-io/video-react-native-sdk npm publish --access=public",
"release:audio-filters-web": "yarn workspace @stream-io/audio-filters-web npm publish --access=public",
"release:video-filters-web": "yarn workspace @stream-io/video-filters-web npm publish --access=public",
"release:video-filters-react-native": "yarn workspace @stream-io/video-filters-react-native npm publish --access=public",
"release:styling": "yarn workspace @stream-io/video-styling npm publish --access=public"
"release:client": "yarn workspace @stream-io/video-client npm publish --access=public --tag=latest",
"release:react-bindings": "yarn workspace @stream-io/video-react-bindings npm publish --access=public --tag=latest",
"release:react-sdk": "yarn workspace @stream-io/video-react-sdk npm publish --access=public --tag=latest",
"release:react-native-sdk": "yarn workspace @stream-io/video-react-native-sdk npm publish --access=public --tag=latest",
"release:audio-filters-web": "yarn workspace @stream-io/audio-filters-web npm publish --access=public --tag=latest",
"release:video-filters-web": "yarn workspace @stream-io/video-filters-web npm publish --access=public --tag=latest",
"release:video-filters-react-native": "yarn workspace @stream-io/video-filters-react-native npm publish --access=public --tag=latest",
"release:styling": "yarn workspace @stream-io/video-styling npm publish --access=public --tag=latest"
},
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-angular": "^17.0.0",
"@jscutlery/semver": "^2.30.1",
"@nrwl/devkit": "^16.0.1",
"@jscutlery/semver": "^3.4.1",
"@nx/devkit": "^16.10.0",
"@types/eslint": "^8.56.10",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
Expand All @@ -74,11 +75,10 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"ngx-deploy-npm": "^5.2.0",
"nx": "16.0.1",
"nx": "16.10.0",
"prettier": "^3.3.2",
"typescript": "^5.5.2",
"vercel": "^34.2.7",
"vercel": "^37.2.1",
"vite": "^4.4.11"
},
"resolutions": {
Expand Down
608 changes: 343 additions & 265 deletions packages/client/CHANGELOG.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Ending a call requires a [special permission](../../guides/permissions-and-moder
await call.endCall();
```

Only users with special permission can join an ended call.
Only users with a special permission (`OwnCapability.JOIN_ENDED_CALL`) can join an ended call.

### Load call

Expand Down Expand Up @@ -200,6 +200,34 @@ await call.update({
});
```

### Backstage setup

The backstage feature makes it easy to build a use-case where you and your co-hosts can set up your camera before going live.
Only after you call `call.goLive()` the regular users will be allowed to join the livestream.

However, you can also specify a `join_ahead_time_seconds`,
which will allow regular users to join the livestream before the call is live, in the specified join time before the stream starts.

Here's an example of how to do that:

```typescript
await call.getOrCreate({
data: {
starts_at: new Date(Date.now() + 500 * 1000), // 500 seconds from now
settings_override: {
backstage: {
enabled: true,
join_ahead_time_seconds: 300,
},
},
},
});
```

In the code snippet above, we are creating a call that starts 500 seconds from now.
We are also enabling backstage mode, with a `join_ahead_time_seconds` of 300 seconds.
That means that regular users will be able to join the call 200 seconds from now.

## Restricting access

You can restrict access to a call by tweaking the [Call Type](../../guides/configuring-call-types/) permissions and roles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ call.microphone.state.mediaStream$.subscribe((mediaStream) => {

Check our [Noise Cancellation](../../guides/noise-cancellation) guide.

## Camera and Microphone Filters
## Camera and Microphone AI/ML Filters

Both the Camera and the Microphone allow you to apply filters to the media stream.
Both the Camera and the Microphone allow you to apply AI/ML filters to the media stream.
This can be useful for various use-cases, such as:

- applying a video effects such as background blurring, or background replacement
Expand All @@ -312,20 +312,30 @@ import { Call } from '@stream-io/video-client';
let call: Call;

// apply a custom video filter
const unregisterMyVideoFilter = await camera.registerFilter(
async function myVideoFilter(inputMediaStream: MediaStream) {
const { unregister: unregisterMyVideoFilter } = camera.registerFilter(
function myVideoFilter(inputMediaStream: MediaStream) {
// initialize the video filter, do some magic and
// return the modified media stream
return mediaStreamWithFilterApplied;
return {
output: mediaStreamWithFilterApplied,
stop: () => {
// optional cleanup function
},
};
},
);

// apply a custom audio filter
const unregisterMyAudioFilter = await microphone.registerFilter(
async function myAudioFilter(inputMediaStream: MediaStream) {
const { unregister: unregisterMyAudioFilter } = microphone.registerFilter(
function myAudioFilter(inputMediaStream: MediaStream) {
// initialize the audio filter, do some magic and
// return the modified media stream
return mediaStreamWithFilterApplied;
return {
output: mediaStreamWithFilterApplied,
stop: () => {
// optional cleanup function
},
};
},
);

Expand All @@ -338,6 +348,34 @@ Filters can be registered and unregistered at any time, and the SDK will take ca
Filters can be chained, and the order of registration matters.
The first registered filter will be the first to modify the raw `MediaStream`.

A filter may be asynchronous. In this case, the function passed to the `registerFilter` method should _synchronously_
return an object where `output` is a promise that resolves to a `MediaStream`:

```typescript
camera.registerFilter(function myVideoFilter(inputMediaStream: MediaStream) {
// note that output is returned synchronously!
return {
output: new Promise((resolve) => resolve(mediaStreamWithFilterApplied)),
stop: () => {
// optional cleanup function
},
};
});
```

Registering a filter is not instantaneous. If you need to know when a filter is registered (e.g. to show
a spinner in the UI), await for the `registered` promise returned by the `registerFilter` method:

```typescript
const { registered } = camera.registerFilter(
(inputMediaStream: MediaStream) => {
// your video filter
},
);
await registered;
// at this point, the filter is registered
```

Once a filter(s) is registered, the SDK will send the last returned `MediaStream` to the remote participants.

## Speaker management
Expand Down
6 changes: 3 additions & 3 deletions 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.4.4",
"version": "1.6.0",
"packageManager": "[email protected]",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-typescript": "^11.1.6",
"@stream-io/audio-filters-web": "workspace:^",
"@stream-io/node-sdk": "^0.1.12",
"@stream-io/node-sdk": "^0.4.0",
"@types/sdp-transform": "^2.4.7",
"@types/ua-parser-js": "^0.7.37",
"@vitest/coverage-v8": "^0.34.4",
Expand All @@ -57,7 +57,7 @@
"rollup": "^3.29.4",
"typescript": "^5.5.2",
"vite": "^4.4.11",
"vitest": "^0.34.4",
"vitest": "^1.0.0",
"vitest-mock-extended": "^1.2.1"
}
}
19 changes: 11 additions & 8 deletions packages/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"executor": "@jscutlery/semver:version",
"options": {
"dryRun": false,
"baseBranch": "main",
"preset": {
"name": "conventionalcommits",
"preMajor": false,
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "chore", "hidden": true},
{"type": "chore", "hidden": false},
{"type": "docs", "hidden": true},
{"type": "style", "hidden": true},
{"type": "refactor", "hidden": true},
Expand All @@ -25,7 +26,7 @@
"postTargets": [
"@stream-io/video-client:update-version",
"@stream-io/video-client:github",
"@stream-io/video-client:npm"
"@stream-io/video-client:publish"
]
}
},
Expand All @@ -47,13 +48,15 @@
"notes": "${notes}"
}
},
"npm": {
"executor": "ngx-deploy-npm:deploy",
"publish": {
"executor": "nx:run-commands",
"options": {
"access": "public",
"noBuild": true,
"dryRun": false,
"distFolderPath": "packages/client"
"commands": [
{
"command": "yarn release:client",
"forwardAllArgs": false
}
]
}
}
}
Expand Down
Loading

0 comments on commit 86aacd7

Please sign in to comment.