@ray-js/ipc-player-integration 0.0.9 → 0.0.11
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.
|
@@ -7,6 +7,7 @@ export declare function initPlayerWidgets(ctx: Ctx, options: {
|
|
|
7
7
|
hideHorizontalMenu?: boolean;
|
|
8
8
|
hideScreenShotMenu?: boolean;
|
|
9
9
|
hideRecordVideoMenu?: boolean;
|
|
10
|
+
hideKbsMenu?: boolean;
|
|
10
11
|
directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
|
|
11
12
|
}): Promise<void>;
|
|
12
13
|
export {};
|
|
@@ -5,8 +5,15 @@ import { MoveInteractiveControlButton } from '../../widgets/moveInteractiveContr
|
|
|
5
5
|
// 根据当前 dp 信息决定设置哪些 plugin
|
|
6
6
|
export async function initPlayerWidgets(ctx, options) {
|
|
7
7
|
ctx.addContent('topLeft', defaultTopLeftContent);
|
|
8
|
-
ctx.addContent('topRight', defaultTopRightContent);
|
|
9
8
|
const newDefaultBottomLeftContent = _cloneDeep(defaultBottomLeftContent);
|
|
9
|
+
const newDefaultTopRightContent = _cloneDeep(defaultTopRightContent);
|
|
10
|
+
const videoKbsIndex = newDefaultTopRightContent.findIndex(item => item.id === 'VideoBitKBP');
|
|
11
|
+
if (videoKbsIndex !== -1) {
|
|
12
|
+
newDefaultTopRightContent[videoKbsIndex].initProps = {
|
|
13
|
+
hideKbsMenu: options.hideKbsMenu
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
ctx.addContent('topRight', newDefaultTopRightContent);
|
|
10
17
|
const resolutionIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Resolution');
|
|
11
18
|
const screenShotIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Screenshot');
|
|
12
19
|
const recordVideoIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'RecordVideo');
|
package/lib/ui/ui.js
CHANGED
|
@@ -98,7 +98,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
98
98
|
useEffect(() => {
|
|
99
99
|
setBrandColor(brandColor);
|
|
100
100
|
setVerticalMic(verticalMic);
|
|
101
|
-
}, []);
|
|
101
|
+
}, [brandColor, verticalMic]);
|
|
102
102
|
const refreshBottomLeft = () => {
|
|
103
103
|
event.current.emit(startTimeToHideAllComponent);
|
|
104
104
|
event.current.emit(showAllComponent);
|
|
@@ -3,6 +3,7 @@ import { ComponentConfigProps } from '../../interface';
|
|
|
3
3
|
import './videoBitKBP.less';
|
|
4
4
|
type Props = ComponentConfigProps & {
|
|
5
5
|
className?: string;
|
|
6
|
+
hideKbsMenu?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const VideoBitKBP: (props: Props) => React.JSX.Element | null;
|
|
8
9
|
export {};
|
|
@@ -9,7 +9,8 @@ export const VideoBitKBP = props => {
|
|
|
9
9
|
const {
|
|
10
10
|
devId,
|
|
11
11
|
playState,
|
|
12
|
-
className
|
|
12
|
+
className,
|
|
13
|
+
hideKbsMenu
|
|
13
14
|
} = props;
|
|
14
15
|
const [bitKBP, setBitKBP] = useState('');
|
|
15
16
|
const store = useStore({
|
|
@@ -17,7 +18,7 @@ export const VideoBitKBP = props => {
|
|
|
17
18
|
});
|
|
18
19
|
const timerRef = useRef();
|
|
19
20
|
useEffect(() => {
|
|
20
|
-
if (store.playState === PlayState.PLAYING) {
|
|
21
|
+
if (store.playState === PlayState.PLAYING && !hideKbsMenu) {
|
|
21
22
|
init();
|
|
22
23
|
timerRef.current = setInterval(() => {
|
|
23
24
|
init();
|
|
@@ -28,7 +29,7 @@ export const VideoBitKBP = props => {
|
|
|
28
29
|
return () => {
|
|
29
30
|
clearInterval(timerRef.current);
|
|
30
31
|
};
|
|
31
|
-
}, [store.playState]);
|
|
32
|
+
}, [store.playState, hideKbsMenu]);
|
|
32
33
|
usePageEvent('onUnload', () => {
|
|
33
34
|
clearInterval(timerRef.current);
|
|
34
35
|
});
|
|
@@ -41,6 +42,7 @@ export const VideoBitKBP = props => {
|
|
|
41
42
|
if (bitKBP === '' || bitKBP === '0KB/S' || store.playState !== PlayState.PLAYING) {
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
45
|
+
if (hideKbsMenu) return null;
|
|
44
46
|
return /*#__PURE__*/React.createElement(View, {
|
|
45
47
|
className: clsx({
|
|
46
48
|
'ipc-player-plugin-videoBitKBP-container': true,
|