@ray-js/ipc-player-integration 0.0.70-beta.0 → 0.0.71-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.js +12 -17
- package/lib/ctx/ctx.test.js +54 -19
- package/lib/ctx/intercom.test.d.ts +1 -0
- package/lib/ctx/intercom.test.js +85 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +3 -1
- 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-manifest.json +9 -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/overlay.d.ts +6 -0
- package/lib/renderer/overlay.js +18 -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 +121 -53
- package/lib/ui/bottomRightContent.js +10 -5
- package/lib/ui/scrollHintArrow.d.ts +23 -0
- package/lib/ui/scrollHintArrow.js +83 -0
- package/lib/ui/topLeftContent.js +4 -2
- package/lib/ui/topRightContent.js +4 -2
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +46 -23
- 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/captureResult/captureResult.js +2 -1
- package/lib/widgets/captureToast/captureToast.d.ts +10 -0
- package/lib/widgets/captureToast/captureToast.js +58 -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/moveInteractiveControl/controlButton.js +2 -1
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +16 -5
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/landscapeTip.js +8 -2
- package/lib/widgets/multiCamera/moveablePtzControl.js +5 -3
- package/lib/widgets/multiCamera/multiPtz.js +2 -1
- package/lib/widgets/multiCamera/ptzMoveableTip.js +8 -2
- package/lib/widgets/multiCamera/switchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileMultiPtz.js +2 -1
- package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileTip.js +8 -2
- 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 +4 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.js +9 -4
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +47 -169
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +4 -2
- package/lib/widgets/recordVideo/recordVideo.test.js +169 -2
- package/lib/widgets/recordVideo/recordVideoTimer.d.ts +3 -0
- package/lib/widgets/recordVideo/recordVideoTimer.js +26 -0
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +48 -122
- package/lib/widgets/screenshot/screenshot.permissions.test.d.ts +1 -0
- package/lib/widgets/screenshot/screenshot.permissions.test.js +137 -0
- package/lib/widgets/screenshot/screenshot.test.js +108 -113
- 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.js +8 -3
- package/lib/widgets/trialBadge/index.less +24 -0
- package/lib/widgets/tryExperience/tryExperience.js +2 -1
- package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
- package/lib/widgets/voiceIntercom/voiceIntercom.js +57 -81
- package/lib/widgets/voiceIntercom/voiceIntercom.less +35 -0
- package/lib/widgets/voiceIntercom/voiceIntercom.test.d.ts +1 -0
- package/lib/widgets/voiceIntercom/voiceIntercom.test.js +135 -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 +5 -3
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +32 -19
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +17 -3
- package/package.json +15 -7
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
5
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { View, Text } from '@ray-js/ray';
|
|
7
|
+
import { SvgRender } from '@ray-js/components';
|
|
8
|
+
import { dialPaint } from './lynxPaint';
|
|
9
|
+
import { dialGeometry, dialProgress, dragDialRawValue, snapDialValue, tapDialValue } from './lynxModel';
|
|
10
|
+
import './lynx.less';
|
|
11
|
+
let sequence = 0;
|
|
12
|
+
const consume = e => {
|
|
13
|
+
var _e$origin, _e$origin$stopPropaga, _e$stopPropagation;
|
|
14
|
+
e === null || e === void 0 || (_e$origin = e.origin) === null || _e$origin === void 0 || (_e$origin$stopPropaga = _e$origin.stopPropagation) === null || _e$origin$stopPropaga === void 0 || _e$origin$stopPropaga.call(_e$origin);
|
|
15
|
+
e === null || e === void 0 || (_e$stopPropagation = e.stopPropagation) === null || _e$stopPropagation === void 0 || _e$stopPropagation.call(e);
|
|
16
|
+
};
|
|
17
|
+
const touch = e => {
|
|
18
|
+
var _e$touches, _e$changedTouches, _e$detail, _p$clientX, _p$clientY;
|
|
19
|
+
const p = (e === null || e === void 0 || (_e$touches = e.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || (e === null || e === void 0 || (_e$changedTouches = e.changedTouches) === null || _e$changedTouches === void 0 ? void 0 : _e$changedTouches[0]) || (e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 || (_e$detail = _e$detail.touches) === null || _e$detail === void 0 ? void 0 : _e$detail[0]);
|
|
20
|
+
if (!p) return null;
|
|
21
|
+
const x = Number((_p$clientX = p.clientX) !== null && _p$clientX !== void 0 ? _p$clientX : p.pageX);
|
|
22
|
+
const y = Number((_p$clientY = p.clientY) !== null && _p$clientY !== void 0 ? _p$clientY : p.pageY);
|
|
23
|
+
return Number.isFinite(x) && Number.isFinite(y) ? {
|
|
24
|
+
x,
|
|
25
|
+
y
|
|
26
|
+
} : null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Native nodes only: no WebView canvas/RJS, and no fallback into the legacy tree. */
|
|
30
|
+
export default function LynxZoomTurntable(props) {
|
|
31
|
+
var _props$styleOptions$m, _props$styleOptions, _props$styleOptions$o, _props$styleOptions2;
|
|
32
|
+
const [id] = useState(() => `ipc-zoom-turntable-lynx-${++sequence}`);
|
|
33
|
+
const options = useRef(props);
|
|
34
|
+
options.current = props;
|
|
35
|
+
const [value, setValue] = useState(() => {
|
|
36
|
+
var _ref, _ref2, _props$value;
|
|
37
|
+
return snapDialValue((_ref = (_ref2 = (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : props.defaultValue) !== null && _ref2 !== void 0 ? _ref2 : props.min) !== null && _ref !== void 0 ? _ref : 1, props);
|
|
38
|
+
});
|
|
39
|
+
// TEMP DEBUG-zoom-perf-1109: bounded gesture sample, removed after comparison.
|
|
40
|
+
const profile = useRef(null);
|
|
41
|
+
const capture = (event, phase) => {
|
|
42
|
+
var _ref3, _ref4, _origin$timeStamp, _pt$clientX, _pt$clientY;
|
|
43
|
+
const r = profile.current;
|
|
44
|
+
if (!r || r.events.length >= 400) return;
|
|
45
|
+
const origin = (event === null || event === void 0 ? void 0 : event.origin) || event;
|
|
46
|
+
const pt = ((origin === null || origin === void 0 ? void 0 : origin.touches) || (origin === null || origin === void 0 ? void 0 : origin.changedTouches) || [])[0];
|
|
47
|
+
r.events.push({
|
|
48
|
+
phase,
|
|
49
|
+
at: Date.now(),
|
|
50
|
+
nativeTime: (_ref3 = (_ref4 = (_origin$timeStamp = origin === null || origin === void 0 ? void 0 : origin.timeStamp) !== null && _origin$timeStamp !== void 0 ? _origin$timeStamp : origin === null || origin === void 0 ? void 0 : origin.timestamp) !== null && _ref4 !== void 0 ? _ref4 : event === null || event === void 0 ? void 0 : event.timeStamp) !== null && _ref3 !== void 0 ? _ref3 : event === null || event === void 0 ? void 0 : event.timestamp,
|
|
51
|
+
x: (_pt$clientX = pt === null || pt === void 0 ? void 0 : pt.clientX) !== null && _pt$clientX !== void 0 ? _pt$clientX : pt === null || pt === void 0 ? void 0 : pt.x,
|
|
52
|
+
y: (_pt$clientY = pt === null || pt === void 0 ? void 0 : pt.clientY) !== null && _pt$clientY !== void 0 ? _pt$clientY : pt === null || pt === void 0 ? void 0 : pt.y
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (profile.current && profile.current.commits.length < 400) profile.current.commits.push({
|
|
57
|
+
at: Date.now(),
|
|
58
|
+
value
|
|
59
|
+
});
|
|
60
|
+
}, [value]);
|
|
61
|
+
const current = useRef(value);
|
|
62
|
+
const visual = useRef(value);
|
|
63
|
+
const frame = useRef(null);
|
|
64
|
+
const notifyTimer = useRef(null);
|
|
65
|
+
const notified = useRef(value);
|
|
66
|
+
const gesture = useRef(null);
|
|
67
|
+
const rect = useRef(null);
|
|
68
|
+
const cooldown = useRef(0);
|
|
69
|
+
const publish = () => {
|
|
70
|
+
frame.current = null;
|
|
71
|
+
setValue(visual.current);
|
|
72
|
+
};
|
|
73
|
+
const notify = () => {
|
|
74
|
+
var _options$current$onCh, _options$current;
|
|
75
|
+
notifyTimer.current = null;
|
|
76
|
+
if (notified.current === current.current) return;
|
|
77
|
+
notified.current = current.current;
|
|
78
|
+
const t = Date.now();
|
|
79
|
+
(_options$current$onCh = (_options$current = options.current).onChange) === null || _options$current$onCh === void 0 || _options$current$onCh.call(_options$current, current.current);
|
|
80
|
+
if (profile.current && profile.current.callbacks.length < 400) profile.current.callbacks.push({
|
|
81
|
+
at: t,
|
|
82
|
+
duration: Date.now() - t
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const update = next => {
|
|
86
|
+
if (next === visual.current) return;
|
|
87
|
+
visual.current = next;
|
|
88
|
+
current.current = snapDialValue(next, options.current);
|
|
89
|
+
if (frame.current == null) frame.current = setTimeout(publish, 16);
|
|
90
|
+
// Match preview's existing 80ms cadence; local paint must not wait for lens/parent work.
|
|
91
|
+
if (notifyTimer.current == null) notifyTimer.current = setTimeout(notify, 80);
|
|
92
|
+
};
|
|
93
|
+
const measure = () => {
|
|
94
|
+
ty.createSelectorQuery().select(`#${id}`).boundingClientRect(r => {
|
|
95
|
+
if ((r === null || r === void 0 ? void 0 : r.width) > 0) rect.current = r;
|
|
96
|
+
}).exec(() => undefined);
|
|
97
|
+
};
|
|
98
|
+
const end = function (e) {
|
|
99
|
+
var _options$current$onCh2, _options$current2, _options$current$onTo, _options$current3, _options$current$onBl, _options$current4;
|
|
100
|
+
let cancelled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
101
|
+
consume(e);
|
|
102
|
+
const active = gesture.current;
|
|
103
|
+
if (!active) return;
|
|
104
|
+
capture(e, 'end');
|
|
105
|
+
gesture.current = null;
|
|
106
|
+
const point = touch(e);
|
|
107
|
+
const isTap = !cancelled && !active.moved && Date.now() - active.at <= 350;
|
|
108
|
+
let blank = false;
|
|
109
|
+
if (isTap && point && rect.current) {
|
|
110
|
+
const next = tapDialValue(point.x - rect.current.left, point.y - rect.current.top, current.current, options.current);
|
|
111
|
+
if (next === null) blank = true;else update(next);
|
|
112
|
+
}
|
|
113
|
+
if (frame.current != null) {
|
|
114
|
+
clearTimeout(frame.current);
|
|
115
|
+
frame.current = null;
|
|
116
|
+
publish();
|
|
117
|
+
}
|
|
118
|
+
if (notifyTimer.current != null) clearTimeout(notifyTimer.current);
|
|
119
|
+
notifyTimer.current = null;
|
|
120
|
+
notify();
|
|
121
|
+
cooldown.current = Date.now() + 300;
|
|
122
|
+
// Match RJS: cancel also settles the last value, releasing useLensZoom dragging state.
|
|
123
|
+
if (!blank) (_options$current$onCh2 = (_options$current2 = options.current).onChangeEnd) === null || _options$current$onCh2 === void 0 || _options$current$onCh2.call(_options$current2, current.current);
|
|
124
|
+
(_options$current$onTo = (_options$current3 = options.current).onTouchEnd) === null || _options$current$onTo === void 0 || _options$current$onTo.call(_options$current3);
|
|
125
|
+
if (blank) (_options$current$onBl = (_options$current4 = options.current).onBlankTap) === null || _options$current$onBl === void 0 || _options$current$onBl.call(_options$current4);
|
|
126
|
+
const sample = profile.current;
|
|
127
|
+
profile.current = null;
|
|
128
|
+
try {
|
|
129
|
+
var _env;
|
|
130
|
+
const root = (_env = ty.env) === null || _env === void 0 ? void 0 : _env.USER_DATA_PATH;
|
|
131
|
+
if (root && sample && sample.events.filter(item => item.phase === 'move').length >= 2) ty.getFileSystemManager().writeFile({
|
|
132
|
+
filePath: `${root}/ipc-zoom-perf-1109.json`,
|
|
133
|
+
encoding: 'utf8',
|
|
134
|
+
data: JSON.stringify(_objectSpread(_objectSpread({}, sample), {}, {
|
|
135
|
+
end: Date.now(),
|
|
136
|
+
version: 'vector-raw-v4-sample2'
|
|
137
|
+
})),
|
|
138
|
+
fail: () => undefined
|
|
139
|
+
});
|
|
140
|
+
} catch (error) {
|
|
141
|
+
/* The sample must never interrupt zoom cleanup. */
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (!gesture.current && Date.now() >= cooldown.current) {
|
|
146
|
+
var _ref5, _ref6, _props$value2;
|
|
147
|
+
current.current = snapDialValue((_ref5 = (_ref6 = (_props$value2 = props.value) !== null && _props$value2 !== void 0 ? _props$value2 : props.defaultValue) !== null && _ref6 !== void 0 ? _ref6 : props.min) !== null && _ref5 !== void 0 ? _ref5 : 1, props);
|
|
148
|
+
visual.current = current.current;
|
|
149
|
+
notified.current = current.current;
|
|
150
|
+
setValue(current.current);
|
|
151
|
+
}
|
|
152
|
+
}, [props.value, props.min, props.max, props.step]);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
measure();
|
|
155
|
+
return () => {
|
|
156
|
+
if (frame.current != null) clearTimeout(frame.current);
|
|
157
|
+
frame.current = null;
|
|
158
|
+
if (notifyTimer.current != null) clearTimeout(notifyTimer.current);
|
|
159
|
+
notifyTimer.current = null;
|
|
160
|
+
if (gesture.current) {
|
|
161
|
+
var _options$current$onTo2, _options$current5;
|
|
162
|
+
gesture.current = null;
|
|
163
|
+
(_options$current$onTo2 = (_options$current5 = options.current).onTouchEnd) === null || _options$current$onTo2 === void 0 || _options$current$onTo2.call(_options$current5);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}, []);
|
|
167
|
+
const g = useMemo(() => dialGeometry(props), [props.scale, props.cropRatio, props.orientation, props.styleOptions]);
|
|
168
|
+
const progress = dialProgress(value, props);
|
|
169
|
+
const geo = g.scale * 5 / 6;
|
|
170
|
+
const right = props.orientation === 'right';
|
|
171
|
+
const color = props.activeColor || '#fff';
|
|
172
|
+
const elements = [];
|
|
173
|
+
const label = (key, text, angle, size, active) => {
|
|
174
|
+
const gap = g.option('labelTopGap', -1 / g.scale);
|
|
175
|
+
const inset = gap >= 0 ? gap + size / 2 + 2 * g.scale : null;
|
|
176
|
+
const rx = right ? g.rx - g.option('innerLabelOffsetX', 22) * 5 / 6 : inset != null ? g.mx - inset : g.rx + 4 * geo;
|
|
177
|
+
const ry = right ? g.ry - g.option('innerLabelOffsetY', 22) * 5 / 6 - (active ? 10 * geo : 0) : inset != null ? g.my - inset : g.ry + 18 * geo;
|
|
178
|
+
const pt = g.at(angle, rx, ry);
|
|
179
|
+
const w = size * Math.max(3, text.length);
|
|
180
|
+
elements.push(/*#__PURE__*/React.createElement(Text, {
|
|
181
|
+
key: key,
|
|
182
|
+
className: "ipc-zoom-turntable-lynx-paint",
|
|
183
|
+
style: {
|
|
184
|
+
left: `${pt.x - w / 2}px`,
|
|
185
|
+
top: `${pt.y - size * 0.7}px`,
|
|
186
|
+
width: `${w}px`,
|
|
187
|
+
height: `${size * 1.4}px`,
|
|
188
|
+
lineHeight: `${size * 1.4}px`,
|
|
189
|
+
textAlign: 'center',
|
|
190
|
+
fontSize: `${size}px`,
|
|
191
|
+
color: active ? color : 'rgba(255,255,255,0.65)',
|
|
192
|
+
fontWeight: '500'
|
|
193
|
+
}
|
|
194
|
+
}, text));
|
|
195
|
+
};
|
|
196
|
+
(props.marks || []).forEach((mark, index) => {
|
|
197
|
+
const offset = dialProgress(mark.value, props) - progress;
|
|
198
|
+
if (Math.abs(offset) > 0.28 || Math.abs(offset) < 0.012) return;
|
|
199
|
+
const angle = Math.PI * 1.5 + offset * Math.PI;
|
|
200
|
+
label(`label-${index}`, mark.label.replace(/x$/i, ''), angle, g.option('markLabelFontSize', 14), false);
|
|
201
|
+
});
|
|
202
|
+
label('current', `${Number(snapDialValue(value, props).toFixed(2))}X`, Math.PI * 1.5, g.option('currentLabelFontSize', (_props$styleOptions$m = (_props$styleOptions = props.styleOptions) === null || _props$styleOptions === void 0 ? void 0 : _props$styleOptions.markLabelFontSize) !== null && _props$styleOptions$m !== void 0 ? _props$styleOptions$m : 14), true);
|
|
203
|
+
const bg = g.point(g.cx, g.cy);
|
|
204
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
205
|
+
id: id,
|
|
206
|
+
className: "ipc-zoom-turntable-lynx",
|
|
207
|
+
style: {
|
|
208
|
+
width: `${g.width}px`,
|
|
209
|
+
height: `${g.height}px`
|
|
210
|
+
},
|
|
211
|
+
'native-interaction-enabled': true,
|
|
212
|
+
'native-interaction-consume-events': true,
|
|
213
|
+
flatten: false,
|
|
214
|
+
onTouchStart: e => {
|
|
215
|
+
var _options$current$onTo3, _options$current6;
|
|
216
|
+
consume(e);
|
|
217
|
+
const pt = touch(e);
|
|
218
|
+
if (!pt) return;
|
|
219
|
+
// The player may have moved with its parent since mounting; never query during move.
|
|
220
|
+
measure();
|
|
221
|
+
profile.current = {
|
|
222
|
+
start: Date.now(),
|
|
223
|
+
events: [],
|
|
224
|
+
commits: [],
|
|
225
|
+
callbacks: []
|
|
226
|
+
};
|
|
227
|
+
capture(e, 'start');
|
|
228
|
+
gesture.current = {
|
|
229
|
+
start: pt,
|
|
230
|
+
last: right ? pt.y : pt.x,
|
|
231
|
+
at: Date.now(),
|
|
232
|
+
moved: false,
|
|
233
|
+
rawValue: current.current
|
|
234
|
+
};
|
|
235
|
+
(_options$current$onTo3 = (_options$current6 = options.current).onTouchStart) === null || _options$current$onTo3 === void 0 || _options$current$onTo3.call(_options$current6);
|
|
236
|
+
},
|
|
237
|
+
onTouchMove: e => {
|
|
238
|
+
consume(e);
|
|
239
|
+
const active = gesture.current;
|
|
240
|
+
capture(e, 'move');
|
|
241
|
+
const pt = touch(e);
|
|
242
|
+
if (!active || !pt) return;
|
|
243
|
+
if (Math.abs(pt.x - active.start.x) > 10 || Math.abs(pt.y - active.start.y) > 10) active.moved = true;
|
|
244
|
+
const axis = right ? pt.y : pt.x;
|
|
245
|
+
// Keep fractional movement across events; quantize only the public value, not the next movement's origin.
|
|
246
|
+
active.rawValue = dragDialRawValue(active.rawValue, axis - active.last, options.current);
|
|
247
|
+
update(active.rawValue);
|
|
248
|
+
active.last = axis;
|
|
249
|
+
},
|
|
250
|
+
onTouchEnd: e => end(e),
|
|
251
|
+
onTouchCancel: e => end(e, true),
|
|
252
|
+
onClick: consume
|
|
253
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
254
|
+
className: "ipc-zoom-turntable-lynx-paint",
|
|
255
|
+
style: {
|
|
256
|
+
left: `${bg.x - (right ? g.my : g.mx)}px`,
|
|
257
|
+
top: `${bg.y - (right ? g.mx : g.my)}px`,
|
|
258
|
+
width: `${(right ? g.my : g.mx) * 2}px`,
|
|
259
|
+
height: `${(right ? g.mx : g.my) * 2}px`,
|
|
260
|
+
borderRadius: '50%',
|
|
261
|
+
backgroundColor: `rgba(0,0,0,${(_props$styleOptions$o = (_props$styleOptions2 = props.styleOptions) === null || _props$styleOptions2 === void 0 ? void 0 : _props$styleOptions2.overlayOpacity) !== null && _props$styleOptions$o !== void 0 ? _props$styleOptions$o : 0.44})`
|
|
262
|
+
}
|
|
263
|
+
}), /*#__PURE__*/React.createElement(SvgRender, {
|
|
264
|
+
className: "ipc-zoom-turntable-lynx-paint",
|
|
265
|
+
style: {
|
|
266
|
+
left: 0,
|
|
267
|
+
top: 0,
|
|
268
|
+
width: `${g.width}px`,
|
|
269
|
+
height: `${g.height}px`
|
|
270
|
+
},
|
|
271
|
+
source: dialPaint(props, value)
|
|
272
|
+
}), elements);
|
|
273
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ZoomTurntableProps } from './type';
|
|
2
|
+
export declare function dialRange(p: ZoomTurntableProps): {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
step: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function snapDialValue(value: number, p: ZoomTurntableProps): number;
|
|
8
|
+
export declare function dialProgress(value: number, p: ZoomTurntableProps): number;
|
|
9
|
+
export declare function dialValue(progress: number, p: ZoomTurntableProps): number;
|
|
10
|
+
/** Same viewport and ellipse geometry as the WebView RJS, in logical px. */
|
|
11
|
+
type DialPoint = {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
type DialGeometry = {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
baseWidth: number;
|
|
19
|
+
baseHeight: number;
|
|
20
|
+
scale: number;
|
|
21
|
+
mx: number;
|
|
22
|
+
my: number;
|
|
23
|
+
cx: number;
|
|
24
|
+
cy: number;
|
|
25
|
+
rx: number;
|
|
26
|
+
ry: number;
|
|
27
|
+
point: (x: number, y: number) => DialPoint;
|
|
28
|
+
inverse: (x: number, y: number) => DialPoint;
|
|
29
|
+
at: (angle: number, radiusX?: number, radiusY?: number) => DialPoint;
|
|
30
|
+
option: (key: keyof NonNullable<ZoomTurntableProps['styleOptions']>, fallback: number) => number;
|
|
31
|
+
};
|
|
32
|
+
export declare function dialGeometry(p: ZoomTurntableProps): DialGeometry;
|
|
33
|
+
/** Left drag increases bottom dial; downward drag increases the right-side dial. */
|
|
34
|
+
export declare function dragDialRawValue(value: number, delta: number, p: ZoomTurntableProps): number;
|
|
35
|
+
export declare function dragDialValue(value: number, delta: number, p: ZoomTurntableProps): number;
|
|
36
|
+
export declare function tapDialValue(x: number, y: number, value: number, p: ZoomTurntableProps): number | null;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
2
|
+
export function dialRange(p) {
|
|
3
|
+
const min = Number.isFinite(p.min) && p.min > 0 ? p.min : 1;
|
|
4
|
+
const max = Number.isFinite(p.max) && p.max > min ? p.max : min;
|
|
5
|
+
const step = Number.isFinite(p.step) && p.step > 0 ? p.step : 0.1;
|
|
6
|
+
return {
|
|
7
|
+
min,
|
|
8
|
+
max,
|
|
9
|
+
step
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function snapDialValue(value, p) {
|
|
13
|
+
const {
|
|
14
|
+
min,
|
|
15
|
+
max,
|
|
16
|
+
step
|
|
17
|
+
} = dialRange(p);
|
|
18
|
+
const v = Number.isFinite(value) ? value : min;
|
|
19
|
+
return clamp(Number((min + Math.round((v - min) / step) * step).toFixed(6)), min, max);
|
|
20
|
+
}
|
|
21
|
+
export function dialProgress(value, p) {
|
|
22
|
+
const {
|
|
23
|
+
min,
|
|
24
|
+
max
|
|
25
|
+
} = dialRange(p);
|
|
26
|
+
if (max === min) return 0;
|
|
27
|
+
const v = clamp(value, min, max);
|
|
28
|
+
if (p.curve === 'log') return Math.log(v / min) / Math.log(max / min);
|
|
29
|
+
const f = typeof p.curve === 'number' && p.curve > 0 ? p.curve : 1;
|
|
30
|
+
return Math.pow((v - min) / (max - min), 1 / f);
|
|
31
|
+
}
|
|
32
|
+
export function dialValue(progress, p) {
|
|
33
|
+
const {
|
|
34
|
+
min,
|
|
35
|
+
max
|
|
36
|
+
} = dialRange(p);
|
|
37
|
+
const t = clamp(progress, 0, 1);
|
|
38
|
+
return snapDialValue(p.curve === 'log' ? min * Math.pow(max / min, t) : min + (max - min) * Math.pow(t, typeof p.curve === 'number' && p.curve > 0 ? p.curve : 1), p);
|
|
39
|
+
}
|
|
40
|
+
/** Same viewport and ellipse geometry as the WebView RJS, in logical px. */
|
|
41
|
+
|
|
42
|
+
export function dialGeometry(p) {
|
|
43
|
+
var _p$cropRatio, _p$styleOptions$hitPa, _p$styleOptions2;
|
|
44
|
+
const scale = Number.isFinite(p.scale) && p.scale > 0 ? p.scale : 1;
|
|
45
|
+
const option = (key, fallback) => {
|
|
46
|
+
var _p$styleOptions;
|
|
47
|
+
const n = (_p$styleOptions = p.styleOptions) === null || _p$styleOptions === void 0 ? void 0 : _p$styleOptions[key];
|
|
48
|
+
return (Number.isFinite(n) ? n : fallback) * scale;
|
|
49
|
+
};
|
|
50
|
+
const crop = clamp((_p$cropRatio = p.cropRatio) !== null && _p$cropRatio !== void 0 ? _p$cropRatio : 0.2, 0, 1);
|
|
51
|
+
const mx = option('ellipseRx', 258);
|
|
52
|
+
const my = option('ellipseRy', 175.5);
|
|
53
|
+
const half = mx * (crop < 0.5 ? Math.sqrt(1 - (2 * crop - 1) ** 2) : 1);
|
|
54
|
+
const padX = option('hitPaddingX', 0);
|
|
55
|
+
const padY = (_p$styleOptions$hitPa = (_p$styleOptions2 = p.styleOptions) === null || _p$styleOptions2 === void 0 ? void 0 : _p$styleOptions2.hitPaddingY) !== null && _p$styleOptions$hitPa !== void 0 ? _p$styleOptions$hitPa : 0;
|
|
56
|
+
const padTop = option('hitPaddingTop', padY);
|
|
57
|
+
const padBottom = option('hitPaddingBottom', padY);
|
|
58
|
+
const width = Math.ceil(half * 2 + padX * 2);
|
|
59
|
+
const height = Math.ceil(my * 2 * crop + padTop + padBottom);
|
|
60
|
+
const cx = half + padX;
|
|
61
|
+
const cy = my + padTop + option('contentOffsetY', 0);
|
|
62
|
+
const inset = option('trackEdgeInset', 30);
|
|
63
|
+
const rx = Math.max(1, option('trackRx', mx / scale - inset / scale));
|
|
64
|
+
const ry = Math.max(1, my - inset);
|
|
65
|
+
const right = p.orientation === 'right';
|
|
66
|
+
const point = (x, y) => right ? {
|
|
67
|
+
x: y,
|
|
68
|
+
y: width - x
|
|
69
|
+
} : {
|
|
70
|
+
x,
|
|
71
|
+
y
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
width: right ? height : width,
|
|
75
|
+
height: right ? width : height,
|
|
76
|
+
baseWidth: width,
|
|
77
|
+
baseHeight: height,
|
|
78
|
+
scale,
|
|
79
|
+
mx,
|
|
80
|
+
my,
|
|
81
|
+
cx,
|
|
82
|
+
cy,
|
|
83
|
+
rx,
|
|
84
|
+
ry,
|
|
85
|
+
point,
|
|
86
|
+
inverse: (x, y) => right ? {
|
|
87
|
+
x: width - y,
|
|
88
|
+
y: x
|
|
89
|
+
} : {
|
|
90
|
+
x,
|
|
91
|
+
y
|
|
92
|
+
},
|
|
93
|
+
at: function (angle) {
|
|
94
|
+
let radiusX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rx;
|
|
95
|
+
let radiusY = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ry;
|
|
96
|
+
return point(cx + radiusX * Math.cos(angle), cy + radiusY * Math.sin(angle));
|
|
97
|
+
},
|
|
98
|
+
option
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** Left drag increases bottom dial; downward drag increases the right-side dial. */
|
|
102
|
+
export function dragDialRawValue(value, delta, p) {
|
|
103
|
+
const {
|
|
104
|
+
min,
|
|
105
|
+
max
|
|
106
|
+
} = dialRange(p);
|
|
107
|
+
const scale = Number.isFinite(p.scale) && p.scale > 0 ? p.scale : 1;
|
|
108
|
+
return clamp(value + delta * (p.orientation === 'right' ? 1 : -1) * (max - min) / (300 * scale), min, max);
|
|
109
|
+
}
|
|
110
|
+
export function dragDialValue(value, delta, p) {
|
|
111
|
+
return snapDialValue(dragDialRawValue(value, delta, p), p);
|
|
112
|
+
}
|
|
113
|
+
export function tapDialValue(x, y, value, p) {
|
|
114
|
+
const g = dialGeometry(p);
|
|
115
|
+
const pt = g.inverse(x, y);
|
|
116
|
+
const nx = (pt.x - g.cx) / g.rx;
|
|
117
|
+
const ny = (pt.y - g.cy) / g.ry;
|
|
118
|
+
const radius = Math.sqrt(nx * nx + ny * ny);
|
|
119
|
+
const theta = (Math.atan2(ny, nx) + Math.PI * 2) % (Math.PI * 2);
|
|
120
|
+
if (radius < 0.55 || radius > 1.4 || theta < Math.PI) return null;
|
|
121
|
+
return dialValue(dialProgress(value, p) + (theta - Math.PI * 1.5) / Math.PI, p);
|
|
122
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
3
|
+
import { dialGeometry, dialProgress } from './lynxModel';
|
|
4
|
+
const number = n => Number(n.toFixed(3));
|
|
5
|
+
const escape = s => s.replace(/[&<>"']/g, c => ({
|
|
6
|
+
'&': '&',
|
|
7
|
+
'<': '<',
|
|
8
|
+
'>': '>',
|
|
9
|
+
'"': '"',
|
|
10
|
+
"'": '''
|
|
11
|
+
})[c]);
|
|
12
|
+
|
|
13
|
+
/** Same ellipse as RJS, one native vector node; labels remain native Text. */
|
|
14
|
+
export function dialPaint(p, value) {
|
|
15
|
+
const g = dialGeometry(p);
|
|
16
|
+
const progress = dialProgress(value, p);
|
|
17
|
+
const right = p.orientation === 'right';
|
|
18
|
+
const geo = g.scale * 5 / 6;
|
|
19
|
+
const rotation = Math.PI * (0.5 - progress);
|
|
20
|
+
const start = Math.max(Math.PI, Math.PI + rotation);
|
|
21
|
+
const end = Math.min(Math.PI * 2, Math.PI * 2 + rotation);
|
|
22
|
+
const from = g.at(start);
|
|
23
|
+
const to = g.at(end);
|
|
24
|
+
const path = `M${number(from.x)} ${number(from.y)} A${number(right ? g.ry : g.rx)} ${number(right ? g.rx : g.ry)} 0 0 1 ${number(to.x)} ${number(to.y)}`;
|
|
25
|
+
let paint = `<path d="${path}" fill="none" stroke="#fff" stroke-opacity="0.42" stroke-width="${number(g.option('trackLineWidth', 2.2) * 5 / 6)}" stroke-dasharray="${number(g.option('dashLength', 8) * 5 / 6)} ${number(g.option('dashGap', 8) * 5 / 6)}" stroke-linecap="round"/>`;
|
|
26
|
+
(p.marks || []).forEach(mark => {
|
|
27
|
+
const offset = dialProgress(mark.value, p) - progress;
|
|
28
|
+
if (Math.abs(offset) > 0.28 || Math.abs(offset) < 0.012) return;
|
|
29
|
+
const pt = g.at(Math.PI * 1.5 + offset * Math.PI);
|
|
30
|
+
paint += `<circle cx="${number(pt.x)}" cy="${number(pt.y)}" r="${number(g.option('markDotRadius', 3) * 5 / 6)}" fill="#fff" fill-opacity="0.62"/>`;
|
|
31
|
+
});
|
|
32
|
+
const pointer = g.at(Math.PI * 1.5);
|
|
33
|
+
const color = escape(p.activeColor || '#fff');
|
|
34
|
+
paint += `<circle cx="${number(pointer.x)}" cy="${number(pointer.y)}" r="${number(g.option('pointerRadius', 6) * 5 / 6)}" fill="none" stroke="${color}" stroke-width="${number(g.option('pointerStrokeWidth', 1.5) * 5 / 6)}"/><circle cx="${number(pointer.x)}" cy="${number(pointer.y)}" r="${number(3 * geo)}" fill="${color}"/>`;
|
|
35
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${g.width}" height="${g.height}" viewBox="0 0 ${g.width} ${g.height}">${paint}</svg>`;
|
|
36
|
+
}
|
|
@@ -2,16 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { ComponentConfigProps } from '../../interface';
|
|
3
3
|
import './zoomTurntableDock.less';
|
|
4
4
|
type Props = ComponentConfigProps & {
|
|
5
|
-
/** 由 ui.tsx 的
|
|
5
|
+
/** 由 ui.tsx 的 absolute 容器分支注入(absolute-item-container) */
|
|
6
6
|
className?: string;
|
|
7
|
+
/** Internal native clipping host preserves legacy canvas coordinates. */
|
|
8
|
+
lynxClipContentStyle?: React.CSSProperties;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* 焦距转盘浮层。
|
|
10
12
|
*
|
|
11
|
-
*
|
|
13
|
+
* 由播放器 absolute 容器承载(WebView 为 CoverView,Lynx 为 View):
|
|
12
14
|
* 播放器是原生组件、层级高于普通 View,放在普通 View 里的 canvas 会被它盖住,
|
|
13
15
|
* touchstart 到不了 canvas,转盘完全滑不动(实测 setupEventListeners 成功但无任何 touch 日志)。
|
|
14
|
-
*
|
|
16
|
+
* 定位与层级由承载容器通过 absolutePosition 提供。
|
|
15
17
|
*/
|
|
16
18
|
export declare const ZoomTurntableDock: (props: Props) => React.JSX.Element | null;
|
|
17
19
|
export {};
|
|
@@ -34,10 +34,10 @@ const getPageId = () => {
|
|
|
34
34
|
/**
|
|
35
35
|
* 焦距转盘浮层。
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* 由播放器 absolute 容器承载(WebView 为 CoverView,Lynx 为 View):
|
|
38
38
|
* 播放器是原生组件、层级高于普通 View,放在普通 View 里的 canvas 会被它盖住,
|
|
39
39
|
* touchstart 到不了 canvas,转盘完全滑不动(实测 setupEventListeners 成功但无任何 touch 日志)。
|
|
40
|
-
*
|
|
40
|
+
* 定位与层级由承载容器通过 absolutePosition 提供。
|
|
41
41
|
*/
|
|
42
42
|
export const ZoomTurntableDock = props => {
|
|
43
43
|
var _initialValueRef$curr;
|
|
@@ -292,7 +292,7 @@ export const ZoomTurntableDock = props => {
|
|
|
292
292
|
requestClose();
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
-
//
|
|
295
|
+
// 定位由播放器承载容器负责(absolutePosition),这里只做布局容器。
|
|
296
296
|
const turntableStyle = useMemo(() => ({
|
|
297
297
|
width: isRight ? 'auto' : '100%',
|
|
298
298
|
height: '100%',
|
|
@@ -327,7 +327,7 @@ export const ZoomTurntableDock = props => {
|
|
|
327
327
|
className: clsx(className, 'ipc-player-plugin-zoom-turntable-dock', {
|
|
328
328
|
'ipc-player-plugin-zoom-turntable-dock-right': isRight
|
|
329
329
|
}),
|
|
330
|
-
style: turntableStyle
|
|
330
|
+
style: _objectSpread(_objectSpread({}, turntableStyle), props.lynxClipContentStyle)
|
|
331
331
|
}, /*#__PURE__*/React.createElement(View, {
|
|
332
332
|
style: canvasHolderStyle
|
|
333
333
|
}, /*#__PURE__*/React.createElement(ZoomTurntable, {
|
|
@@ -2,9 +2,14 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
3
|
import "core-js/modules/esnext.iterator.map.js";
|
|
4
4
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { View,
|
|
5
|
+
import { View, usePageEvent } from '@ray-js/ray';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { useMemoizedFn } from 'ahooks';
|
|
8
|
+
import { usePlayerRenderMode } from '../../renderer/context';
|
|
9
|
+
import { clipZoomDock } from './lynxDockLayout';
|
|
10
|
+
import { dialGeometry } from './turntable/lynxModel';
|
|
11
|
+
import { STYLE_OPTIONS_RIGHT, CROP_RATIO_RIGHT, FORCE_SHOW_ZOOM_TIP, LONG_PRESS_MS, MOVE_TOLERANCE, TIP_RESHOW_DELAY, getZoomDockBottom, getZoomDockHeight, getZoomDockRight, ZOOM_DOCK_Z_INDEX, zoomTurntableClose, zoomTurntableDockId, zoomTurntableOpen, zoomTurntableTipId } from './constants';
|
|
12
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
8
13
|
import { useStore } from '../../ctx/store';
|
|
9
14
|
import { UIEventContext } from '../../ui/context';
|
|
10
15
|
import { PlayState } from '../../interface';
|
|
@@ -15,7 +20,6 @@ import { ZoomTurntableDock } from './zoomTurntableDock';
|
|
|
15
20
|
import { ZoomTurntableTip } from './zoomTurntableTip';
|
|
16
21
|
import { measureBottomBarHeight, measureEntryVisible } from './measureVisible';
|
|
17
22
|
import { ZOOM_ENTRY_ANCHOR_CLS } from './entryAnchor';
|
|
18
|
-
import { FORCE_SHOW_ZOOM_TIP, LONG_PRESS_MS, MOVE_TOLERANCE, TIP_RESHOW_DELAY, getZoomDockBottom, getZoomDockHeight, getZoomDockRight, ZOOM_DOCK_Z_INDEX, zoomTurntableClose, zoomTurntableDockId, zoomTurntableOpen, zoomTurntableTipId } from './constants';
|
|
19
23
|
import './zoomTurntableEntry.less';
|
|
20
24
|
/**
|
|
21
25
|
* 焦距转盘入口:左下角工具条中的图标,长按弹出转盘。
|
|
@@ -24,6 +28,7 @@ import './zoomTurntableEntry.less';
|
|
|
24
28
|
*/
|
|
25
29
|
export const ZoomTurntableEntry = props => {
|
|
26
30
|
var _props$event;
|
|
31
|
+
const renderMode = usePlayerRenderMode();
|
|
27
32
|
const {
|
|
28
33
|
devId,
|
|
29
34
|
className,
|
|
@@ -128,27 +133,35 @@ export const ZoomTurntableEntry = props => {
|
|
|
128
133
|
}
|
|
129
134
|
event.emit(pauseTimeToHideAllComponent);
|
|
130
135
|
if (!hasContent('absolute', zoomTurntableDockId)) {
|
|
131
|
-
//
|
|
136
|
+
// 由播放器 absolute 容器承载(不能设 absoluteNoCoverView):WebView 使用 CoverView,Lynx 使用 View,
|
|
132
137
|
// 普通 View 里的 canvas 会被它盖住,touchstart 到不了 canvas,转盘滑不动。
|
|
138
|
+
const legacyPosition = screenType === 'full' ? {
|
|
139
|
+
top: 0,
|
|
140
|
+
right: getZoomDockRight(),
|
|
141
|
+
bottom: 0,
|
|
142
|
+
zIndex: ZOOM_DOCK_Z_INDEX
|
|
143
|
+
} : {
|
|
144
|
+
left: 0,
|
|
145
|
+
right: 0,
|
|
146
|
+
// 一律是带单位的 px 字符串 —— 裸数字会被当 rpx,见 constants 里 px() 的说明。
|
|
147
|
+
// 竖屏全屏让出底部工具条(实测高度,避免与 ui.tsx 的写死值不同步);
|
|
148
|
+
// 普通竖屏工具条已藏,直接下沉一份底部触摸余量贴住播放器底边。
|
|
149
|
+
bottom: getZoomDockBottom(isVerticalFull, barHeight),
|
|
150
|
+
height: getZoomDockHeight(isVerticalFull),
|
|
151
|
+
zIndex: ZOOM_DOCK_Z_INDEX
|
|
152
|
+
};
|
|
153
|
+
const clipped = renderMode === 'lynx' ? clipZoomDock(legacyPosition, screenType === 'full' ? dialGeometry({
|
|
154
|
+
orientation: 'right',
|
|
155
|
+
cropRatio: CROP_RATIO_RIGHT,
|
|
156
|
+
styleOptions: STYLE_OPTIONS_RIGHT
|
|
157
|
+
}).width : undefined) : null;
|
|
133
158
|
addContent('absolute', {
|
|
134
159
|
id: zoomTurntableDockId,
|
|
135
160
|
content: dockProps => /*#__PURE__*/React.createElement(ZoomTurntableDock, dockProps),
|
|
136
|
-
absolutePosition:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
zIndex: ZOOM_DOCK_Z_INDEX
|
|
141
|
-
} : {
|
|
142
|
-
left: 0,
|
|
143
|
-
right: 0,
|
|
144
|
-
// 一律是带单位的 px 字符串 —— 裸数字会被当 rpx,见 constants 里 px() 的说明。
|
|
145
|
-
// 竖屏全屏让出底部工具条(实测高度,避免与 ui.tsx 的写死值不同步);
|
|
146
|
-
// 普通竖屏工具条已藏,直接下沉一份底部触摸余量贴住播放器底边。
|
|
147
|
-
bottom: getZoomDockBottom(isVerticalFull, barHeight),
|
|
148
|
-
height: getZoomDockHeight(isVerticalFull),
|
|
149
|
-
zIndex: ZOOM_DOCK_Z_INDEX
|
|
150
|
-
},
|
|
151
|
-
initProps: _objectSpread(_objectSpread({}, props), {}, {
|
|
161
|
+
absolutePosition: (clipped === null || clipped === void 0 ? void 0 : clipped.position) || legacyPosition,
|
|
162
|
+
initProps: _objectSpread(_objectSpread({
|
|
163
|
+
lynxClipContentStyle: clipped === null || clipped === void 0 ? void 0 : clipped.content
|
|
164
|
+
}, props), {}, {
|
|
152
165
|
skipLoad: true
|
|
153
166
|
})
|
|
154
167
|
});
|