Chromium Code Reviews| Index: media/blink/webmediaplayer_delegate.h |
| diff --git a/media/blink/webmediaplayer_delegate.h b/media/blink/webmediaplayer_delegate.h |
| index 7ae31df780b888b8248e41d92e5fd338a3c35e23..19be6acf9e210841e3d230d91402940f1ceeafaf 100644 |
| --- a/media/blink/webmediaplayer_delegate.h |
| +++ b/media/blink/webmediaplayer_delegate.h |
| @@ -16,16 +16,23 @@ class WebMediaPlayerDelegate { |
| public: |
| class Observer { |
| public: |
| - // Called when the WebMediaPlayer is no longer in the foreground. Audio may |
| - // continue in the background unless |must_suspend| is true. |
| - virtual void OnHidden(bool must_suspend) = 0; |
| - |
| + // Called when the WebMediaPlayer enters the background or foreground |
| + // respectively. Note: Some implementations will stop playback when hidden, |
| + // and thus subsequently call WebMediaPlayerDelegate::PlayerGone(). |
| + virtual void OnHidden() = 0; |
| virtual void OnShown() = 0; |
| + |
| + // Requests a WebMediaPlayer instance to release all idle resources. If |
| + // |must_suspend| is false, the player may ignore the request. However, if |
| + // |must_suspend| is true, the player must stop playback, release all idle |
| + // resources, and finally call WebMediaPlayerDelegate::PlayerGone(). |
| + virtual void OnSuspendRequested(bool must_suspend) = 0; |
|
xhwang
2016/03/10 21:51:06
One question for API. Is it legit that a WMP imple
DaleCurtis
2016/03/10 23:11:36
What case are you talking about? It seems your pro
xhwang
2016/03/11 00:09:19
Agreed that this is a hypothetical case.
As you s
DaleCurtis
2016/03/11 00:15:12
I think that's a correct assumption though :) Hidd
|
| + |
| virtual void OnPlay() = 0; |
| virtual void OnPause() = 0; |
| - // Playout volume should be set to current_volume * multiplier. The range |
| - // is [0, 1] and is typically 1. |
| + // Playout volume should be set to current_volume * multiplier. The range is |
| + // [0, 1] and is typically 1. |
| virtual void OnVolumeMultiplierUpdate(double multiplier) = 0; |
| }; |
| @@ -46,7 +53,7 @@ class WebMediaPlayerDelegate { |
| // The specified player stopped playing media. |
| virtual void DidPause(int delegate_id, bool reached_end_of_stream) = 0; |
| - // The specified player was destroyed or suspended. This may be called |
| + // The specified player was destroyed or suspended. This may be called |
| // multiple times in row. Note: Clients must still call RemoveObserver() to |
| // unsubscribe from callbacks. |
| virtual void PlayerGone(int delegate_id) = 0; |