chromium/chromeos/crosapi/mojom/media_ui.mojom

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module crosapi.mojom;

import "components/global_media_controls/public/mojom/device_service.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";

// Allows the browser to communicate with the Global Media Controls UI in Ash.
//
// Next version: 2
// Next method ID: 2
[Stable, Uuid="110007a4-b1f2-4157-af23-58f98b7af71e"]
interface MediaUI {
  // Registers a DeviceService that can provide media device info and actions
  // to the UI. `id` corresponds to the source ID exposed by
  // media_session.mojom.MediaSession.
  RegisterDeviceService@0(
      mojo_base.mojom.UnguessableToken id,
      pending_remote<global_media_controls.mojom.DeviceService> service_remote);

  // Requests Ash to show a media playback device picker for the media item
  // represented by `item_id`.
  // `item_id` may come from media_session.mojom.AudioFocusRequestState for
  // local media, or media_router.mojom.MediaRoute for Cast media.
  [MinVersion=1]
  ShowDevicePicker@1(string item_id);
};