@ray-js/ipc-player-integration 0.0.18-beta-1 → 0.0.18-beta-2

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 (2) hide show
  1. package/lib/ui/ui.js +28 -24
  2. package/package.json +1 -1
package/lib/ui/ui.js CHANGED
@@ -95,7 +95,29 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
95
95
  // const [verticalCoverZoom, setVerticalCoverZoom] = useState(-2);
96
96
  // const [verticalZoomLevel, setVerticalZoomLevel] = useState(playerFit === 'contain' ? 1 : -2);
97
97
 
98
+ const {
99
+ topLeftContent,
100
+ topRightContent,
101
+ bottomLeftContent,
102
+ bottomRightContent,
103
+ absoluteContent,
104
+ screenType,
105
+ playState,
106
+ resolution,
107
+ mute
108
+ } = useStore({
109
+ topLeftContent: instance.topLeftContent,
110
+ topRightContent: instance.topRightContent,
111
+ bottomLeftContent: instance.bottomLeftContent,
112
+ bottomRightContent: instance.bottomRightContent,
113
+ absoluteContent: instance.absoluteContent,
114
+ screenType: instance.screenType,
115
+ playState: instance.playState,
116
+ resolution: instance.resolution,
117
+ mute: instance.mute
118
+ });
98
119
  useEffect(() => {
120
+ // 首次进来强制为竖屏
99
121
  if (createCtx) {
100
122
  // 获取屏幕方向比例
101
123
  try {
@@ -170,10 +192,8 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
170
192
  const {
171
193
  type
172
194
  } = sizeData;
173
- console.log(type, 'type');
174
195
  console.log('监听到屏幕布局变化', type);
175
196
  const {
176
- platform,
177
197
  deviceType
178
198
  } = systemInfo.current;
179
199
  // 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
@@ -249,27 +269,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
249
269
  if (!systemInfo.current) {
250
270
  systemInfo.current = getSystemInfoSync();
251
271
  }
252
- const {
253
- topLeftContent,
254
- topRightContent,
255
- bottomLeftContent,
256
- bottomRightContent,
257
- absoluteContent,
258
- screenType,
259
- playState,
260
- resolution,
261
- mute
262
- } = useStore({
263
- topLeftContent: instance.topLeftContent,
264
- topRightContent: instance.topRightContent,
265
- bottomLeftContent: instance.bottomLeftContent,
266
- bottomRightContent: instance.bottomRightContent,
267
- absoluteContent: instance.absoluteContent,
268
- screenType: instance.screenType,
269
- playState: instance.playState,
270
- resolution: instance.resolution,
271
- mute: instance.mute
272
- });
273
272
 
274
273
  // 监听物理返回按键
275
274
  const hackHandle = () => {
@@ -388,7 +387,12 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
388
387
  if (hasPlayedRef.current) {
389
388
  setScaleMultiple(currentZoomLevel);
390
389
  }
391
- } else if (!hasPlayedRef.current) {
390
+ }
391
+ if (playState === PlayState.PLAYING) {
392
+ // 仅在第一次播放成功时,针对竖屏并且为cover模式时,设置为-2
393
+ if (screenType === 'vertical' && playerFit === 'cover' && !hasPlayedRef.current) {
394
+ setScaleMultiple(-2);
395
+ }
392
396
  hasPlayedRef.current = true;
393
397
  }
394
398
  setPlayState(playState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.18-beta-1",
3
+ "version": "0.0.18-beta-2",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [