MediaControl

The MediaControl capability protocol serves to define the methods required for normalizing the control of media playback (play, pause, fast forward, etc) as well as obtaining media information (playhead position, duration, etc).

Methods

mediaControl.play ()

Send play command.

Related capabilities:
  • MediaControl.Play
Returns:
Command
mediaControl.pause ()

Send pause command.

Related capabilities:
  • MediaControl.Pause
Returns:
Command
mediaControl.stop ()

Send play command.

Related capabilities:
  • MediaControl.Stop
Returns:
Command
mediaControl.rewind ()

Send rewind command.

Related capabilities:
  • MediaControl.Rewind
Returns:
Command
mediaControl.fastForward ()

Send play command.

Related capabilities:
  • MediaControl.FastForward
Returns:
Command
mediaControl.seek (position)

Seeks to a new position within the current media item

Related capabilities:
  • MediaControl.Seek
Parameters:
  • position (number)

    Media seek position in seconds

Returns:
Command
mediaControl.getDuration ()

On success, the success event/callback will be fired with the arguments (duration)

  • duration: number – duration in seconds
Returns:
Command
mediaControl.getPosition ()

On success, the success event/callback will be fired with the arguments (position)

  • position: number – position in seconds
Returns:
Command
mediaControl.subscribePlayState ()

On success, the success event/callback will be fired with the arguments (playState)

  • playState: string – One of:
    • "unknown"
    • "idle"
    • "playing"
    • "paused"
    • "buffering"
    • "finished"
Returns:
Command