Media Session Service

Fuchsia's Media Session Service mediates access between media players which choose to publish “media sessions” (from here on referred to as “sessions”) and other components of the system which want to observe or control those sessions, such as a “Now Playing” UI, a remote control, or a system media policy enforcer.

Rendered Docs

  • FIDL
  • Dart // TODO(turnage): Add link when Fuchsia dart docs come up.
  • Rust


A system service, the media session registry service (here on, Registry Service), exposes two FIDL protocols: Publisher and Discovery.

Media players publish themselves over the Publisher protocol. Clients interested in discovering ongoing media sessions on the system do so through the Discovery protocol.


          |        Registry Service       |

Players ----> | Publisher | | | | | | Discovery | <---- “Now Playing” UI, etc |===============================|

Example Use Case: A “Now Playing” UI

A client can watch for updates to all sessions using Discovery.WatchSessions.

let discovery_proxy = connect_to_protocol::<DiscoveryMarker>()?;
let (session_watcher, session_watcher_request) = create_endpoints()?;
let session_watcher_proxy = session_watcher.into_proxy()?;

let watcher = discovery_proxy.watch_sessions(

loop {
    let sessions_reply_future = session_watcher_proxy.watch_sessions()?;
    let sessions = await!(sessions_reply_future)?;
    for session in sessions {

Publishing a Player

Players must implement Player and publish themselves once with Publisher.Publish.

let (player_client_end, player_server_end) = create_endpoints()?;
let publisher_proxy = connect_to_protocol::<PublisherMarker>()?;


publisher_proxy.publish(player_client_end, PlayerRegistration {
    domain: Some(PLAYER_DOMAIN),