@ray-js/ipc-player-integration 0.0.18-beta-3 → 0.0.18-beta-4

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 +23 -1
  2. package/package.json +1 -1
package/lib/ui/ui.js CHANGED
@@ -126,8 +126,29 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
126
126
  const {
127
127
  orientation
128
128
  } = ty.getOrientationSync();
129
+ console.log(`同步获取屏幕方向: ${orientation}`);
129
130
  ipcTTTOperatorLog(`同步获取屏幕方向: ${orientation}`);
130
- setScreenType(orientation === 'landscape' ? 'full' : 'vertical');
131
+ if (['portrait', 'portrait-upside-down', 'landscape-left', 'landscape-right', 'landscape'].includes(orientation)) {
132
+ const {
133
+ deviceType
134
+ } = systemInfo.current;
135
+ if (deviceType === 'pad') {
136
+ setScreenType('vertical');
137
+ return;
138
+ }
139
+ const pageOrientation = orientation === 'landscape-left' || orientation === 'landscape-right' || orientation === 'landscape' ? 'landscape' : 'portrait';
140
+ setScreenType(pageOrientation === 'landscape' ? 'full' : 'vertical');
141
+ // 强制更改页面转向
142
+ setPageOrientation({
143
+ pageOrientation,
144
+ success: () => {
145
+ console.log('success');
146
+ },
147
+ fail: err => {
148
+ console.log('err', err);
149
+ }
150
+ });
151
+ }
131
152
  }
132
153
  } catch (e) {
133
154
  console.log('获取屏幕方向失败');
@@ -181,6 +202,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
181
202
  // 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
182
203
  if (deviceType === 'pad') {
183
204
  setScreenType('vertical');
205
+ return;
184
206
  }
185
207
  // 强制更改页面转向
186
208
  setPageOrientation({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.18-beta-3",
3
+ "version": "0.0.18-beta-4",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [