Przeglądaj źródła

ref(subtitles): remove logic around dialing transcriber (#4011)

master
virtuacoplenny 6 lat temu
rodzic
commit
866dc4dbc6
No account linked to committer's email address

+ 0
- 30
react/features/transcribing/actionTypes.js Wyświetl plik

1
-/**
2
- * The type of Redux action triggering the transcriber to join (be 'dialed' in)
3
- *
4
- * {
5
- *     type: DIAL_TRANSCRIBER
6
- * }
7
- * @public
8
- */
9
-export const DIAL_TRANSCRIBER = 'DIAL_TRANSCRIBER';
10
-
11
-/**
12
- * The type of Redux action triggering the transcriber to leave.
13
- *
14
- * {
15
- *     type: STOP_TRANSCRBIBING
16
- * }
17
- * @public
18
- */
19
-export const STOP_TRANSCRIBING = 'STOP_TRANSCRBIBING';
20
-
21
 /**
1
 /**
22
  * The type of Redux action triggering storage of participantId of transcriber,
2
  * The type of Redux action triggering storage of participantId of transcriber,
23
  * so that it can later be kicked
3
  * so that it can later be kicked
53
 export const _POTENTIAL_TRANSCRIBER_JOINED
33
 export const _POTENTIAL_TRANSCRIBER_JOINED
54
     = 'POTENTIAL_TRANSCRIBER_JOINED';
34
     = 'POTENTIAL_TRANSCRIBER_JOINED';
55
 
35
 
56
-/**
57
- * The type of a Redux action signalling that dialing the transcriber failed.
58
- *
59
- * {
60
- *     type: _DIAL_ERROR,
61
- * }
62
- * @private
63
- */
64
-export const _DIAL_ERROR = 'DIAL_ERROR';
65
-
66
 /**
36
 /**
67
  * The type of Redux action which sets the pending transcribing notification UID
37
  * The type of Redux action which sets the pending transcribing notification UID
68
  * to use it for when hiding the notification is necessary, or unsets it when
38
  * to use it for when hiding the notification is necessary, or unsets it when

+ 1
- 44
react/features/transcribing/actions.js Wyświetl plik

1
 // @flow
1
 // @flow
2
 
2
 
3
 import {
3
 import {
4
-    _DIAL_ERROR,
5
     _POTENTIAL_TRANSCRIBER_JOINED,
4
     _POTENTIAL_TRANSCRIBER_JOINED,
6
     _TRANSCRIBER_JOINED,
5
     _TRANSCRIBER_JOINED,
7
     _TRANSCRIBER_LEFT,
6
     _TRANSCRIBER_LEFT,
8
-    DIAL_TRANSCRIBER,
9
-    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
10
-    STOP_TRANSCRIBING
7
+    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
11
 } from './actionTypes';
8
 } from './actionTypes';
12
 import {
9
 import {
13
     NOTIFICATION_TIMEOUT,
10
     NOTIFICATION_TIMEOUT,
16
     showNotification
13
     showNotification
17
 } from '../notifications';
14
 } from '../notifications';
18
 
15
 
19
-/**
20
- * Dial the transcriber into the room.
21
- *
22
- * @public
23
- * @returns {{
24
- *     type: DIAL_TRANSCRIBER
25
- * }}
26
- */
27
-export function dialTranscriber() {
28
-    return {
29
-        type: DIAL_TRANSCRIBER
30
-    };
31
-}
32
-
33
-/**
34
- * Stop the transcribing by kicking the transcriber participant.
35
- *
36
- * @returns {{
37
- *     type: STOP_TRANSCRIBING
38
- * }}
39
- */
40
-export function stopTranscribing() {
41
-    return {
42
-        type: STOP_TRANSCRIBING
43
-    };
44
-}
45
-
46
 /**
16
 /**
47
  * Notify that the transcriber, with a unique ID, has joined.
17
  * Notify that the transcriber, with a unique ID, has joined.
48
  *
18
  *
91
     };
61
     };
92
 }
62
 }
93
 
63
 
94
-/**
95
- * Notify that dialing the transcriber resulted in an error.
96
- *
97
- * @returns {{
98
- *      type: _DIAL_ERROR
99
- * }}
100
- */
101
-export function dialError() {
102
-    return {
103
-        type: _DIAL_ERROR
104
-    };
105
-}
106
-
107
 /**
64
 /**
108
  * Signals that the pending transcribing notification should be shown on the
65
  * Signals that the pending transcribing notification should be shown on the
109
  * screen.
66
  * screen.

+ 1
- 33
react/features/transcribing/middleware.js Wyświetl plik

3
 import { MiddlewareRegistry } from '../base/redux';
3
 import { MiddlewareRegistry } from '../base/redux';
4
 
4
 
5
 import {
5
 import {
6
-    _TRANSCRIBER_LEFT,
7
-    DIAL_TRANSCRIBER,
8
-    STOP_TRANSCRIBING
6
+    _TRANSCRIBER_LEFT
9
 } from './actionTypes';
7
 } from './actionTypes';
10
 import {
8
 import {
11
-    dialError,
12
     hidePendingTranscribingNotification,
9
     hidePendingTranscribingNotification,
13
     potentialTranscriberJoined,
10
     potentialTranscriberJoined,
14
-    showPendingTranscribingNotification,
15
     showStoppedTranscribingNotification,
11
     showStoppedTranscribingNotification,
16
-    showTranscribingError,
17
     transcriberJoined,
12
     transcriberJoined,
18
     transcriberLeft
13
     transcriberLeft
19
 } from './actions';
14
 } from './actions';
23
     PARTICIPANT_UPDATED
18
     PARTICIPANT_UPDATED
24
 } from './../base/participants';
19
 } from './../base/participants';
25
 
20
 
26
-declare var APP: Object;
27
-
28
-const TRANSCRIBER_DIAL_COMMAND = 'jitsi_meet_transcribe';
29
 const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
21
 const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
30
 
22
 
31
 /**
23
 /**
37
 // eslint-disable-next-line no-unused-vars
29
 // eslint-disable-next-line no-unused-vars
38
 MiddlewareRegistry.register(store => next => action => {
30
 MiddlewareRegistry.register(store => next => action => {
39
     const {
31
     const {
40
-        isDialing,
41
-        isTranscribing,
42
         transcriberJID,
32
         transcriberJID,
43
         potentialTranscriberJIDs
33
         potentialTranscriberJIDs
44
     } = store.getState()['features/transcribing'];
34
     } = store.getState()['features/transcribing'];
45
 
35
 
46
-    const { conference } = store.getState()['features/base/conference'];
47
-
48
     switch (action.type) {
36
     switch (action.type) {
49
-    case DIAL_TRANSCRIBER:
50
-        if (!(isDialing || isTranscribing)) {
51
-            store.dispatch(showPendingTranscribingNotification());
52
-
53
-            conference.room.dial(TRANSCRIBER_DIAL_COMMAND).catch(
54
-                () => {
55
-                    store.dispatch(dialError());
56
-                    store.dispatch(hidePendingTranscribingNotification());
57
-                    store.dispatch(showTranscribingError());
58
-                }
59
-            );
60
-        }
61
-        break;
62
-    case STOP_TRANSCRIBING:
63
-        if (isTranscribing) {
64
-            const participant = conference.getParticipantById(transcriberJID);
65
-
66
-            conference.room.kick(participant.getJid());
67
-        }
68
-        break;
69
     case _TRANSCRIBER_LEFT:
37
     case _TRANSCRIBER_LEFT:
70
         store.dispatch(showStoppedTranscribingNotification());
38
         store.dispatch(showStoppedTranscribingNotification());
71
         break;
39
         break;

+ 1
- 20
react/features/transcribing/reducer.js Wyświetl plik

1
 import { ReducerRegistry } from '../base/redux';
1
 import { ReducerRegistry } from '../base/redux';
2
 import {
2
 import {
3
-    _DIAL_ERROR,
4
     _TRANSCRIBER_JOINED,
3
     _TRANSCRIBER_JOINED,
5
     _TRANSCRIBER_LEFT,
4
     _TRANSCRIBER_LEFT,
6
     _POTENTIAL_TRANSCRIBER_JOINED,
5
     _POTENTIAL_TRANSCRIBER_JOINED,
7
-    DIAL_TRANSCRIBER,
8
-    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
9
-    STOP_TRANSCRIBING
6
+    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
10
 } from '../transcribing/actionTypes';
7
 } from '../transcribing/actionTypes';
11
 
8
 
12
 /**
9
 /**
66
 ReducerRegistry.register('features/transcribing',
63
 ReducerRegistry.register('features/transcribing',
67
     (state = _getInitialState(), action) => {
64
     (state = _getInitialState(), action) => {
68
         switch (action.type) {
65
         switch (action.type) {
69
-        case DIAL_TRANSCRIBER:
70
-            return {
71
-                ...state,
72
-                isDialing: true
73
-            };
74
-        case STOP_TRANSCRIBING:
75
-            return {
76
-                ...state,
77
-                isTerminating: true
78
-            };
79
-        case _DIAL_ERROR:
80
-            return {
81
-                ...state,
82
-                isDialing: false,
83
-                potentialTranscriberJIDs: []
84
-            };
85
         case _TRANSCRIBER_JOINED:
66
         case _TRANSCRIBER_JOINED:
86
             return {
67
             return {
87
                 ...state,
68
                 ...state,

Ładowanie…
Anuluj
Zapisz