@gamelearn/arcade-components 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -395,7 +395,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
395
395
|
audio: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audio,
|
|
396
396
|
soundActions: soundActions,
|
|
397
397
|
emitEvent: emitEvent,
|
|
398
|
-
|
|
398
|
+
pauseTTS: pause,
|
|
399
399
|
onStart: function onStart() {
|
|
400
400
|
var _currentMessage$emoti;
|
|
401
401
|
|
|
@@ -640,7 +640,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
640
640
|
audio: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audio,
|
|
641
641
|
soundActions: soundActions,
|
|
642
642
|
emitEvent: emitEvent,
|
|
643
|
-
|
|
643
|
+
pauseTTS: pause,
|
|
644
644
|
onStart: function onStart() {
|
|
645
645
|
var _talkingCharacter$emo;
|
|
646
646
|
|
package/dist/helpers/useEkho.js
CHANGED
|
@@ -45,11 +45,14 @@ var useEkho = function useEkho(_ref) {
|
|
|
45
45
|
_ref$onError = _ref.onError,
|
|
46
46
|
onError = _ref$onError === void 0 ? noop : _ref$onError,
|
|
47
47
|
_ref$onStart = _ref.onStart,
|
|
48
|
-
onStart = _ref$onStart === void 0 ? noop : _ref$onStart
|
|
48
|
+
onStart = _ref$onStart === void 0 ? noop : _ref$onStart,
|
|
49
|
+
pauseTTS = _ref.pauseTTS;
|
|
49
50
|
|
|
50
|
-
var _soundActions = _slicedToArray(soundActions,
|
|
51
|
+
var _soundActions = _slicedToArray(soundActions, 4),
|
|
51
52
|
playSound = _soundActions[0],
|
|
52
|
-
stop = _soundActions[1]
|
|
53
|
+
stop = _soundActions[1],
|
|
54
|
+
pause = _soundActions[2],
|
|
55
|
+
resume = _soundActions[3];
|
|
53
56
|
|
|
54
57
|
var noAudio = !audio && !voice;
|
|
55
58
|
|
|
@@ -159,6 +162,13 @@ var useEkho = function useEkho(_ref) {
|
|
|
159
162
|
stopCurrentAudio();
|
|
160
163
|
};
|
|
161
164
|
}, [stopCurrentAudio]);
|
|
165
|
+
(0, _react.useEffect)(function () {
|
|
166
|
+
if (pauseTTS) {
|
|
167
|
+
pause();
|
|
168
|
+
} else {
|
|
169
|
+
resume();
|
|
170
|
+
}
|
|
171
|
+
}, [pause, pauseTTS, resume]);
|
|
162
172
|
(0, _react.useEffect)(function () {
|
|
163
173
|
if (noAudio) {
|
|
164
174
|
stopCurrentAudio();
|