@ray-js/ipc-player-integration 0.0.66-beta.0 → 0.0.67-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.
Files changed (141) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.album.test.d.ts +1 -0
  3. package/lib/ctx/ctx.album.test.js +197 -0
  4. package/lib/ctx/ctx.composition.js +13 -3
  5. package/lib/ctx/ctx.js +46 -35
  6. package/lib/ctx/multiCameraCtx.d.ts +2 -0
  7. package/lib/ctx/multiCameraCtx.js +17 -1
  8. package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
  9. package/lib/ctx/multiCameraCtx.test.js +65 -0
  10. package/lib/i18n/index.d.ts +12 -0
  11. package/lib/i18n/strings.d.ts +6 -0
  12. package/lib/i18n/strings.js +6 -0
  13. package/lib/index.d.ts +0 -4
  14. package/lib/index.js +1 -3
  15. package/lib/interface.d.ts +17 -3
  16. package/lib/ui/absoluteContent.d.ts +2 -0
  17. package/lib/ui/absoluteContent.js +3 -0
  18. package/lib/ui/bottomLeftContent.js +55 -119
  19. package/lib/ui/bottomRightContent.js +3 -6
  20. package/lib/ui/ui.d.ts +0 -5
  21. package/lib/ui/ui.js +98 -89
  22. package/lib/utils/captureResult.d.ts +12 -0
  23. package/lib/utils/captureResult.js +70 -0
  24. package/lib/utils/captureResult.test.d.ts +1 -0
  25. package/lib/utils/captureResult.test.js +223 -0
  26. package/lib/utils/fullLinkTracking.d.ts +5 -0
  27. package/lib/utils/fullLinkTracking.js +71 -0
  28. package/lib/utils/navigation.d.ts +2 -1
  29. package/lib/utils/navigation.js +13 -3
  30. package/lib/widgets/battery/battery.js +5 -7
  31. package/lib/widgets/battery/batteryFull.js +5 -7
  32. package/lib/widgets/captureResult/captureResult.d.ts +16 -0
  33. package/lib/widgets/captureResult/captureResult.js +85 -0
  34. package/lib/widgets/captureResult/captureResult.less +144 -0
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
  36. package/lib/widgets/captureResult/captureResult.test.js +84 -0
  37. package/lib/widgets/captureResult/index.d.ts +2 -0
  38. package/lib/widgets/captureResult/index.js +2 -0
  39. package/lib/widgets/floodlight/floodlight.js +1 -2
  40. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  41. package/lib/widgets/fullScreen/fullScreen.js +4 -18
  42. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  43. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  44. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  45. package/lib/widgets/index.d.ts +1 -0
  46. package/lib/widgets/index.js +2 -1
  47. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  48. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
  49. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  50. package/lib/widgets/multiCamera/index.less +1 -0
  51. package/lib/widgets/multiCamera/landscapeTip.js +1 -2
  52. package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
  53. package/lib/widgets/multiCamera/multiPtz.js +2 -3
  54. package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
  55. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  56. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
  57. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  58. package/lib/widgets/multiCamera/tileTip.js +1 -2
  59. package/lib/widgets/muted/muted.js +1 -2
  60. package/lib/widgets/muted/muted.test.js +52 -66
  61. package/lib/widgets/ptz/ptz.js +1 -2
  62. package/lib/widgets/ptz/ptzControl.js +1 -1
  63. package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
  64. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  65. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  66. package/lib/widgets/recordVideo/recordVideo.js +58 -54
  67. package/lib/widgets/recordVideo/recordVideo.less +17 -74
  68. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
  69. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
  70. package/lib/widgets/recordVideo/recordVideo.test.js +1 -0
  71. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  72. package/lib/widgets/resolution/resolution.js +2 -3
  73. package/lib/widgets/screenshot/screenshot.js +67 -45
  74. package/lib/widgets/screenshot/screenshot.less +1 -40
  75. package/lib/widgets/screenshot/screenshot.test.d.ts +1 -0
  76. package/lib/widgets/screenshot/screenshot.test.js +135 -0
  77. package/lib/widgets/signal4G/signal4G.js +1 -4
  78. package/lib/widgets/siren/siren.js +1 -2
  79. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  80. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  81. package/lib/widgets/trialBadge/index.d.ts +2 -1
  82. package/lib/widgets/trialBadge/index.js +20 -17
  83. package/lib/widgets/trialBadge/index.less +0 -24
  84. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  85. package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
  86. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  87. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  88. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  89. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  90. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  91. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  92. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +0 -2
  93. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
  94. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +18 -31
  95. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -23
  96. package/package.json +7 -15
  97. package/lib/renderer/capabilities.d.ts +0 -8
  98. package/lib/renderer/capabilities.js +0 -19
  99. package/lib/renderer/context.d.ts +0 -5
  100. package/lib/renderer/context.js +0 -6
  101. package/lib/renderer/directionControl.d.ts +0 -6
  102. package/lib/renderer/directionControl.js +0 -3
  103. package/lib/renderer/font.less +0 -5
  104. package/lib/renderer/glyphs.d.ts +0 -1
  105. package/lib/renderer/glyphs.js +0 -256
  106. package/lib/renderer/index.module.less +0 -48
  107. package/lib/renderer/ptzZoom.d.ts +0 -6
  108. package/lib/renderer/ptzZoom.js +0 -3
  109. package/lib/renderer/text.d.ts +0 -4
  110. package/lib/renderer/text.js +0 -32
  111. package/lib/renderer/text.module.less +0 -4
  112. package/lib/renderer/viewport.d.ts +0 -7
  113. package/lib/renderer/viewport.js +0 -24
  114. package/lib/res/lynx-signal/index.d.ts +0 -1
  115. package/lib/res/lynx-signal/index.js +0 -22
  116. package/lib/res/lynx-signal/signalFour0.png +0 -0
  117. package/lib/res/lynx-signal/signalFour1.png +0 -0
  118. package/lib/res/lynx-signal/signalFour2.png +0 -0
  119. package/lib/res/lynx-signal/signalFour3.png +0 -0
  120. package/lib/res/lynx-signal/signalFour4.png +0 -0
  121. package/lib/res/lynx-signal/signalThree0.png +0 -0
  122. package/lib/res/lynx-signal/signalThree1.png +0 -0
  123. package/lib/res/lynx-signal/signalThree2.png +0 -0
  124. package/lib/res/lynx-signal/signalThree3.png +0 -0
  125. package/lib/res/player-charging.png +0 -0
  126. package/lib/res/player-more-arrow.png +0 -0
  127. package/lib/res/player-solar.png +0 -0
  128. package/lib/ui/scrollHintArrow.d.ts +0 -23
  129. package/lib/ui/scrollHintArrow.js +0 -82
  130. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  131. package/lib/widgets/battery/statusIcon.js +0 -36
  132. package/lib/widgets/battery/statusIcon.less +0 -24
  133. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  134. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  135. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  136. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  137. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  138. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  139. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  140. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  141. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
@@ -1,11 +1,9 @@
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, Text, getSystemInfoSync } from '@ray-js/ray';
3
+ import { View, Image, 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';
9
7
  import { PlayerStreamStatus, IntercomMode, PlayState } from '../../interface';
10
8
  import { UIEventContext } from '../../ui/context';
11
9
  import { radialGradient } from '../../utils';
@@ -39,7 +37,6 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
39
37
  const {
40
38
  event
41
39
  } = useContext(UIEventContext);
42
- const renderMode = usePlayerRenderMode();
43
40
  const {
44
41
  recording,
45
42
  mute,
@@ -198,45 +195,23 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
198
195
  }, intercomClassName),
199
196
  onTouchStart: handTouchStart,
200
197
  onTouchEnd: onTouchEnd
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
- }));
198
+ }, intercom ? (() => /*#__PURE__*/React.createElement(View, {
199
+ className: clsx({
200
+ 'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
201
+ })
202
+ }, /*#__PURE__*/React.createElement(View, {
203
+ className: clsx('bars'),
204
+ style: {
205
+ transform: `scale(${scale})`,
206
+ transformOrigin: 'center'
221
207
  }
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
- })() : (() => {
208
+ }, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
209
+ key: index,
210
+ className: clsx('bar'),
211
+ style: {
212
+ background: talkingColor
213
+ }
214
+ })))))() : (() => {
240
215
  if (icon) {
241
216
  if (typeof icon === 'string') {
242
217
  return /*#__PURE__*/React.createElement(View, {
@@ -250,14 +225,13 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
250
225
  className: clsx('icon-image-default-container', iconClassName)
251
226
  }, icon);
252
227
  }
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
228
+ return /*#__PURE__*/React.createElement(View, {
229
+ className: clsx('icon-panel',
230
+ // 类名按 iconfont 的 font_class 取,不是 name —— 图标库里这枚图标的
231
+ // name 是「one-way-intercom」(单向对讲)、font_class 是「yuyin」(unicode e63c),
232
+ // 而 CSS 类是按 font_class 生成的。曾经按 name 拼类名,字形永远找不到,
233
+ // 重新导出多少次都不会有那个类。别再"顺手改成语义化名字"。
234
+ 'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName)
261
235
  });
262
236
  })());
263
237
  });
@@ -32,22 +32,6 @@
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
-
51
35
  .ipc-player-plugin-voice-intercom-img {
52
36
  width: calc(@size * var(--ipc-player-size-scale, 1));
53
37
  height: calc(@size * var(--ipc-player-size-scale, 1));
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ZoomTurntableProps } from './type';
3
3
  import './index.less';
4
- declare const _default: {
5
- (props: ZoomTurntableProps): React.JSX.Element;
6
- displayName: string;
7
- };
8
- export default _default;
4
+ /**
5
+ * 焦距转盘渲染层。
6
+ * 内嵌自 ray-zoom-turntable,实际绘制与手势在 rjs(render 线程)内完成,
7
+ * 拖动不过桥,保证跟手。
8
+ */
9
+ declare const ZoomTurntable: React.FC<ZoomTurntableProps>;
10
+ export default ZoomTurntable;
@@ -1,9 +1,7 @@
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';
5
4
  import './index.less';
6
- import { withPlayerRenderer } from '../../../renderer/capabilities';
7
5
  let canvasIdCounter = 0;
8
6
 
9
7
  /**
@@ -83,4 +81,4 @@ const ZoomTurntable = props => {
83
81
  }
84
82
  });
85
83
  };
86
- export default withPlayerRenderer('zoomTurntable', ZoomTurntable, LynxZoomTurntable);
84
+ export default ZoomTurntable;
@@ -4,8 +4,6 @@ import './zoomTurntableDock.less';
4
4
  type Props = ComponentConfigProps & {
5
5
  /** 由 ui.tsx 的 CoverView 分支注入(absolute-item-container) */
6
6
  className?: string;
7
- /** Internal native clipping host preserves legacy canvas coordinates. */
8
- lynxClipContentStyle?: React.CSSProperties;
9
7
  };
10
8
  /**
11
9
  * 焦距转盘浮层。
@@ -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: _objectSpread(_objectSpread({}, turntableStyle), props.lynxClipContentStyle)
330
+ style: turntableStyle
331
331
  }, /*#__PURE__*/React.createElement(View, {
332
332
  style: canvasHolderStyle
333
333
  }, /*#__PURE__*/React.createElement(ZoomTurntable, {
@@ -2,14 +2,9 @@ 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, usePageEvent } from '@ray-js/ray';
5
+ import { View, Text, 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';
13
8
  import { useStore } from '../../ctx/store';
14
9
  import { UIEventContext } from '../../ui/context';
15
10
  import { PlayState } from '../../interface';
@@ -20,6 +15,7 @@ import { ZoomTurntableDock } from './zoomTurntableDock';
20
15
  import { ZoomTurntableTip } from './zoomTurntableTip';
21
16
  import { measureBottomBarHeight, measureEntryVisible } from './measureVisible';
22
17
  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';
23
19
  import './zoomTurntableEntry.less';
24
20
  /**
25
21
  * 焦距转盘入口:左下角工具条中的图标,长按弹出转盘。
@@ -28,7 +24,6 @@ import './zoomTurntableEntry.less';
28
24
  */
29
25
  export const ZoomTurntableEntry = props => {
30
26
  var _props$event;
31
- const renderMode = usePlayerRenderMode();
32
27
  const {
33
28
  devId,
34
29
  className,
@@ -135,33 +130,25 @@ export const ZoomTurntableEntry = props => {
135
130
  if (!hasContent('absolute', zoomTurntableDockId)) {
136
131
  // 必须用 CoverView 承载(不能设 absoluteNoCoverView):播放器是原生组件、层级更高,
137
132
  // 普通 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;
158
133
  addContent('absolute', {
159
134
  id: zoomTurntableDockId,
160
135
  content: dockProps => /*#__PURE__*/React.createElement(ZoomTurntableDock, dockProps),
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), {}, {
136
+ absolutePosition: screenType === 'full' ? {
137
+ top: 0,
138
+ right: getZoomDockRight(),
139
+ bottom: 0,
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), {}, {
165
152
  skipLoad: true
166
153
  })
167
154
  });
@@ -1,8 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { CoverView, View } from '@ray-js/ray';
2
+ import { CoverView, Text, 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';
6
4
  import { useStore } from '../../ctx/store';
7
5
  import { PlayState } from '../../interface';
8
6
  import { widgetClick, widgetLabs } from '../../ui/constant';
@@ -23,8 +21,6 @@ export const ZoomTurntableTip = props => {
23
21
  deleteContent,
24
22
  anchorRect
25
23
  } = props;
26
- const isLynx = usePlayerRenderMode() === 'lynx';
27
- const Host = isLynx ? View : CoverView;
28
24
  const {
29
25
  playState
30
26
  } = useStore({
@@ -68,18 +64,7 @@ export const ZoomTurntableTip = props => {
68
64
  if (playState !== PlayState.PLAYING || !layout) {
69
65
  return null;
70
66
  }
71
- return /*#__PURE__*/React.createElement(Host, {
72
- className: isLynx ? 'ipc-player-plugin-zoom-turntable-tip-native' : undefined,
73
- style: isLynx ? {
74
- position: 'absolute',
75
- left: 0,
76
- right: 0,
77
- top: 0,
78
- bottom: 0,
79
- width: '100%',
80
- height: '100%'
81
- } : undefined
82
- }, /*#__PURE__*/React.createElement(View, {
67
+ return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
83
68
  className: clsx('ipc-player-plugin-zoom-turntable-tip-ring'),
84
69
  style: layout.ring
85
70
  }), /*#__PURE__*/React.createElement(View, {
@@ -99,10 +84,5 @@ export const ZoomTurntableTip = props => {
99
84
  const storage = new Storage(devId);
100
85
  storage.set(zoomTurntableTipId, true);
101
86
  }
102
- }, isLynx ? /*#__PURE__*/React.createElement(Text, {
103
- style: {
104
- fontSize: '12px',
105
- lineHeight: '17px'
106
- }
107
- }, Strings.getLang('ipc_player_tip_confirm')) : Strings.getLang('ipc_player_tip_confirm'))));
87
+ }, Strings.getLang('ipc_player_tip_confirm'))));
108
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.66-beta.0",
3
+ "version": "0.0.67-beta.0",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -29,19 +29,17 @@
29
29
  "start:web": "ray start ./example -t web",
30
30
  "prepublishOnly": "yarn build",
31
31
  "release-it": "standard-version",
32
- "test": "yarn jest",
33
- "test:lynx": "node --test tests/*.test.cjs",
34
- "test:features": "jest --runInBand --runTestsByPath tests/master-features.test.tsx tests/auto-clarity-config.test.tsx src/utils/authorize/album.test.ts src/widgets/recordVideo/recordVideo.test.tsx src/widgets/zoomTurntable/lensModel.test.ts src/widgets/muted/muted.test.tsx tests/zoom-turntable-tip.test.tsx tests/zoom-turntable-touch.test.tsx"
32
+ "test": "yarn jest"
35
33
  },
36
34
  "peerDependencies": {
37
35
  "ahooks": "^3.1.6"
38
36
  },
39
37
  "dependencies": {
40
- "@ray-js/direction-control": "0.0.13-beta.1",
41
- "@ray-js/ipc-ptz-zoom": "0.0.5-beta.0",
38
+ "@ray-js/direction-control": "^0.0.8",
39
+ "@ray-js/ipc-ptz-zoom": "^0.0.3",
40
+ "@ray-js/ray-ipc-player": "2.1.7-beta.0",
42
41
  "@ray-js/panel-sdk": "^1.13.1",
43
- "@ray-js/ray-ipc-player": "2.1.8-beta.0",
44
- "@ray-js/ray-ipc-utils": "^1.1.18",
42
+ "@ray-js/ray-ipc-utils": "^1.1.16",
45
43
  "@ray-js/svg": "0.2.0",
46
44
  "clsx": "^1.2.1",
47
45
  "color": "^5.0.2",
@@ -59,13 +57,7 @@
59
57
  "eslint-config-tuya-panel": "^0.4.2",
60
58
  "husky": "^1.2.0",
61
59
  "lint-staged": "^10.2.11",
62
- "standard-version": "9.3.2",
63
- "react": "17.0.2",
64
- "react-dom": "17.0.2",
65
- "typescript": "4.9.5",
66
- "jest": "29.7.0",
67
- "ts-jest": "29.2.6",
68
- "jest-environment-jsdom": "29.7.0"
60
+ "standard-version": "9.3.2"
69
61
  },
70
62
  "resolutions": {
71
63
  "@ray-js/builder-mp": "^1.7.62"
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export type LynxPlayerAdapters = Partial<Record<'zoomTurntable' | 'ptzZoom' | 'directionControl', React.ComponentType<any>>>;
3
- export declare const LynxPlayerAdaptersContext: React.Context<Partial<Record<"zoomTurntable" | "ptzZoom" | "directionControl", React.ComponentType<any>>>>;
4
- /** Never mount a WebView-only RJS renderer in the Lynx tree. */
5
- export declare function withPlayerRenderer<P>(capability: keyof LynxPlayerAdapters, WebViewComponent: React.ComponentType<P>, LynxComponent?: React.ComponentType<P>): {
6
- (props: P): React.JSX.Element;
7
- displayName: string;
8
- };
@@ -1,19 +0,0 @@
1
- import React, { createContext, useContext } from 'react';
2
- import { usePlayerRenderMode } from './context';
3
- export const LynxPlayerAdaptersContext = /*#__PURE__*/createContext({});
4
-
5
- /** Never mount a WebView-only RJS renderer in the Lynx tree. */
6
- export function withPlayerRenderer(capability, WebViewComponent, LynxComponent) {
7
- const RendererComponent = props => {
8
- const mode = usePlayerRenderMode();
9
- const adapters = useContext(LynxPlayerAdaptersContext);
10
- if (mode !== 'lynx') return /*#__PURE__*/React.createElement(WebViewComponent, props);
11
- const Adapter = adapters[capability] || LynxComponent;
12
- if (!Adapter) {
13
- throw new Error(`IPC_LYNX_CAPABILITY_MISSING:${capability}. Supply a supported Native/WebView adapter before enabling this widget.`);
14
- }
15
- return /*#__PURE__*/React.createElement(Adapter, props);
16
- };
17
- RendererComponent.displayName = `PlayerRenderer(${String(capability)})`;
18
- return RendererComponent;
19
- }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const PlayerControlVisibilityContext: import("react").Context<boolean | undefined>;
3
- export type PlayerRenderMode = 'webview' | 'lynx';
4
- export declare const PlayerRenderModeContext: import("react").Context<PlayerRenderMode>;
5
- export declare const usePlayerRenderMode: () => PlayerRenderMode;
@@ -1,6 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
-
3
- // Scoped to the control bars, not absolute widgets or the standalone intercom.
4
- export const PlayerControlVisibilityContext = /*#__PURE__*/createContext(undefined);
5
- export const PlayerRenderModeContext = /*#__PURE__*/createContext('webview');
6
- export const usePlayerRenderMode = () => useContext(PlayerRenderModeContext);
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: {
3
- (props: import("@ray-js/direction-control").IProps): import("react").JSX.Element;
4
- displayName: string;
5
- };
6
- export default _default;
@@ -1,3 +0,0 @@
1
- import WebViewDirectionControl from '@ray-js/direction-control';
2
- import { withPlayerRenderer } from './capabilities';
3
- export default withPlayerRenderer('directionControl', WebViewDirectionControl);