ref(subtitles): remove logic around dialing transcriber (#4011)
This commit is contained in:
parent
69a12395d2
commit
866dc4dbc6
@ -1,23 +1,3 @@
|
|||||||
/**
|
|
||||||
* The type of Redux action triggering the transcriber to join (be 'dialed' in)
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* type: DIAL_TRANSCRIBER
|
|
||||||
* }
|
|
||||||
* @public
|
|
||||||
*/
|
|
||||||
export const DIAL_TRANSCRIBER = 'DIAL_TRANSCRIBER';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of Redux action triggering the transcriber to leave.
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* type: STOP_TRANSCRBIBING
|
|
||||||
* }
|
|
||||||
* @public
|
|
||||||
*/
|
|
||||||
export const STOP_TRANSCRIBING = 'STOP_TRANSCRBIBING';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of Redux action triggering storage of participantId of transcriber,
|
* The type of Redux action triggering storage of participantId of transcriber,
|
||||||
* so that it can later be kicked
|
* so that it can later be kicked
|
||||||
@ -53,16 +33,6 @@ export const _TRANSCRIBER_LEFT = 'TRANSCRIBER_LEFT';
|
|||||||
export const _POTENTIAL_TRANSCRIBER_JOINED
|
export const _POTENTIAL_TRANSCRIBER_JOINED
|
||||||
= 'POTENTIAL_TRANSCRIBER_JOINED';
|
= 'POTENTIAL_TRANSCRIBER_JOINED';
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of a Redux action signalling that dialing the transcriber failed.
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* type: _DIAL_ERROR,
|
|
||||||
* }
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
export const _DIAL_ERROR = 'DIAL_ERROR';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of Redux action which sets the pending transcribing notification UID
|
* The type of Redux action which sets the pending transcribing notification UID
|
||||||
* to use it for when hiding the notification is necessary, or unsets it when
|
* to use it for when hiding the notification is necessary, or unsets it when
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import {
|
import {
|
||||||
_DIAL_ERROR,
|
|
||||||
_POTENTIAL_TRANSCRIBER_JOINED,
|
_POTENTIAL_TRANSCRIBER_JOINED,
|
||||||
_TRANSCRIBER_JOINED,
|
_TRANSCRIBER_JOINED,
|
||||||
_TRANSCRIBER_LEFT,
|
_TRANSCRIBER_LEFT,
|
||||||
DIAL_TRANSCRIBER,
|
SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
|
||||||
SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
|
|
||||||
STOP_TRANSCRIBING
|
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
import {
|
import {
|
||||||
NOTIFICATION_TIMEOUT,
|
NOTIFICATION_TIMEOUT,
|
||||||
@ -16,33 +13,6 @@ import {
|
|||||||
showNotification
|
showNotification
|
||||||
} from '../notifications';
|
} from '../notifications';
|
||||||
|
|
||||||
/**
|
|
||||||
* Dial the transcriber into the room.
|
|
||||||
*
|
|
||||||
* @public
|
|
||||||
* @returns {{
|
|
||||||
* type: DIAL_TRANSCRIBER
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
export function dialTranscriber() {
|
|
||||||
return {
|
|
||||||
type: DIAL_TRANSCRIBER
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stop the transcribing by kicking the transcriber participant.
|
|
||||||
*
|
|
||||||
* @returns {{
|
|
||||||
* type: STOP_TRANSCRIBING
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
export function stopTranscribing() {
|
|
||||||
return {
|
|
||||||
type: STOP_TRANSCRIBING
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify that the transcriber, with a unique ID, has joined.
|
* Notify that the transcriber, with a unique ID, has joined.
|
||||||
*
|
*
|
||||||
@ -91,19 +61,6 @@ export function potentialTranscriberJoined(participantId: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Notify that dialing the transcriber resulted in an error.
|
|
||||||
*
|
|
||||||
* @returns {{
|
|
||||||
* type: _DIAL_ERROR
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
export function dialError() {
|
|
||||||
return {
|
|
||||||
type: _DIAL_ERROR
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signals that the pending transcribing notification should be shown on the
|
* Signals that the pending transcribing notification should be shown on the
|
||||||
* screen.
|
* screen.
|
||||||
|
|||||||
@ -3,17 +3,12 @@
|
|||||||
import { MiddlewareRegistry } from '../base/redux';
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
_TRANSCRIBER_LEFT,
|
_TRANSCRIBER_LEFT
|
||||||
DIAL_TRANSCRIBER,
|
|
||||||
STOP_TRANSCRIBING
|
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
import {
|
import {
|
||||||
dialError,
|
|
||||||
hidePendingTranscribingNotification,
|
hidePendingTranscribingNotification,
|
||||||
potentialTranscriberJoined,
|
potentialTranscriberJoined,
|
||||||
showPendingTranscribingNotification,
|
|
||||||
showStoppedTranscribingNotification,
|
showStoppedTranscribingNotification,
|
||||||
showTranscribingError,
|
|
||||||
transcriberJoined,
|
transcriberJoined,
|
||||||
transcriberLeft
|
transcriberLeft
|
||||||
} from './actions';
|
} from './actions';
|
||||||
@ -23,9 +18,6 @@ import {
|
|||||||
PARTICIPANT_UPDATED
|
PARTICIPANT_UPDATED
|
||||||
} from './../base/participants';
|
} from './../base/participants';
|
||||||
|
|
||||||
declare var APP: Object;
|
|
||||||
|
|
||||||
const TRANSCRIBER_DIAL_COMMAND = 'jitsi_meet_transcribe';
|
|
||||||
const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
|
const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,35 +29,11 @@ const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
MiddlewareRegistry.register(store => next => action => {
|
MiddlewareRegistry.register(store => next => action => {
|
||||||
const {
|
const {
|
||||||
isDialing,
|
|
||||||
isTranscribing,
|
|
||||||
transcriberJID,
|
transcriberJID,
|
||||||
potentialTranscriberJIDs
|
potentialTranscriberJIDs
|
||||||
} = store.getState()['features/transcribing'];
|
} = store.getState()['features/transcribing'];
|
||||||
|
|
||||||
const { conference } = store.getState()['features/base/conference'];
|
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case DIAL_TRANSCRIBER:
|
|
||||||
if (!(isDialing || isTranscribing)) {
|
|
||||||
store.dispatch(showPendingTranscribingNotification());
|
|
||||||
|
|
||||||
conference.room.dial(TRANSCRIBER_DIAL_COMMAND).catch(
|
|
||||||
() => {
|
|
||||||
store.dispatch(dialError());
|
|
||||||
store.dispatch(hidePendingTranscribingNotification());
|
|
||||||
store.dispatch(showTranscribingError());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case STOP_TRANSCRIBING:
|
|
||||||
if (isTranscribing) {
|
|
||||||
const participant = conference.getParticipantById(transcriberJID);
|
|
||||||
|
|
||||||
conference.room.kick(participant.getJid());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _TRANSCRIBER_LEFT:
|
case _TRANSCRIBER_LEFT:
|
||||||
store.dispatch(showStoppedTranscribingNotification());
|
store.dispatch(showStoppedTranscribingNotification());
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -1,12 +1,9 @@
|
|||||||
import { ReducerRegistry } from '../base/redux';
|
import { ReducerRegistry } from '../base/redux';
|
||||||
import {
|
import {
|
||||||
_DIAL_ERROR,
|
|
||||||
_TRANSCRIBER_JOINED,
|
_TRANSCRIBER_JOINED,
|
||||||
_TRANSCRIBER_LEFT,
|
_TRANSCRIBER_LEFT,
|
||||||
_POTENTIAL_TRANSCRIBER_JOINED,
|
_POTENTIAL_TRANSCRIBER_JOINED,
|
||||||
DIAL_TRANSCRIBER,
|
SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
|
||||||
SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
|
|
||||||
STOP_TRANSCRIBING
|
|
||||||
} from '../transcribing/actionTypes';
|
} from '../transcribing/actionTypes';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,22 +63,6 @@ function _getInitialState() {
|
|||||||
ReducerRegistry.register('features/transcribing',
|
ReducerRegistry.register('features/transcribing',
|
||||||
(state = _getInitialState(), action) => {
|
(state = _getInitialState(), action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case DIAL_TRANSCRIBER:
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
isDialing: true
|
|
||||||
};
|
|
||||||
case STOP_TRANSCRIBING:
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
isTerminating: true
|
|
||||||
};
|
|
||||||
case _DIAL_ERROR:
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
isDialing: false,
|
|
||||||
potentialTranscriberJIDs: []
|
|
||||||
};
|
|
||||||
case _TRANSCRIBER_JOINED:
|
case _TRANSCRIBER_JOINED:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user