On this page

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

ParameterTypeDescription
hideHorizontalMenuboolDefault false. Whether to hide the button for entering landscape mode
hideScreenShotMenuboolDefault false. Whether to hide the screenshot button
hideRecordVideoMenuboolWhether to hide the record button
directionControlPropsobjectProps received by the directional control component