@ray-js/ipc-player-integration 0.0.64 → 0.0.65-beta.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/lib/ctx/ctx.album.test.d.ts +1 -0
- package/lib/ctx/ctx.album.test.js +197 -0
- package/lib/ctx/ctx.composition.js +13 -3
- package/lib/ctx/ctx.js +46 -35
- package/lib/i18n/index.d.ts +12 -0
- package/lib/i18n/strings.d.ts +6 -0
- package/lib/i18n/strings.js +6 -0
- package/lib/interface.d.ts +17 -3
- package/lib/ui/absoluteContent.d.ts +2 -0
- package/lib/ui/absoluteContent.js +3 -0
- package/lib/ui/bottomLeftContent.js +3 -1
- package/lib/ui/ui.js +65 -52
- package/lib/utils/captureResult.d.ts +14 -0
- package/lib/utils/captureResult.js +70 -0
- package/lib/utils/captureResult.test.d.ts +1 -0
- package/lib/utils/captureResult.test.js +117 -0
- package/lib/utils/fullLinkTracking.d.ts +5 -0
- package/lib/utils/fullLinkTracking.js +71 -0
- package/lib/utils/navigation.d.ts +2 -1
- package/lib/utils/navigation.js +13 -3
- package/lib/widgets/captureResult/captureResult.d.ts +16 -0
- package/lib/widgets/captureResult/captureResult.js +85 -0
- package/lib/widgets/captureResult/captureResult.less +144 -0
- package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
- package/lib/widgets/captureResult/captureResult.test.js +80 -0
- package/lib/widgets/captureResult/index.d.ts +2 -0
- package/lib/widgets/captureResult/index.js +2 -0
- package/lib/widgets/index.d.ts +1 -0
- package/lib/widgets/index.js +2 -1
- package/lib/widgets/multiCamera/index.less +1 -0
- package/lib/widgets/multiCamera/moveablePtzControl.js +4 -4
- package/lib/widgets/recordVideo/recordVideo.js +53 -52
- package/lib/widgets/recordVideo/recordVideo.less +17 -74
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
- package/lib/widgets/recordVideo/recordVideo.test.js +1 -0
- package/lib/widgets/screenshot/screenshot.js +66 -44
- package/lib/widgets/screenshot/screenshot.less +1 -40
- package/lib/widgets/screenshot/screenshot.test.d.ts +1 -0
- package/lib/widgets/screenshot/screenshot.test.js +120 -0
- package/lib/widgets/trialBadge/index.d.ts +2 -1
- package/lib/widgets/trialBadge/index.js +17 -9
- package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
- package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
- package/package.json +2 -2
|
@@ -3,7 +3,10 @@ import { setTrailFinish } from '../../utils/ttt';
|
|
|
3
3
|
import { gotoSecurityCloudService2 } from '../../utils';
|
|
4
4
|
import { trialCountdownEnd } from '../../ui/constant';
|
|
5
5
|
import Strings from '../../i18n';
|
|
6
|
-
|
|
6
|
+
import { createEntryTracking, reportEntryClick, reportEntryView } from '../../utils/fullLinkTracking';
|
|
7
|
+
export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef) => {
|
|
8
|
+
const localViewedRef = useRef(false);
|
|
9
|
+
const pageViewedRef = viewedRef || localViewedRef;
|
|
7
10
|
const [showTrialBadge, setShowTrialBadge] = useState(false);
|
|
8
11
|
const prevTrialSecRef = useRef(trialRemainingSec);
|
|
9
12
|
useEffect(() => {
|
|
@@ -14,9 +17,16 @@ export const useTrialBadge = (event, devId, trialRemainingSec) => {
|
|
|
14
17
|
}
|
|
15
18
|
prevTrialSecRef.current = trialRemainingSec;
|
|
16
19
|
}, [trialRemainingSec]);
|
|
20
|
+
const handleTrialView = useCallback(() => {
|
|
21
|
+
if (pageViewedRef.current) return;
|
|
22
|
+
pageViewedRef.current = true;
|
|
23
|
+
reportEntryView(devId, createEntryTracking());
|
|
24
|
+
}, [devId, pageViewedRef]);
|
|
17
25
|
const handleTrialSubscribe = useCallback(async () => {
|
|
18
26
|
try {
|
|
19
|
-
|
|
27
|
+
const tracking = createEntryTracking();
|
|
28
|
+
await reportEntryClick(devId, tracking);
|
|
29
|
+
await gotoSecurityCloudService2(devId, tracking);
|
|
20
30
|
} catch (error) {
|
|
21
31
|
ty.showToast({
|
|
22
32
|
title: Strings.getLang('ipc_player_fetch_error'),
|
|
@@ -51,6 +61,7 @@ export const useTrialBadge = (event, devId, trialRemainingSec) => {
|
|
|
51
61
|
return {
|
|
52
62
|
showTrialBadge,
|
|
53
63
|
setShowTrialBadge,
|
|
64
|
+
handleTrialView,
|
|
54
65
|
handleTrialSubscribe,
|
|
55
66
|
handleCountdownEnd
|
|
56
67
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/ipc-player-integration",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65-beta.1",
|
|
4
4
|
"description": "IPC 融合播放器",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ray-js/direction-control": "^0.0.8",
|
|
39
39
|
"@ray-js/ipc-ptz-zoom": "^0.0.3",
|
|
40
|
+
"@ray-js/ray-ipc-player": "2.1.7-beta.0",
|
|
40
41
|
"@ray-js/panel-sdk": "^1.13.1",
|
|
41
|
-
"@ray-js/ray-ipc-player": "^2.1.7",
|
|
42
42
|
"@ray-js/ray-ipc-utils": "^1.1.16",
|
|
43
43
|
"@ray-js/svg": "0.2.0",
|
|
44
44
|
"clsx": "^1.2.1",
|