Skip to content

Commit

Permalink
fix(transcript) fix transcription init (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
horymury authored Mar 4, 2025
1 parent 5b177f2 commit 2f1d163
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function buildOptions(tenant, room, release) {
},
serviceUrl: `wss://${subdomain}8x8.vc/${tenant}/xmpp-websocket?room=${room}${releaseVersion}`,
websocketKeepAliveUrl: `https://${subdomain}8x8.vc/${tenant}/_unlock?room=${room}`,

hiddenDomain: `recorder.${subdomain}8x8.vc`,
// Video quality / constraints
constraints: {
video: {
Expand Down Expand Up @@ -165,9 +165,6 @@ const onRemoteTrack = track => {

const onConferenceJoined = () => {
console.log('conference joined!');
const selectedTranscript = document.getElementById('transcriptInput').value;
room.setLocalParticipantProperty('requestingTranscription', true);
room.setLocalParticipantProperty('transcription_language', selectedTranscript);
};

const onConferenceLeft = () => {
Expand Down Expand Up @@ -197,6 +194,27 @@ const onConnectionSuccess = () => {
}

// Setup event listeners
room.on(
JitsiMeetJS.events.conference.TRANSCRIPTION_STATUS_CHANGED,
status => {
console.log(`transcript ${status}`);
});

room.on(
JitsiMeetJS.events.conference.USER_ROLE_CHANGED,
(id, role) => {
if (id === room.myUserId()
&& role === 'moderator'
&& room.getTranscriptionStatus() !== 'ON'
) {
console.log('enable transcript');
const selectedTranscript = document.getElementById('transcriptInput').value;
room.dial('jitsi_meet_transcribe');
room.setLocalParticipantProperty('requestingTranscription', true);
room.setLocalParticipantProperty('transcription_language', selectedTranscript);
}
});

room.on(
JitsiMeetJS.events.conference.TRACK_ADDED,
track => {
Expand Down

0 comments on commit 2f1d163

Please sign in to comment.