@ray-js/ipc-player-integration 0.0.35-beta.23 → 0.0.35-beta.25

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.
Binary file
@@ -8,10 +8,6 @@ import { useComponentHideState } from './hooks';
8
8
  import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
9
9
  /** 右侧透明渐变宽度,用于提示横向可滑动 */
10
10
  const FADE_MASK = 'linear-gradient(to right, #000 calc(100% - 48px), transparent 100%)';
11
-
12
- /** TrialBadge 组件高度 40px + 间距 */
13
- const BADGE_HEIGHT_VERTICAL = 44;
14
- const BADGE_HEIGHT_FULL = 48;
15
11
  const BottomLeftContent = _ref => {
16
12
  let {
17
13
  ctx,
@@ -62,25 +58,22 @@ const BottomLeftContent = _ref => {
62
58
  } = useTrialBadge(ctx.event, ctx.devId, trialRemainingSec);
63
59
  const paddingLeftPx = screenType === 'vertical' ? 0 : 25;
64
60
  const showBadge = showSmartImageQuality && showTrialBadge && canOpenSettings && gRawData && !isLowPhone && buttonState === 1 && trialRemainingSec > 0;
65
- const bottomBarHeight = screenType === 'vertical' ? 40 : 58;
66
- const badgeAreaHeight = screenType === 'vertical' ? BADGE_HEIGHT_VERTICAL : BADGE_HEIGHT_FULL;
67
- const containerHeight = showBadge ? `${bottomBarHeight + badgeAreaHeight}px` : `${bottomBarHeight}px`;
61
+ const containerHeight = screenType === 'vertical' ? 48 : 83;
68
62
  return /*#__PURE__*/React.createElement(CoverView, {
69
63
  className: clsx('ipc-player-bottom-left-content-wrap'),
70
64
  style: {
71
65
  right: `${reservedRight}px`,
72
- height: containerHeight,
66
+ height: showBadge ? `${containerHeight + 30}px` : `${containerHeight}px`,
73
67
  display: 'flex',
74
68
  flexDirection: 'column',
75
- justifyContent: 'flex-end',
69
+ justifyContent: 'center',
76
70
  opacity: shouldHide ? 0 : 1,
77
71
  pointerEvents: shouldHide ? 'none' : 'auto'
78
72
  }
79
73
  }, showBadge && /*#__PURE__*/React.createElement(View, {
80
74
  style: {
81
- paddingLeft: screenType === 'vertical' ? '0px' : '25px',
82
- marginBottom: screenType === 'vertical' ? '4px' : '8px',
83
- marginLeft: '12px'
75
+ height: '32px',
76
+ marginLeft: screenType === 'vertical' ? '12px' : '25px'
84
77
  }
85
78
  }, /*#__PURE__*/React.createElement(TrialBadge, {
86
79
  brandColor: brandColor,
@@ -89,10 +82,12 @@ const BottomLeftContent = _ref => {
89
82
  onCountdownEnd: handleCountdownEnd
90
83
  })), /*#__PURE__*/React.createElement(View, {
91
84
  style: {
92
- paddingBottom: screenType === 'vertical' ? '14px' : '32px',
85
+ paddingBottom: screenType === 'vertical' ? 0 : '32px',
93
86
  paddingLeft: `${paddingLeftPx}px`,
94
87
  paddingRight: '16px',
95
88
  width: '100%',
89
+ height: `${containerHeight}px`,
90
+ marginTop: showBadge ? '-2px' : 0,
96
91
  overflowX: 'auto',
97
92
  overflowY: 'hidden',
98
93
  whiteSpace: 'nowrap',
@@ -17,20 +17,21 @@ const BottomRightContent = _ref => {
17
17
  playState: ctx.playState
18
18
  });
19
19
  const [shouldHide] = useComponentHideState();
20
+ const containerHeight = screenType === 'vertical' ? 48 : 83;
20
21
  return /*#__PURE__*/React.createElement(CoverView, {
21
22
  className: clsx('ipc-player-bottom-right-content-wrap'),
22
23
  style: _objectSpread({
23
24
  paddingLeft: screenType === 'vertical' ? '10px' : '0',
24
- height: screenType === 'vertical' ? shouldHide ? '41px' : '40px' : shouldHide ? '57px' : '58px'
25
+ height: screenType === 'vertical' ? shouldHide ? '49px' : '48px' : shouldHide ? '84px' : '83px'
25
26
  }, typeof width === 'number' && width > 0 ? {
26
27
  width: `${width}px`,
27
28
  boxSizing: 'border-box'
28
29
  } : null)
29
30
  }, /*#__PURE__*/React.createElement(View, {
30
31
  style: {
31
- paddingBottom: screenType === 'vertical' ? '14px' : '32px',
32
32
  paddingRight: screenType === 'vertical' ? 0 : '25px',
33
33
  width: '100%',
34
+ height: `${containerHeight}px`,
34
35
  justifyContent: 'flex-end'
35
36
  },
36
37
  className: clsx('ipc-player-bottom-right-content-container', {
package/lib/ui/ui.js CHANGED
@@ -794,9 +794,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
794
794
  setScaleMultiple(value);
795
795
  };
796
796
  const onTrialCountdownEnd = useMemoizedFn(() => {
797
- updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience', {
798
- buttonState: 2
799
- });
797
+ // updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience' as any, {
798
+ // buttonState: 2,
799
+ // });
800
+ refreshSmartImageQuality();
800
801
  });
801
802
  useEffect(() => {
802
803
  eventRef.current.on(startTimeToHideAllComponent, listenStart);
package/lib/ui/ui.less CHANGED
@@ -19,7 +19,7 @@
19
19
  bottom: 0;
20
20
  left: 0;
21
21
  right: 0;
22
- padding-top: 12px;
22
+ // padding-top: 12px;
23
23
  z-index: 90;
24
24
  height: 60px;
25
25
  background: linear-gradient(360deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
@@ -233,16 +233,16 @@
233
233
 
234
234
  // 左下角全屏子元素容器
235
235
  .bottom-left-item-full-container {
236
- padding: 0 24px !important;
236
+ padding: 0 12px !important;
237
237
  flex-shrink: 0;
238
238
  }
239
239
 
240
240
  .bottom-left-item-full-container:first-of-type {
241
- padding: 0 24px 0 16px !important;
241
+ padding: 0 12px 0 16px !important;
242
242
  }
243
243
 
244
244
  .bottom-left-item-full-container:last-of-type {
245
- padding: 0 0 0 24px !important;
245
+ padding: 0 0 0 12px !important;
246
246
  }
247
247
 
248
248
  .bottom-left-item-full-container:only-of-type {
@@ -1,13 +1,23 @@
1
+ @keyframes ipc-player-trial-badge-slide-in {
2
+ from {
3
+ transform: translateX(-100%);
4
+ }
5
+ to {
6
+ transform: translateX(0);
7
+ }
8
+ }
9
+
1
10
  .ipc-player-trial-badge {
2
11
  display: inline-flex;
3
12
  align-items: center;
4
- height: 40px;
13
+ height: 32px;
5
14
  padding: 0 6px 0 8px;
6
15
  border-radius: 8px;
7
16
  background: rgba(0, 0, 0, 0.65);
8
17
  flex-shrink: 0;
9
18
  vertical-align: middle;
10
19
  white-space: nowrap;
20
+ animation: ipc-player-trial-badge-slide-in 0.3s linear;
11
21
  }
12
22
 
13
23
  .ipc-player-trial-badge-icon {
@@ -1,6 +1,5 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
1
  import { useCallback, useEffect, useRef, useState } from 'react';
3
- import { getAIFrameFeature, setAIFrameFeature, setTrailFinish } from '../../utils/ttt';
2
+ import { setTrailFinish } from '../../utils/ttt';
4
3
  import { gotoSecurityCloudService2 } from '../../utils';
5
4
  import { trialCountdownEnd } from '../../ui/constant';
6
5
  import Strings from '../../i18n';
@@ -27,25 +26,21 @@ export const useTrialBadge = (event, devId, trialRemainingSec) => {
27
26
  }, [devId]);
28
27
  const handleCountdownEnd = useCallback(async () => {
29
28
  try {
30
- var _getAI$aiFrameFeature, _getAI$aiFrameFeature2, _getAI$aiFrameFeature3;
31
29
  setShowTrialBadge(false);
32
- event.emit(trialCountdownEnd);
33
- const getAI = await getAIFrameFeature(devId);
34
- const scope = _objectSpread(_objectSpread({}, (_getAI$aiFrameFeature = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature === void 0 ? void 0 : _getAI$aiFrameFeature.scope), {}, {
35
- inPreview: false
36
- });
37
- await setAIFrameFeature({
38
- devId,
39
- scene: 'inPreview',
40
- // 实时预览场景
41
- enabled: getAI.enabled,
42
- aiFrameFeature: {
43
- scope,
44
- feature: (_getAI$aiFrameFeature2 = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature2 === void 0 ? void 0 : _getAI$aiFrameFeature2.feature,
45
- exportEnabled: (_getAI$aiFrameFeature3 = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature3 === void 0 ? void 0 : _getAI$aiFrameFeature3.exportEnabled
46
- }
47
- });
30
+ // const getAI = await getAIFrameFeature(devId);
31
+ // const scope = { ...getAI.aiFrameFeature?.scope, inPreview: false };
32
+ // await setAIFrameFeature({
33
+ // devId,
34
+ // scene: 'inPreview', // 实时预览场景
35
+ // enabled: getAI.enabled,
36
+ // aiFrameFeature: {
37
+ // scope,
38
+ // feature: getAI.aiFrameFeature?.feature,
39
+ // exportEnabled: getAI.aiFrameFeature?.exportEnabled,
40
+ // },
41
+ // });
48
42
  await setTrailFinish(devId);
43
+ event.emit(trialCountdownEnd);
49
44
  } catch (error) {
50
45
  ty.showToast({
51
46
  title: Strings.getLang('ipc_player_fetch_error'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.35-beta.23",
3
+ "version": "0.0.35-beta.25",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [