#initPlayerWidgets
Call this API to insert all implemented Widgets in the current component into the player.
type initPlayerWidgets = (instance, options: Options) => void#Usage
import { useEffect } from 'react'
import { useCtx, IPCPlayerIntegration, Features } from '@ray-js/ipc-player-integration';
import '@ray-js/ipc-player-integration/iconfont/iconfont.css';
function Page() {
const deviceId = '1234567890xxxxxx';
const instance = useCtx({
devId: deviceId,
});
useEffect(() => {
// Initialize widgets
// After calling this method, all widgets used in the current component will be added to the player
Features.initPlayerWidgets(instance, Options);
}, [])
return (
<IPCPlayerIntegration
instance={instance}
devId={deviceId}
/>
)
}#Options
| Parameter | Type | Description |
|---|---|---|
| hideHorizontalMenu | bool | Default false. Whether to hide the button for entering landscape mode |
| hideScreenShotMenu | bool | Default false. Whether to hide the screenshot button |
| hideRecordVideoMenu | bool | Whether to hide the record button |
| directionControlProps | object | Props received by the directional control component |