@ray-js/ipc-player-integration 0.0.1-beta-64 → 0.0.1-beta-65
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.d.ts +1 -1
- package/lib/ui/ui.js +7 -7
- package/package.json +1 -1
package/lib/ui/ui.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ type Props = {
|
|
|
25
25
|
brandColor?: string;
|
|
26
26
|
verticalMic?: boolean;
|
|
27
27
|
landscapeMode?: 'fill' | 'standard';
|
|
28
|
-
|
|
28
|
+
playerFit: 'contain' | 'cover';
|
|
29
29
|
eventRef?: React.RefObject<EventInstance>;
|
|
30
30
|
onPlayerTap?: (data: any) => void;
|
|
31
31
|
extend?: Record<string, any>;
|
package/lib/ui/ui.js
CHANGED
|
@@ -52,7 +52,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
52
52
|
verticalMic = true,
|
|
53
53
|
eventRef: eventRefProp,
|
|
54
54
|
landscapeMode = 'standard',
|
|
55
|
-
|
|
55
|
+
playerFit = 'contain',
|
|
56
56
|
onPlayerTap,
|
|
57
57
|
extend = {}
|
|
58
58
|
} = props;
|
|
@@ -82,14 +82,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
82
82
|
}
|
|
83
83
|
useImperativeHandle(eventRefProp, () => eventRef.current, [eventRef.current]);
|
|
84
84
|
const timer = useRef();
|
|
85
|
-
const [scaleMultiple, setScaleMultiple] = useState(
|
|
86
|
-
const [currentZoomLevel, setCurrentZoomLevel] = useState(
|
|
85
|
+
const [scaleMultiple, setScaleMultiple] = useState(playerFit === 'contain' ? 1 : -2);
|
|
86
|
+
const [currentZoomLevel, setCurrentZoomLevel] = useState(playerFit === 'contain' ? 1 : -2);
|
|
87
87
|
|
|
88
88
|
// 监听playerMode的变化,更新scaleMultiple
|
|
89
89
|
useEffect(() => {
|
|
90
|
-
setScaleMultiple(
|
|
91
|
-
setCurrentZoomLevel(
|
|
92
|
-
}, [
|
|
90
|
+
setScaleMultiple(playerFit === 'contain' ? 1 : -2);
|
|
91
|
+
setCurrentZoomLevel(playerFit === 'contain' ? 1 : -2);
|
|
92
|
+
}, [playerFit]);
|
|
93
93
|
useEffect(() => {
|
|
94
94
|
setBrandColor(brandColor);
|
|
95
95
|
setVerticalMic(verticalMic);
|
|
@@ -127,7 +127,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
127
127
|
setScaleMultiple(-1);
|
|
128
128
|
} else {
|
|
129
129
|
// 将屏幕播放比例设为1
|
|
130
|
-
setScaleMultiple(
|
|
130
|
+
setScaleMultiple(playerFit === 'contain' ? 1 : -2);
|
|
131
131
|
}
|
|
132
132
|
} catch (err) {
|
|
133
133
|
console.log(err, 'err');
|