@ray-js/ipc-player-integration 0.0.65-beta.4 → 0.0.66-beta.0
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/README.md +6 -0
- package/lib/ctx/ctx.composition.js +3 -13
- package/lib/ctx/ctx.js +35 -46
- package/lib/ctx/multiCameraCtx.d.ts +0 -2
- package/lib/ctx/multiCameraCtx.js +1 -17
- package/lib/i18n/index.d.ts +0 -12
- package/lib/i18n/strings.d.ts +0 -6
- package/lib/i18n/strings.js +0 -6
- package/lib/index.d.ts +4 -0
- package/lib/index.js +3 -1
- package/lib/interface.d.ts +3 -17
- package/lib/renderer/capabilities.d.ts +8 -0
- package/lib/renderer/capabilities.js +19 -0
- package/lib/renderer/context.d.ts +5 -0
- package/lib/renderer/context.js +6 -0
- package/lib/renderer/directionControl.d.ts +6 -0
- package/lib/renderer/directionControl.js +3 -0
- package/lib/renderer/font.less +5 -0
- package/lib/renderer/glyphs.d.ts +1 -0
- package/lib/renderer/glyphs.js +256 -0
- package/lib/renderer/index.module.less +48 -0
- package/lib/renderer/ptzZoom.d.ts +6 -0
- package/lib/renderer/ptzZoom.js +3 -0
- package/lib/renderer/text.d.ts +4 -0
- package/lib/renderer/text.js +32 -0
- package/lib/renderer/text.module.less +4 -0
- package/lib/renderer/viewport.d.ts +7 -0
- package/lib/renderer/viewport.js +24 -0
- package/lib/res/lynx-signal/index.d.ts +1 -0
- package/lib/res/lynx-signal/index.js +22 -0
- package/lib/res/lynx-signal/signalFour0.png +0 -0
- package/lib/res/lynx-signal/signalFour1.png +0 -0
- package/lib/res/lynx-signal/signalFour2.png +0 -0
- package/lib/res/lynx-signal/signalFour3.png +0 -0
- package/lib/res/lynx-signal/signalFour4.png +0 -0
- package/lib/res/lynx-signal/signalThree0.png +0 -0
- package/lib/res/lynx-signal/signalThree1.png +0 -0
- package/lib/res/lynx-signal/signalThree2.png +0 -0
- package/lib/res/lynx-signal/signalThree3.png +0 -0
- package/lib/res/player-charging.png +0 -0
- package/lib/res/player-more-arrow.png +0 -0
- package/lib/res/player-solar.png +0 -0
- package/lib/ui/bottomLeftContent.js +119 -55
- package/lib/ui/bottomRightContent.js +6 -3
- package/lib/ui/scrollHintArrow.d.ts +23 -0
- package/lib/ui/scrollHintArrow.js +82 -0
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +89 -98
- package/lib/utils/navigation.d.ts +1 -2
- package/lib/utils/navigation.js +3 -13
- package/lib/widgets/battery/battery.js +7 -5
- package/lib/widgets/battery/batteryFull.js +7 -5
- package/lib/widgets/battery/statusIcon.d.ts +6 -0
- package/lib/widgets/battery/statusIcon.js +36 -0
- package/lib/widgets/battery/statusIcon.less +24 -0
- package/lib/widgets/floodlight/floodlight.js +2 -1
- package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.js +2 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +2 -1
- package/lib/widgets/index.d.ts +0 -1
- package/lib/widgets/index.js +1 -2
- package/lib/widgets/moveInteractiveControl/controlButton.js +2 -1
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +12 -3
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/index.less +0 -1
- package/lib/widgets/multiCamera/landscapeTip.js +2 -1
- package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
- package/lib/widgets/multiCamera/multiPtz.js +3 -2
- package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -1
- package/lib/widgets/multiCamera/switchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileMultiPtz.js +3 -2
- package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileTip.js +2 -1
- package/lib/widgets/muted/muted.js +2 -1
- package/lib/widgets/muted/muted.test.js +66 -52
- package/lib/widgets/ptz/ptz.js +2 -1
- package/lib/widgets/ptz/ptzControl.js +1 -1
- package/lib/widgets/ptzControlTip/ptzControlTip.js +6 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +54 -58
- package/lib/widgets/recordVideo/recordVideo.less +74 -17
- package/lib/widgets/recordVideo/recordVideo.test.js +0 -1
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +45 -67
- package/lib/widgets/screenshot/screenshot.less +40 -1
- package/lib/widgets/signal4G/signal4G.js +4 -1
- package/lib/widgets/siren/siren.js +2 -1
- package/lib/widgets/tempHumidity/tempHumidity.js +2 -1
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +2 -1
- package/lib/widgets/trialBadge/index.d.ts +1 -2
- package/lib/widgets/trialBadge/index.js +17 -20
- package/lib/widgets/trialBadge/index.less +24 -0
- package/lib/widgets/trialBadge/useTrialBadge.d.ts +2 -3
- package/lib/widgets/trialBadge/useTrialBadge.js +2 -13
- package/lib/widgets/tryExperience/tryExperience.js +2 -1
- package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
- package/lib/widgets/voiceIntercom/voiceIntercom.js +50 -24
- package/lib/widgets/voiceIntercom/voiceIntercom.less +16 -0
- package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +6 -0
- package/lib/widgets/zoomTurntable/lynxDockLayout.js +30 -0
- package/lib/widgets/zoomTurntable/turntable/index.d.ts +5 -7
- package/lib/widgets/zoomTurntable/turntable/index.js +3 -1
- package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +5 -0
- package/lib/widgets/zoomTurntable/turntable/lynx.js +273 -0
- package/lib/widgets/zoomTurntable/turntable/lynx.less +9 -0
- package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +37 -0
- package/lib/widgets/zoomTurntable/turntable/lynxModel.js +122 -0
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +3 -0
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +36 -0
- package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +2 -0
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +31 -18
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +23 -3
- package/package.json +15 -7
- package/lib/ctx/ctx.album.test.d.ts +0 -1
- package/lib/ctx/ctx.album.test.js +0 -197
- package/lib/ctx/multiCameraCtx.test.d.ts +0 -1
- package/lib/ctx/multiCameraCtx.test.js +0 -65
- package/lib/ui/absoluteContent.d.ts +0 -2
- package/lib/ui/absoluteContent.js +0 -3
- package/lib/utils/captureResult.d.ts +0 -12
- package/lib/utils/captureResult.js +0 -70
- package/lib/utils/captureResult.test.d.ts +0 -1
- package/lib/utils/captureResult.test.js +0 -223
- package/lib/utils/fullLinkTracking.d.ts +0 -5
- package/lib/utils/fullLinkTracking.js +0 -71
- package/lib/widgets/captureResult/captureResult.d.ts +0 -16
- package/lib/widgets/captureResult/captureResult.js +0 -85
- package/lib/widgets/captureResult/captureResult.less +0 -144
- package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
- package/lib/widgets/captureResult/captureResult.test.js +0 -84
- package/lib/widgets/captureResult/index.d.ts +0 -2
- package/lib/widgets/captureResult/index.js +0 -2
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +0 -1
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +0 -106
- package/lib/widgets/screenshot/screenshot.test.d.ts +0 -1
- package/lib/widgets/screenshot/screenshot.test.js +0 -135
|
@@ -3,12 +3,15 @@ import { View, Image } from '@ray-js/ray';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useSignal4G } from '../../hooks';
|
|
5
5
|
import { signalSvgMap } from '../../res';
|
|
6
|
+
import { signalPngMap } from '../../res/lynx-signal';
|
|
7
|
+
import { usePlayerRenderMode } from '../../renderer/context';
|
|
6
8
|
import './signal4G.less';
|
|
7
9
|
export const Signal4G = props => {
|
|
8
10
|
const {
|
|
9
11
|
className,
|
|
10
12
|
devId
|
|
11
13
|
} = props;
|
|
14
|
+
const isLynx = usePlayerRenderMode() === 'lynx';
|
|
12
15
|
const {
|
|
13
16
|
dpValue,
|
|
14
17
|
signalKey
|
|
@@ -22,7 +25,7 @@ export const Signal4G = props => {
|
|
|
22
25
|
className: clsx('ipc-player-plugin-signal4g')
|
|
23
26
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
24
27
|
className: clsx('ipc-player-plugin-signal4g-icon'),
|
|
25
|
-
src: signalSvgMap[signalKey],
|
|
28
|
+
src: isLynx ? signalPngMap[signalKey] : signalSvgMap[signalKey],
|
|
26
29
|
mode: "aspectFit"
|
|
27
30
|
})));
|
|
28
31
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useDpState } from '../../hooks';
|
|
5
6
|
import { useStore } from '../../ctx/store';
|
|
6
7
|
import { UIEventContext } from '../../ui/context';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
2
|
import "core-js/modules/esnext.iterator.map.js";
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
-
import { View
|
|
4
|
+
import { View } from '@ray-js/ray';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import { useTemperature, useHumidity, useEc, useWaterTemperature, useDpSupport } from '../../hooks';
|
|
7
8
|
import { IPC_EC, IPC_WATER_TEMPERATURE, SENSOR_HUMIDITY, SENSOR_TEMPERATURE } from '../../utils/content/dpCode';
|
|
8
9
|
import './tempHumidity.less';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import './toggleVerticalFull.less';
|
|
6
7
|
export function ToggleVerticalFull(props) {
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import './index.less';
|
|
3
3
|
type Props = {
|
|
4
4
|
className?: string;
|
|
5
|
-
onView?: () => void;
|
|
6
5
|
/** 主题色(用于「开通」按钮背景)。默认与 player brandColor 一致 */
|
|
7
6
|
brandColor?: string;
|
|
8
7
|
/** 试看倒计时初始秒数,来源于 smartImageQualityState.trialRemainingSec */
|
|
@@ -12,5 +11,5 @@ type Props = {
|
|
|
12
11
|
/** 倒计时归零时触发,本组件保证整个生命周期内只回调一次 */
|
|
13
12
|
onCountdownEnd?: () => void;
|
|
14
13
|
};
|
|
15
|
-
export declare const TrialBadge: ({ className,
|
|
14
|
+
export declare const TrialBadge: ({ className, brandColor, trialRemainingSec, onSubscribe, onCountdownEnd, }: Props) => React.JSX.Element;
|
|
16
15
|
export { useTrialBadge } from './useTrialBadge';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Image,
|
|
2
|
+
import { Image, View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { usePlayerRenderMode } from '../../renderer/context';
|
|
5
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
6
|
import Strings from '../../i18n';
|
|
5
7
|
import tryOpen from '../../res/try/try_open.png';
|
|
6
8
|
import './index.less';
|
|
@@ -16,15 +18,12 @@ const formatCountdown = seconds => {
|
|
|
16
18
|
export const TrialBadge = _ref => {
|
|
17
19
|
let {
|
|
18
20
|
className,
|
|
19
|
-
onView,
|
|
20
21
|
brandColor = FALLBACK_BRAND_COLOR,
|
|
21
22
|
trialRemainingSec = 0,
|
|
22
23
|
onSubscribe,
|
|
23
24
|
onCountdownEnd
|
|
24
25
|
} = _ref;
|
|
25
|
-
|
|
26
|
-
onView === null || onView === void 0 || onView();
|
|
27
|
-
}, [onView]);
|
|
26
|
+
const renderMode = usePlayerRenderMode();
|
|
28
27
|
const [remainingSec, setRemainingSec] = useState(Math.max(0, Math.floor(trialRemainingSec)));
|
|
29
28
|
const endedRef = useRef(false);
|
|
30
29
|
const onCountdownEndRef = useRef(onCountdownEnd);
|
|
@@ -64,14 +63,16 @@ export const TrialBadge = _ref => {
|
|
|
64
63
|
}, [trialRemainingSec]);
|
|
65
64
|
const countdownText = formatCountdown(remainingSec);
|
|
66
65
|
return /*#__PURE__*/React.createElement(View, {
|
|
67
|
-
className: clsx('ipc-player-trial-badge', className
|
|
66
|
+
className: clsx('ipc-player-trial-badge', className, {
|
|
67
|
+
'ipc-player-trial-badge--lynx': renderMode === 'lynx'
|
|
68
|
+
})
|
|
68
69
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
69
70
|
className: "ipc-player-trial-badge-icon",
|
|
70
71
|
src: tryOpen,
|
|
71
72
|
mode: "heightFix"
|
|
72
73
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
73
74
|
className: "ipc-player-trial-badge-status"
|
|
74
|
-
}, Strings.getLang('ipc_player_trial_in_use')), /*#__PURE__*/React.createElement(Text, {
|
|
75
|
+
}, Strings.getLang('ipc_player_trial_in_use').replace(/\s*[||]\s*$/, '')), /*#__PURE__*/React.createElement(Text, {
|
|
75
76
|
className: "ipc-player-trial-badge-divider"
|
|
76
77
|
}, "|"), /*#__PURE__*/React.createElement(Text, {
|
|
77
78
|
className: "ipc-player-trial-badge-preview"
|
|
@@ -81,19 +82,15 @@ export const TrialBadge = _ref => {
|
|
|
81
82
|
backgroundColor: brandColor
|
|
82
83
|
},
|
|
83
84
|
onClick: () => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
94
|
-
} catch (error) {
|
|
95
|
-
console.warn('[IPC] trial subscription tracking failed:', error);
|
|
96
|
-
}
|
|
85
|
+
ty.event({
|
|
86
|
+
eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
|
|
87
|
+
event: {
|
|
88
|
+
business_type: 'ipc',
|
|
89
|
+
scene_type: 'smart_image_quality',
|
|
90
|
+
feat_type: 'go_pay',
|
|
91
|
+
biz: 'preview_mini'
|
|
92
|
+
}
|
|
93
|
+
});
|
|
97
94
|
onSubscribe === null || onSubscribe === void 0 || onSubscribe();
|
|
98
95
|
}
|
|
99
96
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -66,3 +66,27 @@
|
|
|
66
66
|
font-weight: 600;
|
|
67
67
|
line-height: 1;
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
// Lynx 不支持 inline-flex 的 WebView 排版语义,显式声明横向 flex。
|
|
71
|
+
.ipc-player-trial-badge--lynx {
|
|
72
|
+
// Match WebView inline-flex: size to content instead of stretching across its parent.
|
|
73
|
+
align-self: flex-start;
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
background-color: rgba(0, 0, 0, 0.65);
|
|
77
|
+
|
|
78
|
+
.ipc-player-trial-badge-icon {
|
|
79
|
+
width: 20px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ipc-player-trial-badge-status,
|
|
83
|
+
.ipc-player-trial-badge-divider,
|
|
84
|
+
.ipc-player-trial-badge-preview {
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ipc-player-trial-badge-cta {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: row;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EventInstance } from '../../interface';
|
|
3
|
-
export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number
|
|
3
|
+
export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number) => {
|
|
4
4
|
showTrialBadge: boolean;
|
|
5
5
|
setShowTrialBadge: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
6
|
-
handleTrialView: () => void;
|
|
7
6
|
handleTrialSubscribe: () => Promise<void>;
|
|
8
7
|
handleCountdownEnd: () => Promise<void>;
|
|
9
8
|
};
|
|
@@ -3,10 +3,7 @@ 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
|
-
|
|
7
|
-
export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef) => {
|
|
8
|
-
const localViewedRef = useRef(false);
|
|
9
|
-
const pageViewedRef = viewedRef || localViewedRef;
|
|
6
|
+
export const useTrialBadge = (event, devId, trialRemainingSec) => {
|
|
10
7
|
const [showTrialBadge, setShowTrialBadge] = useState(false);
|
|
11
8
|
const prevTrialSecRef = useRef(trialRemainingSec);
|
|
12
9
|
useEffect(() => {
|
|
@@ -17,16 +14,9 @@ export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef) => {
|
|
|
17
14
|
}
|
|
18
15
|
prevTrialSecRef.current = trialRemainingSec;
|
|
19
16
|
}, [trialRemainingSec]);
|
|
20
|
-
const handleTrialView = useCallback(() => {
|
|
21
|
-
if (pageViewedRef.current) return;
|
|
22
|
-
pageViewedRef.current = true;
|
|
23
|
-
reportEntryView(devId, createEntryTracking());
|
|
24
|
-
}, [devId, pageViewedRef]);
|
|
25
17
|
const handleTrialSubscribe = useCallback(async () => {
|
|
26
18
|
try {
|
|
27
|
-
|
|
28
|
-
await reportEntryClick(devId, tracking);
|
|
29
|
-
await gotoSecurityCloudService2(devId, tracking);
|
|
19
|
+
await gotoSecurityCloudService2(devId);
|
|
30
20
|
} catch (error) {
|
|
31
21
|
ty.showToast({
|
|
32
22
|
title: Strings.getLang('ipc_player_fetch_error'),
|
|
@@ -61,7 +51,6 @@ export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef) => {
|
|
|
61
51
|
return {
|
|
62
52
|
showTrialBadge,
|
|
63
53
|
setShowTrialBadge,
|
|
64
|
-
handleTrialView,
|
|
65
54
|
handleTrialSubscribe,
|
|
66
55
|
handleCountdownEnd
|
|
67
56
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { View, Image, getSystemInfoSync, showToast
|
|
2
|
+
import { View, Image, getSystemInfoSync, showToast } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
5
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
5
6
|
import { useStore } from '../../ctx/store';
|
|
6
7
|
import Strings from '../../i18n';
|
|
7
8
|
import { getAIFrameFeature, gotoAIDrawMiniProgram, setAIFrameFeature } from '../../utils';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, usePageEvent } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { getVideoBitrateKbps, requestWifiSignal } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import { PlayState } from '../../interface';
|
|
7
8
|
import './videoBitKBP.less';
|
|
8
9
|
import { useStore } from '../../ctx/store';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useRef, useContext, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
-
import { View, Image, getSystemInfoSync } from '@ray-js/ray';
|
|
3
|
+
import { View, Image, Text, getSystemInfoSync } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useStore, getDefaultStore, updateAtom } from '../../ctx/store';
|
|
6
6
|
import './voiceIntercom.less';
|
|
7
|
+
import { usePlayerRenderMode } from '../../renderer/context';
|
|
8
|
+
import { PlayerText } from '../../renderer/text';
|
|
7
9
|
import { PlayerStreamStatus, IntercomMode, PlayState } from '../../interface';
|
|
8
10
|
import { UIEventContext } from '../../ui/context';
|
|
9
11
|
import { radialGradient } from '../../utils';
|
|
@@ -37,6 +39,7 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
37
39
|
const {
|
|
38
40
|
event
|
|
39
41
|
} = useContext(UIEventContext);
|
|
42
|
+
const renderMode = usePlayerRenderMode();
|
|
40
43
|
const {
|
|
41
44
|
recording,
|
|
42
45
|
mute,
|
|
@@ -195,23 +198,45 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
195
198
|
}, intercomClassName),
|
|
196
199
|
onTouchStart: handTouchStart,
|
|
197
200
|
onTouchEnd: onTouchEnd
|
|
198
|
-
}, intercom ? (() =>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
201
|
+
}, intercom ? (() => {
|
|
202
|
+
if (renderMode === 'lynx') {
|
|
203
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
204
|
+
className: clsx('lynx-talking-bars', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName),
|
|
205
|
+
style: {
|
|
206
|
+
transform: `scale(${scale})`,
|
|
207
|
+
transformOrigin: 'center'
|
|
208
|
+
}
|
|
209
|
+
}, [0, 1, 2, 3, 4].map(index => {
|
|
210
|
+
const baseHeight = [5, 10, 16, 10, 5][index];
|
|
211
|
+
const factor = 1 + Math.sin((frame + index) / 5) * 0.2;
|
|
212
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
213
|
+
key: index,
|
|
214
|
+
className: "lynx-talking-bar",
|
|
215
|
+
style: {
|
|
216
|
+
height: `${baseHeight * factor}px`,
|
|
217
|
+
background: talkingColor
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}));
|
|
213
221
|
}
|
|
214
|
-
|
|
222
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
223
|
+
className: clsx({
|
|
224
|
+
'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
|
|
225
|
+
})
|
|
226
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
227
|
+
className: clsx('bars'),
|
|
228
|
+
style: {
|
|
229
|
+
transform: `scale(${scale})`,
|
|
230
|
+
transformOrigin: 'center'
|
|
231
|
+
}
|
|
232
|
+
}, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
|
|
233
|
+
key: index,
|
|
234
|
+
className: clsx('bar'),
|
|
235
|
+
style: {
|
|
236
|
+
background: talkingColor
|
|
237
|
+
}
|
|
238
|
+
}))));
|
|
239
|
+
})() : (() => {
|
|
215
240
|
if (icon) {
|
|
216
241
|
if (typeof icon === 'string') {
|
|
217
242
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -225,13 +250,14 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
225
250
|
className: clsx('icon-image-default-container', iconClassName)
|
|
226
251
|
}, icon);
|
|
227
252
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
253
|
+
const className = clsx('icon-panel',
|
|
254
|
+
// 按 iconfont 的 font_class 使用 yuyin,而不是 name one-way-intercom。
|
|
255
|
+
'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName);
|
|
256
|
+
if (renderMode === 'lynx') return /*#__PURE__*/React.createElement(PlayerText, {
|
|
257
|
+
className: className
|
|
258
|
+
});
|
|
259
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
260
|
+
className: className
|
|
235
261
|
});
|
|
236
262
|
})());
|
|
237
263
|
});
|
|
@@ -32,6 +32,22 @@
|
|
|
32
32
|
align-items: center;
|
|
33
33
|
height: 100%;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
// Lynx 对讲中状态使用内联帧高度,避开 :nth-child 与 CSS animation 在 Lynx 下的兼容差异。
|
|
37
|
+
.lynx-talking-bars {
|
|
38
|
+
padding: 0 1px;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.lynx-talking-bar {
|
|
45
|
+
width: 2px;
|
|
46
|
+
margin: 0 1px;
|
|
47
|
+
border-radius: 5px;
|
|
48
|
+
transition: height 30ms linear;
|
|
49
|
+
}
|
|
50
|
+
|
|
35
51
|
.ipc-player-plugin-voice-intercom-img {
|
|
36
52
|
width: calc(@size * var(--ipc-player-size-scale, 1));
|
|
37
53
|
height: calc(@size * var(--ipc-player-size-scale, 1));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/** Keep legacy draw coordinates, but bound the actual native clipping host to the video. */
|
|
3
|
+
export declare function clipZoomDock(position: CSSProperties, horizontalWidth?: number): {
|
|
4
|
+
position: CSSProperties;
|
|
5
|
+
content: CSSProperties;
|
|
6
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
/** Keep legacy draw coordinates, but bound the actual native clipping host to the video. */
|
|
3
|
+
export function clipZoomDock(position, horizontalWidth) {
|
|
4
|
+
const next = _objectSpread(_objectSpread({}, position), {}, {
|
|
5
|
+
overflow: 'hidden'
|
|
6
|
+
});
|
|
7
|
+
const content = {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
top: 0,
|
|
10
|
+
left: 0
|
|
11
|
+
};
|
|
12
|
+
if (horizontalWidth !== undefined) {
|
|
13
|
+
const right = parseFloat(String(position.right)) || 0;
|
|
14
|
+
next.right = `${Math.max(0, right)}px`;
|
|
15
|
+
next.width = `${Math.max(0, horizontalWidth + Math.min(0, right))}px`;
|
|
16
|
+
content.width = `${horizontalWidth}px`;
|
|
17
|
+
content.height = '100%';
|
|
18
|
+
} else {
|
|
19
|
+
const bottom = parseFloat(String(position.bottom)) || 0;
|
|
20
|
+
const height = parseFloat(String(position.height)) || 0;
|
|
21
|
+
next.bottom = `${Math.max(0, bottom)}px`;
|
|
22
|
+
next.height = `${Math.max(0, height + Math.min(0, bottom))}px`;
|
|
23
|
+
content.height = `${height}px`;
|
|
24
|
+
content.width = '100%';
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
position: next,
|
|
28
|
+
content
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ZoomTurntableProps } from './type';
|
|
3
3
|
import './index.less';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const ZoomTurntable: React.FC<ZoomTurntableProps>;
|
|
10
|
-
export default ZoomTurntable;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
(props: ZoomTurntableProps): React.JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
// @ts-ignore rjs 原生组件,无类型声明
|
|
3
3
|
import Component from './rjs/index.js';
|
|
4
|
+
import LynxZoomTurntable from './lynx';
|
|
4
5
|
import './index.less';
|
|
6
|
+
import { withPlayerRenderer } from '../../../renderer/capabilities';
|
|
5
7
|
let canvasIdCounter = 0;
|
|
6
8
|
|
|
7
9
|
/**
|
|
@@ -81,4 +83,4 @@ const ZoomTurntable = props => {
|
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
};
|
|
84
|
-
export default ZoomTurntable;
|
|
86
|
+
export default withPlayerRenderer('zoomTurntable', ZoomTurntable, LynxZoomTurntable);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ZoomTurntableProps } from './type';
|
|
3
|
+
import './lynx.less';
|
|
4
|
+
/** Native nodes only: no WebView canvas/RJS, and no fallback into the legacy tree. */
|
|
5
|
+
export default function LynxZoomTurntable(props: ZoomTurntableProps): React.JSX.Element;
|