@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 +10 -13
- package/lib/ui/ui.less +2 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +10 -0
- package/package.json +1 -1
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('
|
|
130
|
+
console.log('setPageOrientation success');
|
|
131
131
|
},
|
|
132
132
|
fail: err => {
|
|
133
|
-
console.log('
|
|
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(
|
|
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
|
-
|
|
423
|
-
|
|
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:
|
|
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':
|
|
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
|
-
|
|
29
|
+
:root[theme='dark'] & {
|
|
30
30
|
background: #000;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
:root[theme='light'] & {
|
|
34
34
|
background: #fff;
|
|
35
35
|
--iconColor: #000;
|
|
36
36
|
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -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
|
*/
|