MediaControl

com.connectsdk.service.capability.MediaControl

extends CapabilityMethods

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).

Properties

final String Any = “MediaControl.Any”

final String Play = “MediaControl.Play”

final String Pause = “MediaControl.Pause”

final String Stop = “MediaControl.Stop”

final String Rewind = “MediaControl.Rewind”

final String FastForward = “MediaControl.FastForward”

final String Seek = “MediaControl.Seek”

final String Duration = “MediaControl.Duration”

final String PlayState = “MediaControl.PlayState”

final String PlayState_Subscribe = “MediaControl.PlayState.Subscribe”

final String Position = “MediaControl.Position”

final String Previous = “MediaControl.Previous”
This capability is deprecated. Use PlaylistControl.Previous instead.
final String Next = “MediaControl.Next”
This capability is deprecated. Use PlaylistControl.Next instead.

final int PLAYER_STATE_UNKNOWN = 0

final int PLAYER_STATE_IDLE = 1

final int PLAYER_STATE_PLAYING = 2

final int PLAYER_STATE_PAUSED = 3

final int PLAYER_STATE_BUFFERING = 4

final String[] Capabilities = { Play, Pause, Stop, Rewind, FastForward, Seek,

Methods

MediaControl getMediaControl ()

Get MediaControl implementation

Returns: MediaControl

CapabilityPriorityLevel getMediaControlCapabilityLevel ()

Get a capability priority for current implementation

Returns: CapabilityPriorityLevel

void play (ResponseListener <Object> listener)

Send play command.

Related capabilities:

  • MediaControl.Play

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void pause (ResponseListener <Object> listener)

Send pause command.

Related capabilities:

  • MediaControl.Pause

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void stop (ResponseListener <Object> listener)

Send play command.

Related capabilities:

  • MediaControl.Stop

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void rewind (ResponseListener <Object> listener)

Send rewind command.

Related capabilities:

  • MediaControl.Rewind

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void fastForward (ResponseListener <Object> listener)

Send play command.

Related capabilities:

  • MediaControl.FastForward

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void previous (ResponseListener <Object> listener)

This method is deprecated. Use PlaylistControl::previous(ResponseListener<Object> listener) instead.

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void next (ResponseListener <Object> listener)

This method is deprecated. Use PlaylistControl::next(ResponseListener<Object> listener) instead.

Parameters:

  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void seek (long position, ResponseListener <Object> listener)

Seeks to a new position within the current media item

Related capabilities:

  • MediaControl.Seek

Parameters:

  • position – The new position, in milliseconds from the beginning of the stream
  • listener – (optional) ResponseListener< Object > with methods to be called on success or failure
void getDuration (DurationListener listener)

Get the current media duration in milliseconds

Parameters:

  • listener – (optional) DurationListener with methods to be called on success or failure
void getPosition (PositionListener listener)

Get the current playback position in milliseconds

Parameters:

  • listener – (optional) PositionListener with methods to be called on success or failure
void getPlayState (PlayStateListener listener)

Get the current state of playback

Parameters:

  • listener – (optional) PlayStateListener with methods to be called on success or failure
ServiceSubscription <PlayStateListener> subscribePlayState (PlayStateListener listener)

Subscribe for playback state changes

Parameters:

  • listener – receives play state notifications

Returns: ServiceSubscription<PlayStateListener>