Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RemoteControl<SS>

This component allows the user to control the preview stream's playback and playback position, acting as a remote control for the preview player.

param

Document ID of the current session

param

Current status of the preview player

param

Callback for clearing the current session

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

props

props: Readonly<object> & Readonly<RemoteControlProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<RemoteControlState>

Private timecodeBox

timecodeBox: Nullable<HTMLDivElement>

Private timerInterval

timerInterval: number

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<RemoteControlProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void
  • Invoked after the component is mounted first. Creates an interval timer which updates the the timecode every 10ms.

    Returns void

Optional componentDidUpdate

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<RemoteControlProps>, nextContext: any): void

componentWillUnmount

  • componentWillUnmount(): void
  • Invoked after the component is unmounted. Cancels the interval timer which updates the the timecode.

    Returns void

Optional componentWillUpdate

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

render

  • render(): Element
  • Renders the component

    Returns Element

Private renderSettingsModal

  • renderSettingsModal(): undefined | ReactPortal
  • Renders the settings modal if the corresponding state variable is set.

    Returns undefined | ReactPortal

Private renderTimestamp

  • renderTimestamp(): string
  • Converts a timestamp given in seconds into a timecode to be displayed on the UI in the format 00:00:00.000. If the timer hasn't been initialised yet, the timecode is returned containing dashes instead of the numbers, like so --:--:--.---.

    Returns string

    A timecode based on the current position in the stream

Private seekBy

  • seekBy(value: number): void
  • Sends a control command to the server to seek the stream by the given amount of seconds.

    Parameters

    • value: number

      Number of seconds to seek the stream by

    Returns void

Private sendControlCommand

  • Sends a command to the remote control endpoint of the API for the document that the current session is attached to. Possible commands are:

    • { adjust: n } for adjusting the playback position
    • { playing: true/false } for starting stopping playback
    • { showdirty: true/false} for toggling between clean and dirty feed

    Parameters

    Returns Promise<void>

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof RemoteControlState

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

Private toggleGuideFeed

  • toggleGuideFeed(): void
  • Toggles between clean and dirty feed by sending the corresponding command to the server.

    Returns void

Private togglePlayback

  • togglePlayback(): void
  • Toggles playback state by sending the corresponding command to the server.

    Returns void

Private toggleTimecodePopup

  • toggleTimecodePopup(): void
  • Renders the timecode popup if the corresponding state variable is set.

    Returns void

Private updateOffset

  • updateOffset(timeOffset: number): void
  • Adjusts the time offset of the clock by the given value.

    Parameters

    • timeOffset: number

      Offset in seconds to add to the timestamp

    Returns void

Static getDerivedStateFromProps

Generated using TypeDoc