Commit 2a8e12a8 authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Provide an ApplicationController.GetMediaPlayer() API.

Allow media playback in CastComponents to be controlled by the owning
Agent.

Bug: 879317
Change-Id: I6a744faa0b236f3a856d5c4aa0b9f0846f6970ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2130546
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756346}
parent c5894b41
...@@ -20,6 +20,7 @@ fidl_library("cast_fidl") { ...@@ -20,6 +20,7 @@ fidl_library("cast_fidl") {
] ]
public_deps = [ public_deps = [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.media.sessions2",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.gfx", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.gfx",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web",
] ]
......
...@@ -4,9 +4,14 @@ ...@@ -4,9 +4,14 @@
library chromium.cast; library chromium.cast;
using fuchsia.media.sessions2;
/// Allows clients to access and modify certain aspects of the Cast receiver /// Allows clients to access and modify certain aspects of the Cast receiver
/// application runtime. /// application runtime.
protocol ApplicationController { protocol ApplicationController {
/// Enables or disables touch event processing. /// Enables or disables touch event processing.
SetTouchInputEnabled(bool enable); SetTouchInputEnabled(bool enable);
/// Connects to the application's media control & observation API.
GetMediaPlayer(request<fuchsia.media.sessions2.Player> request);
}; };
...@@ -31,3 +31,8 @@ void ApplicationControllerImpl::SetTouchInputEnabled(bool enable) { ...@@ -31,3 +31,8 @@ void ApplicationControllerImpl::SetTouchInputEnabled(bool enable) {
(enable ? fuchsia::web::AllowInputState::ALLOW (enable ? fuchsia::web::AllowInputState::ALLOW
: fuchsia::web::AllowInputState::DENY)); : fuchsia::web::AllowInputState::DENY));
} }
void ApplicationControllerImpl::GetMediaPlayer(
fidl::InterfaceRequest<fuchsia::media::sessions2::Player> request) {
frame_->GetMediaPlayer(std::move(request));
}
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
#ifndef FUCHSIA_RUNNERS_CAST_APPLICATION_CONTROLLER_IMPL_H_ #ifndef FUCHSIA_RUNNERS_CAST_APPLICATION_CONTROLLER_IMPL_H_
#define FUCHSIA_RUNNERS_CAST_APPLICATION_CONTROLLER_IMPL_H_ #define FUCHSIA_RUNNERS_CAST_APPLICATION_CONTROLLER_IMPL_H_
#include <fuchsia/media/sessions2/cpp/fidl.h>
#include <fuchsia/web/cpp/fidl.h> #include <fuchsia/web/cpp/fidl.h>
#include <lib/fidl/cpp/binding.h> #include <lib/fidl/cpp/binding.h>
#include <lib/fidl/cpp/interface_request.h>
#include "base/macros.h" #include "base/macros.h"
#include "fuchsia/fidl/chromium/cast/cpp/fidl.h" #include "fuchsia/fidl/chromium/cast/cpp/fidl.h"
...@@ -19,7 +21,10 @@ class ApplicationControllerImpl : public chromium::cast::ApplicationController { ...@@ -19,7 +21,10 @@ class ApplicationControllerImpl : public chromium::cast::ApplicationController {
~ApplicationControllerImpl() final; ~ApplicationControllerImpl() final;
protected: protected:
void SetTouchInputEnabled(bool enable) override; void SetTouchInputEnabled(bool enable) final;
void GetMediaPlayer(
::fidl::InterfaceRequest<fuchsia::media::sessions2::Player> request)
final;
private: private:
fidl::Binding<chromium::cast::ApplicationController> binding_; fidl::Binding<chromium::cast::ApplicationController> binding_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment