Skip to content

Commit

Permalink
Merge branch 'main' into codec-negotiation
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/client/src/Call.ts
  • Loading branch information
oliverlaz committed Jan 2, 2025
2 parents 3f224af + a7038f9 commit 00cca03
Show file tree
Hide file tree
Showing 30 changed files with 1,590 additions and 686 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.14.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.13.1...@stream-io/video-client-1.14.0) (2025-01-02)


### Features

* **closed captions:** Integration in the SDKs ([#1508](https://github.com/GetStream/stream-video-js/issues/1508)) ([bcb8589](https://github.com/GetStream/stream-video-js/commit/bcb85892c0dafcb03f9debf8d2fd361622224166))

## [1.13.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.13.0...@stream-io/video-client-1.13.1) (2024-12-20)


Expand Down
2 changes: 1 addition & 1 deletion packages/client/openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "../../node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.5.0"
"version": "7.8.0"
}
}
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.13.1",
"version": "1.14.0",
"packageManager": "[email protected]",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
59 changes: 56 additions & 3 deletions packages/client/src/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ import type {
SendCallEventResponse,
SendReactionRequest,
SendReactionResponse,
StartClosedCaptionsRequest,
StartClosedCaptionsResponse,
StartHLSBroadcastingResponse,
StartRecordingRequest,
StartRecordingResponse,
StartTranscriptionRequest,
StartTranscriptionResponse,
StatsOptions,
StopClosedCaptionsRequest,
StopClosedCaptionsResponse,
StopHLSBroadcastingResponse,
StopLiveResponse,
StopRecordingResponse,
Expand All @@ -76,14 +80,15 @@ import type {
UpdateCallResponse,
UpdateUserPermissionsRequest,
UpdateUserPermissionsResponse,
VideoResolution,
VideoDimension,
} from './gen/coordinator';
import { OwnCapability } from './gen/coordinator';
import {
AudioTrackType,
CallConstructor,
CallLeaveOptions,
ClientPublishOptions,
ClosedCaptionsSettings,
JoinCallData,
TrackMuteType,
VideoTrackType,
Expand Down Expand Up @@ -563,6 +568,7 @@ export class Call {
this.dynascaleManager.setSfuClient(undefined);

this.state.setCallingState(CallingState.LEFT);
this.state.dispose();

// Call all leave call hooks, e.g. to clean up global event handlers
this.leaveCallHooks.forEach((hook) => hook());
Expand Down Expand Up @@ -1854,7 +1860,54 @@ export class Call {
};

/**
* Sends a `call.permission_request` event to all users connected to the call. The call settings object contains infomration about which permissions can be requested during a call (for example a user might be allowed to request permission to publish audio, but not video).
* Starts the closed captions of the call.
*/
startClosedCaptions = async (
options?: StartClosedCaptionsRequest,
): Promise<StartClosedCaptionsResponse> => {
const trx = this.state.setCaptioning(true); // optimistic update
try {
return await this.streamClient.post<
StartClosedCaptionsResponse,
StartClosedCaptionsRequest
>(`${this.streamClientBasePath}/start_closed_captions`, options);
} catch (err) {
trx.rollback(); // revert the optimistic update
throw err;
}
};

/**
* Stops the closed captions of the call.
*/
stopClosedCaptions = async (
options?: StopClosedCaptionsRequest,
): Promise<StopClosedCaptionsResponse> => {
const trx = this.state.setCaptioning(false); // optimistic update
try {
return await this.streamClient.post<
StopClosedCaptionsResponse,
StopClosedCaptionsRequest
>(`${this.streamClientBasePath}/stop_closed_captions`, options);
} catch (err) {
trx.rollback(); // revert the optimistic update
throw err;
}
};

/**
* Updates the closed caption settings.
*
* @param config the closed caption settings to apply
*/
updateClosedCaptionSettings = (config: Partial<ClosedCaptionsSettings>) => {
this.state.updateClosedCaptionSettings(config);
};

/**
* Sends a `call.permission_request` event to all users connected to the call.
* The call settings object contains information about which permissions can be requested during a call
* (for example, a user might be allowed to request permission to publish audio, but not video).
*/
requestPermissions = async (
data: RequestPermissionRequest,
Expand Down Expand Up @@ -2460,7 +2513,7 @@ export class Call {
* preference has effect on. Affects all participants by default.
*/
setPreferredIncomingVideoResolution = (
resolution: VideoResolution | undefined,
resolution: VideoDimension | undefined,
sessionIds?: string[],
) => {
this.dynascaleManager.setVideoTrackSubscriptionOverrides(
Expand Down
Loading

0 comments on commit 00cca03

Please sign in to comment.