Skip to content

Commit

Permalink
Automated cherry pick of #8185 (#8186)
Browse files Browse the repository at this point in the history
* [MM-60291] Fix rendering of live captions (#8185)

* Load jobs state from call state

* Fix rendering of live captions overlay

(cherry picked from commit 13ca346)

* Fix type error

---------

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
  • Loading branch information
mattermost-build and streamer45 authored Aug 28, 2024
1 parent 6a402e3 commit dfffcc0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/products/calls/components/captions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ const styles = StyleSheet.create({
captionContainer: {
display: 'flex',
height: 400,
bottom: -352, // 48-400, to place the bottoms at the same place
bottom: 400 - 48, // to place the bottoms at the same place
gap: 8,
alignItems: 'center',
flexDirection: 'column-reverse',
overflow: 'hidden',

// needed so that events (e.g., long press on participants)
// still work when the captions overlay is rendered on top
pointerEvents: 'none',
},
caption: {
paddingTop: 1,
Expand Down
8 changes: 8 additions & 0 deletions app/products/calls/connection/websocket_event_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,13 @@ export const handleCallState = (serverUrl: string, msg: WebSocketMessage<CallSta
const call = createCallAndAddToIds(msg.data.channel_id, callState);

setCallForChannel(serverUrl, msg.data.channel_id, call);

if (callState.recording) {
setRecordingState(serverUrl, msg.data.channel_id, callState.recording);
}

if (callState.live_captions) {
setCaptioningState(serverUrl, msg.data.channel_id, callState.live_captions);
}
};

1 change: 1 addition & 0 deletions app/products/calls/types/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export const DefaultCallsConfig: CallsConfigState = {
EnableTranscriptions: false,
EnableLiveCaptions: false,
HostControlsAllowed: false,
GroupCallsAllowed: true, // Set to true to keep backward compatibility with older servers.
};

export type ApiResp = {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dfffcc0

Please sign in to comment.