OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.content.browser; |
| 6 |
| 7 import org.chromium.content_public.common.MediaMetadata; |
| 8 |
| 9 /** |
| 10 * Java MediaSessionObserver. The observer is proxied via Java ChromeMediaSessio
n and does not have |
| 11 * a native counterpart. |
| 12 */ |
| 13 public class MediaSessionObserver { |
| 14 // The observed MediaSession. |
| 15 private ChromeMediaSession mSession; |
| 16 |
| 17 /** |
| 18 * Create a MediaSessionObserver observing |session|. |
| 19 */ |
| 20 public MediaSessionObserver(ChromeMediaSession session) { |
| 21 session.addObserver(this); |
| 22 mSession = session; |
| 23 } |
| 24 |
| 25 /** |
| 26 * Get the observed MediaSession. |
| 27 */ |
| 28 public final ChromeMediaSession getSession() { |
| 29 return mSession; |
| 30 } |
| 31 |
| 32 /** |
| 33 * Called when MediaSession is destroyed. |
| 34 */ |
| 35 public void mediaSessionDestroyed() {} |
| 36 |
| 37 /** |
| 38 * Called when the native {@link MediaSession} state has changed. |
| 39 * @param isControllable Whether the native {@link MediaSession} is controll
able. |
| 40 * @param isSuspended Whether the native {@link MediaSession} is suspended. |
| 41 */ |
| 42 public void mediaSessionStateChanged(boolean isControllable, boolean isSuspe
nded) {} |
| 43 |
| 44 /** |
| 45 * Called when the native {@link MediaSession} has changed metadata. |
| 46 * @param metadata The new metadata of the native {@link MediaSession}. "nul
l" is for unsetting |
| 47 * metadata. |
| 48 */ |
| 49 public void mediaSessionMetadataChanged(MediaMetadata metadata) {} |
| 50 } |
OLD | NEW |