Interface IMediaControlServerAsync
interface IMediaControlServerAsync
Extends com.amazon.apmf.IStandard
Interface for media control server operations.
Methods
setHandlerForComponent()
Assigns a handler to process requests for media control actions associated with a given component. Assigning a handler is essential for processing media control requests and implementing custom media control logic. This call allows one handler per component. The active handler is the one set by the last invocation to setHandler.voidsetHandlerForComponent(IMediaControlHandlerAsync*handler,com.amazon.kepler.runtime.IComponentInstance*component)
Parameters
handler
IMediaControlHandlerAsync* — Required
The instance to invoke when media control requests arrive.
component
com.amazon.kepler.runtime.IComponentInstance* — Required
The component instance to associate with the given handler, obtained from component
lifecycle functions like onStart.
updateMediaSessionStates()
Notifies interested clients about media session state updates. Updating the server session states is crucial for reflecting changes in media playback status, currently selected media, and other related information. When applicable, a media control server is expected to issue session state updates upon acting on a media control request received through the installed [IMediaControlHandlerAsync] instance.voidupdateMediaSessionStates(MediaSessionState*[]states)
Parameters
states
MediaSessionState*[] — Required
The media session states that have been updated. The list can contain one or more media session states.

