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, Inner Classes ------------- * :doc:`DurationListener ` * :doc:`PlayStateListener ` * :doc:`PlayStateStatus ` * :doc:`PositionListener ` Methods ------- :doc:`MediaControl ` **getMediaControl** () Get MediaControl implementation **Returns:** MediaControl :doc:`CapabilityPriorityLevel ` **getMediaControlCapabilityLevel** () Get a capability priority for current implementation **Returns:** CapabilityPriorityLevel void **play** (:doc:`ResponseListener ` *listener*) Send play command. **Related capabilities:** * ``MediaControl.Play`` **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **pause** (:doc:`ResponseListener ` *listener*) Send pause command. **Related capabilities:** * ``MediaControl.Pause`` **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **stop** (:doc:`ResponseListener ` *listener*) Send play command. **Related capabilities:** * ``MediaControl.Stop`` **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **rewind** (:doc:`ResponseListener ` *listener*) Send rewind command. **Related capabilities:** * ``MediaControl.Rewind`` **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **fastForward** (:doc:`ResponseListener ` *listener*) Send play command. **Related capabilities:** * ``MediaControl.FastForward`` **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **previous** (:doc:`ResponseListener ` *listener*) This method is deprecated. Use ``PlaylistControl::previous(ResponseListener listener)`` instead. **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **next** (:doc:`ResponseListener ` *listener*) This method is deprecated. Use ``PlaylistControl::next(ResponseListener listener)`` instead. **Parameters:** * listener – (optional) ResponseListener< Object > with methods to be called on success or failure void **seek** (long *position*, :doc:`ResponseListener ` *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** (:doc:`DurationListener ` *listener*) Get the current media duration in milliseconds **Parameters:** * listener – (optional) DurationListener with methods to be called on success or failure void **getPosition** (:doc:`PositionListener ` *listener*) Get the current playback position in milliseconds **Parameters:** * listener – (optional) PositionListener with methods to be called on success or failure void **getPlayState** (:doc:`PlayStateListener ` *listener*) Get the current state of playback **Parameters:** * listener – (optional) PlayStateListener with methods to be called on success or failure :doc:`ServiceSubscription ` <:doc:`PlayStateListener `> **subscribePlayState** (:doc:`PlayStateListener ` *listener*) Subscribe for playback state changes **Parameters:** * listener – receives play state notifications **Returns:** ServiceSubscription