@ray-js/ipc-player-integration 0.0.59-beta.0 → 0.0.60-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 (91) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.js +3 -0
  3. package/lib/index.d.ts +0 -4
  4. package/lib/index.js +1 -3
  5. package/lib/interface.d.ts +1 -0
  6. package/lib/ui/bottomLeftContent.js +55 -119
  7. package/lib/ui/bottomRightContent.js +3 -6
  8. package/lib/ui/ui.d.ts +0 -5
  9. package/lib/ui/ui.js +19 -37
  10. package/lib/utils/fullLinkTracking.d.ts +5 -0
  11. package/lib/utils/fullLinkTracking.js +71 -0
  12. package/lib/utils/navigation.d.ts +2 -1
  13. package/lib/utils/navigation.js +13 -3
  14. package/lib/widgets/battery/battery.js +1 -2
  15. package/lib/widgets/battery/batteryFull.js +1 -2
  16. package/lib/widgets/floodlight/floodlight.js +1 -2
  17. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  18. package/lib/widgets/fullScreen/fullScreen.js +1 -2
  19. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  20. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  21. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  22. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  23. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
  24. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  25. package/lib/widgets/multiCamera/landscapeTip.js +1 -2
  26. package/lib/widgets/multiCamera/moveablePtzControl.js +1 -1
  27. package/lib/widgets/multiCamera/multiPtz.js +1 -2
  28. package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
  29. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  30. package/lib/widgets/multiCamera/tileMultiPtz.js +1 -2
  31. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  32. package/lib/widgets/multiCamera/tileTip.js +1 -2
  33. package/lib/widgets/muted/muted.js +1 -2
  34. package/lib/widgets/ptz/ptz.js +1 -2
  35. package/lib/widgets/ptz/ptzControl.js +1 -1
  36. package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
  37. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  38. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  39. package/lib/widgets/recordVideo/recordVideo.js +1 -2
  40. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  41. package/lib/widgets/resolution/resolution.js +2 -3
  42. package/lib/widgets/screenshot/screenshot.js +1 -2
  43. package/lib/widgets/signal4G/signal4G.js +1 -4
  44. package/lib/widgets/siren/siren.js +1 -2
  45. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  46. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  47. package/lib/widgets/trialBadge/index.d.ts +2 -1
  48. package/lib/widgets/trialBadge/index.js +20 -17
  49. package/lib/widgets/trialBadge/index.less +0 -24
  50. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  51. package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
  52. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  53. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  54. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  55. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  56. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  57. package/lib/widgets/zoomTurntable/turntable/index.js +1 -2
  58. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +1 -2
  59. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +1 -2
  60. package/package.json +7 -15
  61. package/lib/renderer/capabilities.d.ts +0 -8
  62. package/lib/renderer/capabilities.js +0 -19
  63. package/lib/renderer/context.d.ts +0 -5
  64. package/lib/renderer/context.js +0 -6
  65. package/lib/renderer/directionControl.d.ts +0 -6
  66. package/lib/renderer/directionControl.js +0 -3
  67. package/lib/renderer/font.less +0 -5
  68. package/lib/renderer/glyphs.d.ts +0 -1
  69. package/lib/renderer/glyphs.js +0 -256
  70. package/lib/renderer/index.module.less +0 -48
  71. package/lib/renderer/ptzZoom.d.ts +0 -6
  72. package/lib/renderer/ptzZoom.js +0 -3
  73. package/lib/renderer/text.d.ts +0 -4
  74. package/lib/renderer/text.js +0 -32
  75. package/lib/renderer/text.module.less +0 -4
  76. package/lib/renderer/viewport.d.ts +0 -7
  77. package/lib/renderer/viewport.js +0 -24
  78. package/lib/res/lynx-signal/index.d.ts +0 -1
  79. package/lib/res/lynx-signal/index.js +0 -22
  80. package/lib/res/lynx-signal/signalFour0.png +0 -0
  81. package/lib/res/lynx-signal/signalFour1.png +0 -0
  82. package/lib/res/lynx-signal/signalFour2.png +0 -0
  83. package/lib/res/lynx-signal/signalFour3.png +0 -0
  84. package/lib/res/lynx-signal/signalFour4.png +0 -0
  85. package/lib/res/lynx-signal/signalThree0.png +0 -0
  86. package/lib/res/lynx-signal/signalThree1.png +0 -0
  87. package/lib/res/lynx-signal/signalThree2.png +0 -0
  88. package/lib/res/lynx-signal/signalThree3.png +0 -0
  89. package/lib/res/player-more-arrow.png +0 -0
  90. package/lib/ui/scrollHintArrow.d.ts +0 -23
  91. package/lib/ui/scrollHintArrow.js +0 -82
@@ -0,0 +1,71 @@
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 { getLaunchOptionsSync } from '@ray-js/ray';
6
+ import { getInitUtmTid } from '@ray-js/ray-ipc-utils';
7
+ export const createEntryTracking = () => {
8
+ let upstreamRtid;
9
+ try {
10
+ var _getLaunchOptionsSync;
11
+ upstreamRtid = (_getLaunchOptionsSync = getLaunchOptionsSync()) === null || _getLaunchOptionsSync === void 0 || (_getLaunchOptionsSync = _getLaunchOptionsSync.query) === null || _getLaunchOptionsSync === void 0 ? void 0 : _getLaunchOptionsSync.utm_rtid;
12
+ } catch (error) {
13
+ // Tracking must not prevent navigation when launch options are unavailable.
14
+ }
15
+ return {
16
+ utm_source: 'miniprogram',
17
+ utm_medium: 'panel_smart_quality',
18
+ entry_source_type: 'organic',
19
+ utm_rtid: upstreamRtid || getInitUtmTid()
20
+ };
21
+ };
22
+ export const appendTrackingQuery = (url, tracking) => {
23
+ const hashIndex = url.indexOf('#');
24
+ const base = hashIndex < 0 ? url : url.slice(0, hashIndex);
25
+ const hash = hashIndex < 0 ? '' : url.slice(hashIndex);
26
+ const queryIndex = base.indexOf('?');
27
+ const path = queryIndex < 0 ? base : base.slice(0, queryIndex);
28
+ const params = (queryIndex < 0 ? [] : base.slice(queryIndex + 1).split('&')).filter(param => {
29
+ if (!param) return false;
30
+ return !Object.prototype.hasOwnProperty.call(tracking, decodeURIComponent(param.split('=')[0]));
31
+ });
32
+ Object.entries(tracking).forEach(_ref => {
33
+ let [key, value] = _ref;
34
+ params.push(`${key}=${encodeURIComponent(value)}`);
35
+ });
36
+ return `${path}?${params.join('&')}${hash}`;
37
+ };
38
+ const reportEntry = async (eventType, devId, tracking) => {
39
+ try {
40
+ const {
41
+ homeId
42
+ } = await new Promise((resolve, reject) => {
43
+ ty.home.getCurrentHomeInfo({
44
+ success: resolve,
45
+ fail: reject
46
+ });
47
+ });
48
+ const {
49
+ miniProgram
50
+ } = ty.getAccountInfoSync();
51
+ const event = _objectSpread(_objectSpread({
52
+ project_type: 'cloud_storage',
53
+ event_type: eventType,
54
+ container_type: 'miniapp',
55
+ miniapp_code: miniProgram.appId,
56
+ miniapp_version: miniProgram.version,
57
+ service_type: 'security_cloud_service'
58
+ }, tracking), {}, {
59
+ device_id: devId,
60
+ homeid: homeId
61
+ });
62
+ ty.event({
63
+ eventId: eventType === 'card_view' ? 'ty_XjSozxV0YkDMjzH8orMHx0g2HMc6GQ3q' : 'ty_tUWSmFcHcSetzZd5soRTq6Y3nEYE0RgP',
64
+ event
65
+ });
66
+ } catch (error) {
67
+ console.warn('[IPC] entry tracking failed:', error);
68
+ }
69
+ };
70
+ export const reportEntryView = (devId, tracking) => reportEntry('card_view', devId, tracking);
71
+ export const reportEntryClick = (devId, tracking) => reportEntry('card_click', devId, tracking);
@@ -1,7 +1,8 @@
1
+ import { EntryTracking } from './fullLinkTracking';
1
2
  export declare const miniIdLabs: {
2
3
  aiDrawMini: string;
3
4
  securityCloudService: string;
4
5
  };
5
6
  export declare function gotoAIDrawMiniProgram(devId: string, brandColor: string): void;
6
7
  export declare function gotoSecurityCloudService(homeId: string, uuid: string): Promise<void>;
7
- export declare function gotoSecurityCloudService2(devId: string): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
8
+ export declare function gotoSecurityCloudService2(devId: string, tracking?: EntryTracking): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
@@ -1,5 +1,6 @@
1
- import { getServiceUrl, goToMiniProgramByShortLink } from '@ray-js/ray-ipc-utils';
1
+ import { getServiceUrl, goToMiniProgramByShortLink, jumpToWebView } from '@ray-js/ray-ipc-utils';
2
2
  import Color from 'color';
3
+ import { appendTrackingQuery } from './fullLinkTracking';
3
4
 
4
5
  // 小程序ID集合
5
6
  export const miniIdLabs = {
@@ -18,6 +19,15 @@ export async function gotoSecurityCloudService(homeId, uuid) {
18
19
  const url = `godzilla://${miniIdLabs.securityCloudService}${'/pages/serviceList/index'}?homeId=${homeId}&deviceId=${uuid}&categoryCode=${'security_cloud_service'}`;
19
20
  goToMiniProgramByShortLink(url, 'right');
20
21
  }
21
- export async function gotoSecurityCloudService2(devId) {
22
- return getServiceUrl(devId, 'security_cloud_service', {}, true);
22
+ export async function gotoSecurityCloudService2(devId, tracking) {
23
+ var _result$data;
24
+ const serviceType = 'security_cloud_service';
25
+ const params = {};
26
+ if (!tracking) return getServiceUrl(devId, serviceType, params, true);
27
+ const result = await getServiceUrl(devId, serviceType, params, false, tracking.utm_rtid);
28
+ if ((result === null || result === void 0 ? void 0 : result.code) !== 0 || !((_result$data = result.data) !== null && _result$data !== void 0 && _result$data.url)) {
29
+ throw new Error('Failed to fetch the cloud service URL');
30
+ }
31
+ const url = appendTrackingQuery(result.data.url, tracking);
32
+ return result.data.type === 2 ? goToMiniProgramByShortLink(url) : jumpToWebView(url);
23
33
  }
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { PowerMode } from '../../ports.output';
7
6
  import './battery.less';
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { PowerMode } from '../../ports.output';
7
6
  import './battery.less';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
5
4
  import { useDpState } from '../../hooks';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import { UIEventContext } from '../../ui/context';
@@ -1,9 +1,8 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React, { useEffect, useRef, useState } from 'react';
4
4
  import { getServiceUrl } from '@ray-js/ray-ipc-utils';
5
5
  import { useMemoizedFn } from 'ahooks';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import Strings from '../../i18n';
8
7
  import { useStore } from '../../ctx/store';
9
8
  import { showFlowLowTipId } from '../../ui/constant';
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useContext, useEffect, useMemo } from 'react';
3
- import { View, setPageOrientation, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
3
+ import { View, setPageOrientation, Text, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { UIEventContext } from '../../ui/context';
8
7
  import { showAllComponent, voiceIntercomId, verticalScreenId, fullTravelRouteControlId, ptzControlId, fullResolutionId, fullSmallIntercomId, pauseTimeToHideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
9
8
  import { useStore } from '../../ctx/store';
@@ -2,7 +2,7 @@
2
2
  * 全屏状态下要添加的摄像机行进路线控件
3
3
  */
4
4
  import React from 'react';
5
- import RectDirectionControl from '../../renderer/directionControl';
5
+ import RectDirectionControl from '@ray-js/direction-control';
6
6
  import type { ComponentConfigProps } from '../../interface';
7
7
  type RectDirectionControlProps = React.ComponentProps<typeof RectDirectionControl>;
8
8
  export type FullTravelRouteControlProps = ComponentConfigProps & {
@@ -6,8 +6,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
6
6
  import React, { useEffect, useContext, useState, useRef } from 'react';
7
7
  import { View } from '@ray-js/ray';
8
8
  import clsx from 'clsx';
9
+ import RectDirectionControl from '@ray-js/direction-control';
9
10
  import { useMemoizedFn } from 'ahooks';
10
- import RectDirectionControl from '../../renderer/directionControl';
11
11
  import { UIEventContext } from '../../ui/context';
12
12
  import { useDpState } from '../../hooks';
13
13
  import { useComponentHideState } from '../../ui/hooks';
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import './verticalScreen.less';
6
5
  const NILL = () => null;
7
6
  export function VerticalScreen(_ref) {
@@ -1,7 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { UIEventContext } from '../../ui/context';
7
6
  import { hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
@@ -4,8 +4,6 @@ import "core-js/modules/esnext.iterator.map.js";
4
4
  import React from 'react';
5
5
  import { View, ScrollView, CoverView } from '@ray-js/ray';
6
6
  import clsx from 'clsx';
7
- import { usePlayerRenderMode } from '../../renderer/context';
8
- import { PlayerText } from '../../renderer/text';
9
7
  import './moveInteractiveControlUI.less';
10
8
  const defaultMenu = [{
11
9
  key: '0',
@@ -64,7 +62,6 @@ const defaultCSSVariable = {
64
62
  '--activeColor': '#FF592A'
65
63
  };
66
64
  export function MoveInterActiveControlUI(props) {
67
- const isLynx = usePlayerRenderMode() === 'lynx';
68
65
  const {
69
66
  contentClsName,
70
67
  wrapClsName,
@@ -83,17 +80,13 @@ export function MoveInterActiveControlUI(props) {
83
80
  // @ts-ignore
84
81
  , {
85
82
  style: _objectSpread({}, CSSVariable),
86
- className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName, {
87
- 'ipc-player-plugin-active-control-wrap-lynx': isLynx,
88
- 'ipc-player-plugin-active-control-wrap-webview': !isLynx
89
- })
83
+ className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName)
90
84
  }, /*#__PURE__*/React.createElement(View, {
91
85
  className: clsx('ipc-player-plugin-active-control-title')
92
86
  }, I18n.t('homeFeatureInteractiveMenuTitle')), /*#__PURE__*/React.createElement(ScrollView, {
93
87
  style: {
94
88
  flex: 1
95
89
  },
96
- className: isLynx ? 'ipc-player-plugin-active-control-scroll-lynx' : undefined,
97
90
  scrollY: true
98
91
  }, /*#__PURE__*/React.createElement(View, {
99
92
  className: clsx('ipc-player-plugin-active-control', contentClsName)
@@ -105,11 +98,9 @@ export function MoveInterActiveControlUI(props) {
105
98
  })
106
99
  }, /*#__PURE__*/React.createElement(View, {
107
100
  className: clsx('ipc-player-plugin-active-control-item-icon')
108
- }, !isLynx && /*#__PURE__*/React.createElement(View, {
101
+ }, /*#__PURE__*/React.createElement(View, {
109
102
  className: clsx('ipc-player-plugin-active-control-item-icon-mask')
110
- }), isLynx ? /*#__PURE__*/React.createElement(PlayerText, {
111
- className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
112
- }) : /*#__PURE__*/React.createElement(View, {
103
+ }), /*#__PURE__*/React.createElement(View, {
113
104
  className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
114
105
  })), /*#__PURE__*/React.createElement(View, {
115
106
  className: clsx('ipc-player-plugin-active-control-item-title')
@@ -43,6 +43,8 @@
43
43
  }
44
44
  }
45
45
  .ipc-player-plugin-active-control-item-icon {
46
+ position: relative;
47
+ z-index: 1;
46
48
  width: calc(42px * var(--ipc-player-size-scale, 1));
47
49
  height: calc(42px * var(--ipc-player-size-scale, 1));
48
50
  border-radius: calc(42px * var(--ipc-player-size-scale, 1));
@@ -52,6 +54,7 @@
52
54
  justify-content: center;
53
55
  font-size: calc(16px * var(--ipc-player-size-scale, 1));
54
56
  color: var(--color);
57
+ overflow: hidden;
55
58
  .ipc-player-plugin-active-control-item-icon-mask {
56
59
  position: absolute;
57
60
  width: 100%;
@@ -61,14 +64,6 @@
61
64
  opacity: 1;
62
65
  }
63
66
  }
64
-
65
- .ipc-player-plugin-active-control-wrap-webview {
66
- .ipc-player-plugin-active-control-item-icon {
67
- position: relative;
68
- z-index: 1;
69
- overflow: hidden;
70
- }
71
- }
72
67
  .ipc-player-plugin-active-control-item-title {
73
68
  width: calc(70px * var(--ipc-player-size-scale, 1));
74
69
  white-space: nowrap; /* 防止文本换行 */
@@ -78,19 +73,4 @@
78
73
  }
79
74
  .ipc-player-plugin-interactive-icon {
80
75
  font-size: calc(20px * var(--ipc-player-size-scale, 1));;
81
- }
82
-
83
- .ipc-player-plugin-active-control-wrap-lynx {
84
- min-height: 0;
85
-
86
- .ipc-player-plugin-active-control-scroll-lynx {
87
- height: 0;
88
- min-height: 0;
89
- overflow: hidden;
90
- }
91
-
92
- .ipc-player-plugin-active-control-item-icon {
93
- // The background belongs to the scrolling card, not a separate absolute layer.
94
- background: var(--iconBgColor);
95
- }
96
- }
76
+ }
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { landscapeTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -7,7 +7,7 @@ import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
7
7
  import _find from 'lodash/find';
8
8
  import _get from 'lodash/get';
9
9
  import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
10
- import IpcPtzZoom from '../../renderer/ptzZoom';
10
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
11
11
  import { useStore } from '../../ctx/store';
12
12
  import { useMemoizedFn } from '../../hooks';
13
13
  import { MultiCameraScreenMode } from '../../interface';
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { useStore } from '../../ctx/store';
8
7
  import './index.less';
9
8
  /**
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { ptzMoveableTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { Text, View } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React, { useMemo } from 'react';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../../interface';
7
6
  import { multiPrefix } from './constants';
@@ -1,10 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
6
  import Color from 'color';
7
- import { PlayerText as Text } from '../../renderer/text';
8
7
  import { useStore } from '../../ctx/store';
9
8
  import { multiPrefix } from './constants';
10
9
  import './index.less';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } from '@ray-js/ray';
2
2
  import React, { useMemo } from 'react';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { MultiCameraLayoutStyle } from '../../interface';
6
5
  import { multiPrefix } from './constants';
7
6
  import { useStore } from '../../ctx/store';
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { tileTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { UIEventContext } from '../../ui/context';
7
6
  import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React, { useEffect, useState, useContext } from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { UIEventContext } from '../../ui/context';
8
7
  import { usePtz } from '../../hooks';
9
8
  import { useStore } from '../../ctx/store';
@@ -4,8 +4,8 @@ import { CoverView } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import _find from 'lodash/find';
6
6
  import _get from 'lodash/get';
7
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
7
8
  import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
8
- import IpcPtzZoom from '../../renderer/ptzZoom';
9
9
  import { Storage } from '../../utils/storage';
10
10
  import { useMemoizedFn } from '../../hooks';
11
11
  import { useComponentHideState } from '../../ui/hooks';
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Image, CoverView, setStorage } from '@ray-js/ray';
2
+ import { View, Image, CoverView, Text, setStorage } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
- import { usePlayerRenderMode } from '../../renderer/context';
6
4
  import { useStore } from '../../ctx/store';
7
5
  import { ptzControlTipId, widgetLabs, widgetClick } from '../../ui/constant';
8
6
  import { PlayState } from '../../interface';
@@ -14,7 +12,6 @@ export const PtzControlTip = props => {
14
12
  devId,
15
13
  deleteContent
16
14
  } = props;
17
- const isLynx = usePlayerRenderMode() === 'lynx';
18
15
  const [showTipModal, setShowTipModal] = useState(true);
19
16
  const {
20
17
  playState
@@ -37,9 +34,9 @@ export const PtzControlTip = props => {
37
34
  return /*#__PURE__*/React.createElement(CoverView, {
38
35
  className: clsx('playerControlTipContainer')
39
36
  }, /*#__PURE__*/React.createElement(Image, {
40
- mode: isLynx ? 'aspectFit' : 'widthFix',
37
+ mode: "widthFix",
41
38
  src: playerPtzControlTip,
42
- className: clsx('controlTipImage', isLynx && 'controlTipImageLynx')
39
+ className: clsx('controlTipImage')
43
40
  }), /*#__PURE__*/React.createElement(Text, {
44
41
  className: clsx('controlTipText')
45
42
  }, Strings.getLang('ipc_player_ptz_control_tip')), /*#__PURE__*/React.createElement(View, {
@@ -39,9 +39,3 @@
39
39
  color: #ffffff;
40
40
  }
41
41
  }
42
-
43
- // Original PNG is 404 x 158. Lynx needs both dimensions; widthFix is WebView-only.
44
- .playerControlTipContainer .controlTipImageLynx {
45
- height: calc(66.4851485149px * var(--ipc-player-size-scale, 1));
46
- flex-shrink: 0;
47
- }
@@ -1,7 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { PlayState } from '../../interface';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import { useDpSupport } from '../../hooks/useDpSupport';
@@ -1,9 +1,8 @@
1
1
  import React, { useState, useEffect, useRef, useContext } from 'react';
2
- import { View, Image, getSystemInfoSync } from '@ray-js/ray';
2
+ import { View, Text, Image, getSystemInfoSync } from '@ray-js/ray';
3
3
  import { useSetState, useUpdateEffect } from 'ahooks';
4
4
  import clsx from 'clsx';
5
5
  import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import Strings from '../../i18n';
8
7
  import { PlayState } from '../../interface';
9
8
  import { UIEventContext } from '../../ui/context';
@@ -1,9 +1,8 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.map.js";
3
3
  import React, { useState, useContext, useEffect } from 'react';
4
- import { View, showToast } from '@ray-js/ray';
4
+ import { Text, View, showToast } from '@ray-js/ray';
5
5
  import clsx from 'clsx';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import Strings from '../../i18n';
8
7
  import { useMemoizedFn } from '../../hooks';
9
8
  import { useStore } from '../../ctx/store';
@@ -34,10 +33,6 @@ export const FullResolutionControl = props => {
34
33
  const onPlayerTap = useMemoizedFn(() => {
35
34
  setHide(true);
36
35
  });
37
- const normalizeResolution = value => {
38
- const normalized = String(value || '').toUpperCase();
39
- return normalized === 'HD' ? 'HD' : 'SD';
40
- };
41
36
  useEffect(() => {
42
37
  event.on('showFullResolutionControl', onShowFullResolutionControl);
43
38
  event.on(playerTap, onPlayerTap);
@@ -47,14 +42,13 @@ export const FullResolutionControl = props => {
47
42
  };
48
43
  }, []);
49
44
  const changeResolution = useMemoizedFn(value => {
50
- const targetResolution = normalizeResolution(value);
51
- if (targetResolution === normalizeResolution(resolution)) {
45
+ if (value === resolution) {
52
46
  showToast({
53
47
  icon: 'none',
54
48
  title: Strings.getLang('ipc_player_current_resolution_is_equal')
55
49
  });
56
50
  } else {
57
- setResolution(targetResolution).then(() => {
51
+ setResolution(value).then(() => {
58
52
  showToast({
59
53
  icon: 'none',
60
54
  title: Strings.getLang('ipc_player_change_resolution_success')
@@ -74,24 +68,20 @@ export const FullResolutionControl = props => {
74
68
  className: clsx('ipc-player-plugin-full-resolution-control', 'ipc-plugin-absolute-move-in-right', {
75
69
  'ipc-plugin-absolute-move-in-right-hide': hide
76
70
  })
77
- }, resolutionList.map(item => {
78
- const normalizedItem = normalizeResolution(item);
79
- const selected = normalizedItem === normalizeResolution(resolution);
80
- return /*#__PURE__*/React.createElement(Text, {
81
- key: item,
82
- onClick: () => {
83
- event.emit(widgetClick, {
84
- widgetId: widgetLabs.FULL_RESOLUTION_CONTROL,
85
- extra: {
86
- resolution: normalizedItem
87
- }
88
- });
89
- changeResolution(normalizedItem);
90
- },
91
- className: clsx('ipc-player-plugin-full-resolution-control-text'),
92
- style: selected ? {
93
- color: brandColor
94
- } : undefined
95
- }, Strings.getLang(`ipc_player_resolution_${normalizedItem}`));
96
- }));
71
+ }, resolutionList.map(item => /*#__PURE__*/React.createElement(Text, {
72
+ onClick: () => {
73
+ event.emit(widgetClick, {
74
+ widgetId: widgetLabs.FULL_RESOLUTION_CONTROL,
75
+ extra: {
76
+ resolution: item
77
+ }
78
+ });
79
+ changeResolution(item);
80
+ },
81
+ key: item,
82
+ className: clsx('ipc-player-plugin-full-resolution-control-text'),
83
+ style: item === resolution && {
84
+ color: brandColor
85
+ }
86
+ }, Strings.getLang(`ipc_player_resolution_${item}`))));
97
87
  };
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React, { useContext } from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import Strings from '../../i18n';
8
7
  import { FullResolutionControl } from './fullResolutionControl';
9
8
  import { fullResolutionId, pauseTimeToHideAllComponent, hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
@@ -53,7 +52,7 @@ export const Resolution = props => {
53
52
  }
54
53
  if (verticalResolutionCustomClick) return false;
55
54
  if (screenType === 'vertical') {
56
- setResolution(String(resolution).toUpperCase() === 'HD' ? 'SD' : 'HD');
55
+ setResolution(resolution === 'HD' ? 'SD' : 'HD');
57
56
  }
58
57
  event.emit(pauseTimeToHideAllComponent);
59
58
  return true;
@@ -1,9 +1,8 @@
1
1
  import React, { useContext, useRef } from 'react';
2
- import { View, Image, getSystemInfoSync } from '@ray-js/ray';
2
+ import { View, Image, Text, getSystemInfoSync } from '@ray-js/ray';
3
3
  import { useSetState, useUpdateEffect, useMemoizedFn } from 'ahooks';
4
4
  import clsx from 'clsx';
5
5
  import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import Strings from '../../i18n';
8
7
  import { useStore } from '../../ctx/store';
9
8
  import { UIEventContext } from '../../ui/context';
@@ -3,15 +3,12 @@ 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';
8
6
  import './signal4G.less';
9
7
  export const Signal4G = props => {
10
8
  const {
11
9
  className,
12
10
  devId
13
11
  } = props;
14
- const isLynx = usePlayerRenderMode() === 'lynx';
15
12
  const {
16
13
  dpValue,
17
14
  signalKey
@@ -25,7 +22,7 @@ export const Signal4G = props => {
25
22
  className: clsx('ipc-player-plugin-signal4g')
26
23
  }, /*#__PURE__*/React.createElement(Image, {
27
24
  className: clsx('ipc-player-plugin-signal4g-icon'),
28
- src: isLynx ? signalPngMap[signalKey] : signalSvgMap[signalKey],
25
+ src: signalSvgMap[signalKey],
29
26
  mode: "aspectFit"
30
27
  })));
31
28
  };
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
5
4
  import { useDpState } from '../../hooks';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import { UIEventContext } from '../../ui/context';