@ray-js/ipc-player-integration 0.0.29-beta.13 → 0.0.29-beta.15

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/lib/ui/ui.js CHANGED
@@ -20,6 +20,7 @@ import { useMemoizedFn } from '../hooks';
20
20
  import { Storage } from '../utils/storage';
21
21
  import './ui.less';
22
22
  import { updatePlayerWidgetProps } from '../features';
23
+ import { isSmallScreen } from '../utils';
23
24
  function getCtxInstance(instance, devId) {
24
25
  if (instance) return instance;
25
26
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -114,7 +115,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
114
115
  const {
115
116
  orientation
116
117
  } = data;
117
- console.log(orientation, 'orientation=-====');
118
118
  if (['portrait', 'landscape-left', 'landscape-right'].includes(orientation)) {
119
119
  var _ty;
120
120
  if (typeof ((_ty = ty) === null || _ty === void 0 ? void 0 : _ty.getDeviceOrientationSync) !== 'function') return;
@@ -122,15 +122,15 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
122
122
  // 不是Player首页的话,禁止以下行为
123
123
  return;
124
124
  }
125
- console.log('屏幕方向变化调用吗');
125
+ console.log('屏幕方向变化调用');
126
126
  setPageOrientation({
127
127
  pageOrientation: orientation === 'landscape-left' || orientation === 'landscape-right' ? 'landscape' : 'portrait',
128
128
  reverse: orientation === 'landscape-left',
129
129
  success: () => {
130
- console.log('set page orientation success');
130
+ console.log('setPageOrientation success');
131
131
  },
132
132
  fail: err => {
133
- console.log('set page orientation fail', err);
133
+ console.log('setPageOrientation fail', err);
134
134
  }
135
135
  });
136
136
  }
@@ -151,7 +151,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
151
151
  const {
152
152
  orientation
153
153
  } = ty.getDeviceOrientationSync();
154
- console.log(orientation, 'initial orientation');
154
+ console.log('initial orientation', orientation);
155
155
  if (orientation === 'landscape-left' || orientation === 'landscape-right') {
156
156
  setScreenType('full');
157
157
  }
@@ -419,12 +419,8 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
419
419
  const {
420
420
  type
421
421
  } = sizeData;
422
- console.log('监听到屏幕布局变化', type);
423
- const {
424
- deviceType
425
- } = getSystemInfoSync();
426
- // 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
427
- if (deviceType === 'pad') {
422
+ // 针对pad 和折叠屏展开的情况暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
423
+ if (isSmallScreen) {
428
424
  setScreenType('vertical');
429
425
  } else {
430
426
  setScreenType(type === 'landscape' ? 'full' : 'vertical');
@@ -739,6 +735,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
739
735
  return false;
740
736
  });
741
737
  const playerContainerHeight = screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh';
738
+ const isVerticalFullMode = isVerticalFullLayout && screenType === 'vertical';
742
739
  return /*#__PURE__*/React.createElement(UIEventContext.Provider, {
743
740
  value: {
744
741
  event: eventRef.current,
@@ -751,7 +748,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
751
748
  })
752
749
  }, /*#__PURE__*/React.createElement(View, {
753
750
  style: {
754
- height: isVerticalFullLayout ? `calc(${playerContainerHeight} - 48px)` : playerContainerHeight
751
+ height: isVerticalFullMode ? `calc(${playerContainerHeight} - 48px)` : playerContainerHeight
755
752
  }
756
753
  }, /*#__PURE__*/React.createElement(IPCPlayer, {
757
754
  defaultMute: mute,
@@ -835,7 +832,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
835
832
  className: clsx('ipc-player-bottom-content', {
836
833
  'ipc-player-bottom-content-hide': componentHideState,
837
834
  'ipc-player-bottom-content-show': !componentHideState,
838
- 'ipc-player-bottom-content-full': isVerticalFullLayout
835
+ 'ipc-player-bottom-content-full': isVerticalFullMode
839
836
  }),
840
837
  style: {
841
838
  height: screenType === 'vertical' ? '48px' : '72px'
package/lib/ui/ui.less CHANGED
@@ -26,11 +26,11 @@
26
26
  }
27
27
 
28
28
  .ipc-player-bottom-content-full {
29
- @media (prefers-color-scheme: dark) {
29
+ :root[theme='dark'] & {
30
30
  background: #000;
31
31
  }
32
32
 
33
- @media (prefers-color-scheme: light) {
33
+ :root[theme='light'] & {
34
34
  background: #fff;
35
35
  --iconColor: #000;
36
36
 
@@ -1,4 +1,5 @@
1
1
  /// <reference types="jest" />
2
+ export declare const isSmallScreen: boolean;
2
3
  /**
3
4
  * 麦克风对讲按钮径向渐变
4
5
  */
@@ -1,4 +1,14 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { getSystemInfoSync } from '@ray-js/ray';
3
+ const {
4
+ windowWidth,
5
+ screenWidth,
6
+ windowHeight
7
+ } = getSystemInfoSync();
8
+
9
+ // pad和折叠屏小窗口展示面板的情况
10
+ export const isSmallScreen = !(screenWidth === windowWidth || screenWidth === windowHeight);
11
+
2
12
  /**
3
13
  * 麦克风对讲按钮径向渐变
4
14
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.29-beta.13",
3
+ "version": "0.0.29-beta.15",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [