@applicaster/zapp-react-native-utils 12.0.0-alpha.4220424021 → 12.0.0-alpha.4241289980
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.
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { BehaviorSubject } from "rxjs";
|
|
2
2
|
|
|
3
3
|
import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
|
|
4
|
+
import {
|
|
5
|
+
isLgPlatform,
|
|
6
|
+
isSamsungPlatform,
|
|
7
|
+
} from "@applicaster/zapp-react-dom-app/App/Loader/utils/platform";
|
|
4
8
|
|
|
5
9
|
import { PLATFORM_KEYS, PLATFORMS } from "./const";
|
|
6
10
|
import { createLogger, utilsLogger } from "../../logger";
|
|
@@ -178,6 +182,34 @@ export class TTSManager {
|
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
readText(text: string) {
|
|
185
|
+
if (isSamsungPlatform() && window.speechSynthesis) {
|
|
186
|
+
const utterance = new SpeechSynthesisUtterance(text);
|
|
187
|
+
window.speechSynthesis.speak(utterance);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (isLgPlatform() && window.webOS?.service) {
|
|
191
|
+
try {
|
|
192
|
+
window.webOS.service.request("luna://com.webos.service.tts", {
|
|
193
|
+
method: "speak",
|
|
194
|
+
onFailure(error: any) {
|
|
195
|
+
log_debug("There was a failure setting up webOS TTS service", {
|
|
196
|
+
error,
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
onSuccess(response: any) {
|
|
200
|
+
log_debug("webOS TTS service is configured successfully", {
|
|
201
|
+
response,
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
parameters: {
|
|
205
|
+
text,
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
} catch (error) {
|
|
209
|
+
log_debug("webOS TTS service error", { error });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
181
213
|
if (!window.VIZIO?.Chromevox) return;
|
|
182
214
|
|
|
183
215
|
window.VIZIO.Chromevox.play(text);
|
|
@@ -46,7 +46,7 @@ export const playerFactory = (
|
|
|
46
46
|
|
|
47
47
|
// TODO: Fix type:
|
|
48
48
|
const playerProtocol: PlayerConstructor =
|
|
49
|
-
playerPlugin?.module?.playerProtocol(config?.screenConfig);
|
|
49
|
+
playerPlugin?.module?.playerProtocol(config?.screenConfig, config?.entry);
|
|
50
50
|
|
|
51
51
|
const playerView = (playerProtocol as any)?.Component || null;
|
|
52
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.4241289980",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.4241289980",
|
|
32
32
|
"buffer": "^5.2.1",
|
|
33
33
|
"camelize": "^1.0.0",
|
|
34
34
|
"create-react-context": "^0.2.3",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import * as R from "ramda";
|
|
3
2
|
import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
4
3
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
5
4
|
import {
|
|
@@ -17,10 +16,6 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
|
|
|
17
16
|
const intervalTimer = React.useRef(null);
|
|
18
17
|
const prevRunning = usePrevious(isRunning);
|
|
19
18
|
|
|
20
|
-
const setIntervalTimer = (cb) => {
|
|
21
|
-
intervalTimer.current = setInterval(cb, ON_HOLD_INTERVAL);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
19
|
const clearIntervalTimer = () => {
|
|
25
20
|
try {
|
|
26
21
|
clearInterval(intervalTimer.current);
|
|
@@ -29,6 +24,11 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
|
|
|
29
24
|
}
|
|
30
25
|
};
|
|
31
26
|
|
|
27
|
+
const setIntervalTimer = (cb) => {
|
|
28
|
+
clearIntervalTimer();
|
|
29
|
+
intervalTimer.current = setInterval(cb, ON_HOLD_INTERVAL);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
32
|
const resetState = () => {
|
|
33
33
|
setIsRunning(false);
|
|
34
34
|
setDirection(null);
|
|
@@ -42,7 +42,7 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
|
|
|
42
42
|
if (!player) return;
|
|
43
43
|
|
|
44
44
|
if (direction) {
|
|
45
|
-
player[direction](
|
|
45
|
+
player[direction](Math.min(MAX_SEEK_TIME, SKIP_TIME_BASE * multiplier));
|
|
46
46
|
resetHUDTimer();
|
|
47
47
|
}
|
|
48
48
|
}, [multiplier, direction]);
|
|
@@ -50,7 +50,9 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
|
|
|
50
50
|
useEffect(() => {
|
|
51
51
|
if (isRunning && isRunning !== prevRunning) {
|
|
52
52
|
setIntervalTimer(() => {
|
|
53
|
-
setMultiplier(
|
|
53
|
+
setMultiplier((prev) => {
|
|
54
|
+
return prev + 1;
|
|
55
|
+
});
|
|
54
56
|
});
|
|
55
57
|
} else if (!isRunning && isRunning !== prevRunning) {
|
|
56
58
|
resetState();
|