fuchsia.media.sessions2

PROTOCOLS

SessionControl

Defined in fuchsia.media.sessions2/discovery.fidl

A protocol for clients to control sessions and view their status.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

SessionsWatcher

Defined in fuchsia.media.sessions2/discovery.fidl

SessionsWatcher watches the collection of published sessions.

SessionUpdated

Called by the registry service when a session is updated. On first connection, this will be called as many times as needed to communicate the state of the world.

SessionsWatchers must reply to acknlowledge receipt of the session info delta. Delinquent watchers who do not reply will eventually be disconnected.

Request

NameType
session_id uint64
session_info_delta SessionInfoDelta

Response

NameType

SessionRemoved

Called by the registry service when a session is removed from the registered collection.

SessionsWatchers must reply to acknlowledge receipt of the session removal. Delinquent watchers who do not reply will eventually be disconnected.

Request

NameType
session_id uint64

Response

NameType

Discovery

Defined in fuchsia.media.sessions2/discovery.fidl

Discovery observes the collection of published media sessions and connects clients to them.

WatchSessions

Connects a session watcher configured with the given options.

Request

NameType
watch_options WatchOptions
session_watcher SessionsWatcher

ConnectToSession

Connects to a SessionControl for session_id if present. Drops the given channel otherwise.

Request

NameType
session_id uint64
session_control_request request<SessionControl>

PlayerControl

Defined in fuchsia.media.sessions2/player.fidl

Controls for a media player.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

Player

Defined in fuchsia.media.sessions2/player.fidl

Player is a handle for a media player. Unsupported commands are no-ops. Consult PlaybackCapabilities, sent by to learn which commands are supported.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

WatchInfoChange

Leave hanging to receive a response when the player's status changes.

Request

NameType

Response

NameType
player_info_delta PlayerInfoDelta

Publisher

Defined in fuchsia.media.sessions2/publisher.fidl

Publisher publishes media players so they may be discovered and controlled by clients who have permission to do so.

PublishPlayer

Request

NameType
player Player
registration PlayerRegistration

SessionControl

Defined in fuchsia.media.sessions2/discovery.fidl

A protocol for clients to control sessions and view their status.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

SessionsWatcher

Defined in fuchsia.media.sessions2/discovery.fidl

SessionsWatcher watches the collection of published sessions.

SessionUpdated

Called by the registry service when a session is updated. On first connection, this will be called as many times as needed to communicate the state of the world.

SessionsWatchers must reply to acknlowledge receipt of the session info delta. Delinquent watchers who do not reply will eventually be disconnected.

Request

NameType
session_id uint64
session_info_delta SessionInfoDelta

Response

NameType

SessionRemoved

Called by the registry service when a session is removed from the registered collection.

SessionsWatchers must reply to acknlowledge receipt of the session removal. Delinquent watchers who do not reply will eventually be disconnected.

Request

NameType
session_id uint64

Response

NameType

Discovery

Defined in fuchsia.media.sessions2/discovery.fidl

Discovery observes the collection of published media sessions and connects clients to them.

WatchSessions

Connects a session watcher configured with the given options.

Request

NameType
watch_options WatchOptions
session_watcher SessionsWatcher

ConnectToSession

Connects to a SessionControl for session_id if present. Drops the given channel otherwise.

Request

NameType
session_id uint64
session_control_request request<SessionControl>

PlayerControl

Defined in fuchsia.media.sessions2/player.fidl

Controls for a media player.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

Player

Defined in fuchsia.media.sessions2/player.fidl

Player is a handle for a media player. Unsupported commands are no-ops. Consult PlaybackCapabilities, sent by to learn which commands are supported.

Play

Plays media.

Request

NameType

Pause

Pauses playback and retains position in media

Request

NameType

Stop

Stops playback. The session should close.

Request

NameType

Seek

Seeks to a specific position in media. Implementations are free to enter an error state if the position is out of bounds. position is an offset from the beginning of the media.

Request

NameType
position int64

SkipForward

Skips forward in media by the player's default skip amount.

Request

NameType

SkipReverse

Skips in reverse in media by the player's default skip amount.

Request

NameType

NextItem

Changes media to the next item (e.g. next song in playlist).

Request

NameType

PrevItem

Changes media to the previous item.

Request

NameType

SetPlaybackRate

Sets the playback rate of the media. This will not change the playback mode.

Request

NameType
playback_rate float32

SetRepeatMode

Sets repeat mode to any of the supported repeat modes.

Request

NameType
repeat_mode RepeatMode

SetShuffleMode

Sets shuffle mode.

Request

NameType
shuffle_on bool

BindGainControl

Binds to the session's gain control for control and notifications.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

WatchInfoChange

Leave hanging to receive a response when the player's status changes.

Request

NameType

Response

NameType
player_info_delta PlayerInfoDelta

Publisher

Defined in fuchsia.media.sessions2/publisher.fidl

Publisher publishes media players so they may be discovered and controlled by clients who have permission to do so.

PublishPlayer

Request

NameType
player Player
registration PlayerRegistration

STRUCTS

ImageSizeVariant

Defined in fuchsia.media.sessions2/images.fidl

A variant of an image at a specific size.

NameTypeDescriptionDefault
url string[1000] No default
width uint32 No default
height uint32 No default

ImageSizeVariant

Defined in fuchsia.media.sessions2/images.fidl

A variant of an image at a specific size.

NameTypeDescriptionDefault
url string[1000] No default
width uint32 No default
height uint32 No default

ENUMS

MediaImageType

Type: uint32

Defined in fuchsia.media.sessions2/images.fidl

NameValueDescription
ARTWORK 0
SOURCE_ICON 1

ContentType

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

The type of content playing back, which should be set to the largest applicable value.

NameValueDescription
OTHER 1
AUDIO 2
VIDEO 3
MUSIC 4
TV_SHOW 5
MOVIE 6

PlayerState

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

State of a media player.

NameValueDescription
IDLE 0
PLAYING 1
PAUSED 2
BUFFERING 3
ERROR 4

Error

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

NameValueDescription
OTHER 1

RepeatMode

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

Modes of repeating playback of the current media.

NameValueDescription
OFF 0
GROUP 1
SINGLE 2

MediaImageType

Type: uint32

Defined in fuchsia.media.sessions2/images.fidl

NameValueDescription
ARTWORK 0
SOURCE_ICON 1

ContentType

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

The type of content playing back, which should be set to the largest applicable value.

NameValueDescription
OTHER 1
AUDIO 2
VIDEO 3
MUSIC 4
TV_SHOW 5
MOVIE 6

PlayerState

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

State of a media player.

NameValueDescription
IDLE 0
PLAYING 1
PAUSED 2
BUFFERING 3
ERROR 4

Error

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

NameValueDescription
OTHER 1

RepeatMode

Type: uint32

Defined in fuchsia.media.sessions2/player.fidl

Modes of repeating playback of the current media.

NameValueDescription
OFF 0
GROUP 1
SINGLE 2

TABLES

SessionInfoDelta

Defined in fuchsia.media.sessions2/discovery.fidl

SessionInfoDelta holds a description of a given session. The first time a client receives this, it is a state of the world. On successive receipts of this table, only the changed fields will be present (this property is not recursive; top-level fields if set are snapshots).

OrdinalNameTypeDescription
1 domain string[1000] The domain on which the session takes place. A domain identifies a set of mutually compatable media targets and sessions; sessions on a domain may be played back on targets of the same domain.
2 is_local bool Whether the entry point for the media into our device network is the local machine; this should be true if this is the device streaming from a music service, but false if this machine is just receiving an audio stream to act as a speaker.
3 is_locally_active bool If this is set, the playback is taking place local to the device. Playing on the device speaker is local, playing on a remote speaker is not. This is only set when the session is playing back; a paused session is not active.
4 player_status PlayerStatus
5 metadata fuchsia.media/Metadata
6 media_images vector<MediaImage>
7 player_capabilities PlayerCapabilities

WatchOptions

Defined in fuchsia.media.sessions2/discovery.fidl

OrdinalNameTypeDescription
1 only_active bool Watch only the active session. Watches all if not set.

MediaImage

Defined in fuchsia.media.sessions2/images.fidl

An image for playing media.

OrdinalNameTypeDescription
1 image_type MediaImageType
2 sizes vector<ImageSizeVariant>[16] Available variants of the image.

PlayerStatus

Defined in fuchsia.media.sessions2/player.fidl

Status of a media player.

OrdinalNameTypeDescription
1 duration int64 Total duration of playing media. Omitted if not known or not applicable.
2 player_state PlayerState
3 timeline_function fuchsia.media/TimelineFunction A playback function that describes the position and rate of play through the media as a function of `CLOCK_MONOTONIC`.
4 repeat_mode RepeatMode
5 shuffle_on bool
6 content_type ContentType The type of content playing back. Omitted if it is not a first class category.
7 error Error

PlayerCapabilities

Defined in fuchsia.media.sessions2/player.fidl

PlaybackCapabilities enumerates the capabilities of a media player, and corresponds to the control commands it can execute.

OrdinalNameTypeDescription
1 flags PlayerCapabilityFlags

PlayerInfoDelta

Defined in fuchsia.media.sessions2/player.fidl

When emitted, fields that have changed should be set. The first emission to a new client should be a snapshot.

OrdinalNameTypeDescription
1 local bool Whether the entry point for the media into our device network is the local machine; this should be true if this is the device streaming from a music service, but false or omitted if this machine is just receiving an audio stream to act as a speaker.
2 player_status PlayerStatus
3 metadata fuchsia.media/Metadata
4 media_images vector<MediaImage>[16]
5 player_capabilities PlayerCapabilities

PlayerRegistration

Defined in fuchsia.media.sessions2/publisher.fidl

All information required by the media session registry service to register a player so that clients may observe its status and control it.

OrdinalNameTypeDescription
1 domain string[1000] The domain on which the player exists. Unset if it is the native Fuchsia domain.

SessionInfoDelta

Defined in fuchsia.media.sessions2/discovery.fidl

SessionInfoDelta holds a description of a given session. The first time a client receives this, it is a state of the world. On successive receipts of this table, only the changed fields will be present (this property is not recursive; top-level fields if set are snapshots).

OrdinalNameTypeDescription
1 domain string[1000] The domain on which the session takes place. A domain identifies a set of mutually compatable media targets and sessions; sessions on a domain may be played back on targets of the same domain.
2 is_local bool Whether the entry point for the media into our device network is the local machine; this should be true if this is the device streaming from a music service, but false if this machine is just receiving an audio stream to act as a speaker.
3 is_locally_active bool If this is set, the playback is taking place local to the device. Playing on the device speaker is local, playing on a remote speaker is not. This is only set when the session is playing back; a paused session is not active.
4 player_status PlayerStatus
5 metadata fuchsia.media/Metadata
6 media_images vector<MediaImage>
7 player_capabilities PlayerCapabilities

WatchOptions

Defined in fuchsia.media.sessions2/discovery.fidl

OrdinalNameTypeDescription
1 only_active bool Watch only the active session. Watches all if not set.

MediaImage

Defined in fuchsia.media.sessions2/images.fidl

An image for playing media.

OrdinalNameTypeDescription
1 image_type MediaImageType
2 sizes vector<ImageSizeVariant>[16] Available variants of the image.

PlayerStatus

Defined in fuchsia.media.sessions2/player.fidl

Status of a media player.

OrdinalNameTypeDescription
1 duration int64 Total duration of playing media. Omitted if not known or not applicable.
2 player_state PlayerState
3 timeline_function fuchsia.media/TimelineFunction A playback function that describes the position and rate of play through the media as a function of `CLOCK_MONOTONIC`.
4 repeat_mode RepeatMode
5 shuffle_on bool
6 content_type ContentType The type of content playing back. Omitted if it is not a first class category.
7 error Error

PlayerCapabilities

Defined in fuchsia.media.sessions2/player.fidl

PlaybackCapabilities enumerates the capabilities of a media player, and corresponds to the control commands it can execute.

OrdinalNameTypeDescription
1 flags PlayerCapabilityFlags

PlayerInfoDelta

Defined in fuchsia.media.sessions2/player.fidl

When emitted, fields that have changed should be set. The first emission to a new client should be a snapshot.

OrdinalNameTypeDescription
1 local bool Whether the entry point for the media into our device network is the local machine; this should be true if this is the device streaming from a music service, but false or omitted if this machine is just receiving an audio stream to act as a speaker.
2 player_status PlayerStatus
3 metadata fuchsia.media/Metadata
4 media_images vector<MediaImage>[16]
5 player_capabilities PlayerCapabilities

PlayerRegistration

Defined in fuchsia.media.sessions2/publisher.fidl

All information required by the media session registry service to register a player so that clients may observe its status and control it.

OrdinalNameTypeDescription
1 domain string[1000] The domain on which the player exists. Unset if it is the native Fuchsia domain.

BITS

PlayerCapabilityFlags

Type: uint32

NameValueDescription
PLAY 1 If set, the player can `Play()`.
PAUSE 4 If set, the player can `Pause()`.
SEEK 8 If set, the player can `Seek()`.
SKIP_FORWARD 16 If set, the player can `SkipForward()`.
SKIP_REVERSE 32 If set, the player can `SkipReverse()`.
SHUFFLE 64 If set, the player can shuffle media.
CHANGE_TO_NEXT_ITEM 128
CHANGE_TO_PREV_ITEM 256
HAS_GAIN_CONTROL 512 If set, the player can `BindGainControl()`.
REPEAT_GROUPS 1024 If set, the player can repeat groups.
REPEAT_SINGLE 2048 If set, the player can repeat single media items.

PlayerCapabilityFlags

Type: uint32

NameValueDescription
PLAY 1 If set, the player can `Play()`.
PAUSE 4 If set, the player can `Pause()`.
SEEK 8 If set, the player can `Seek()`.
SKIP_FORWARD 16 If set, the player can `SkipForward()`.
SKIP_REVERSE 32 If set, the player can `SkipReverse()`.
SHUFFLE 64 If set, the player can shuffle media.
CHANGE_TO_NEXT_ITEM 128
CHANGE_TO_PREV_ITEM 256
HAS_GAIN_CONTROL 512 If set, the player can `BindGainControl()`.
REPEAT_GROUPS 1024 If set, the player can repeat groups.
REPEAT_SINGLE 2048 If set, the player can repeat single media items.