OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 class WebMediaPlayer; | 9 class WebMediaPlayer; |
10 } | 10 } |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual int AddObserver(Observer* observer) = 0; | 36 virtual int AddObserver(Observer* observer) = 0; |
37 virtual void RemoveObserver(int delegate_id) = 0; | 37 virtual void RemoveObserver(int delegate_id) = 0; |
38 | 38 |
39 // The specified player started playing media. | 39 // The specified player started playing media. |
40 virtual void DidPlay(int delegate_id, | 40 virtual void DidPlay(int delegate_id, |
41 bool has_video, | 41 bool has_video, |
42 bool has_audio, | 42 bool has_audio, |
43 bool is_remote, | 43 bool is_remote, |
44 base::TimeDelta duration) = 0; | 44 base::TimeDelta duration) = 0; |
45 | 45 |
46 // The specified player stopped playing media. | 46 // The specified player stopped playing media. This may be called at any time |
| 47 // with or without a DidPlay() having previously occurred. Calling this will |
| 48 // cause the delegate to be registered for idle suspension. I.e., after some |
| 49 // time elapses without a DidPlay(), OnSuspendRequested() will be issued. |
47 virtual void DidPause(int delegate_id, bool reached_end_of_stream) = 0; | 50 virtual void DidPause(int delegate_id, bool reached_end_of_stream) = 0; |
48 | 51 |
49 // The specified player was destroyed or suspended. This may be called | 52 // The specified player was destroyed or suspended. This may be called |
50 // multiple times in row. Note: Clients must still call RemoveObserver() to | 53 // multiple times in row. Note: Clients must still call RemoveObserver() to |
51 // unsubscribe from callbacks. | 54 // unsubscribe from callbacks. |
52 virtual void PlayerGone(int delegate_id) = 0; | 55 virtual void PlayerGone(int delegate_id) = 0; |
53 | 56 |
54 // Returns whether the render frame is currently hidden. | 57 // Returns whether the render frame is currently hidden. |
55 virtual bool IsHidden() = 0; | 58 virtual bool IsHidden() = 0; |
56 | 59 |
57 protected: | 60 protected: |
58 virtual ~WebMediaPlayerDelegate() {} | 61 virtual ~WebMediaPlayerDelegate() {} |
59 }; | 62 }; |
60 | 63 |
61 } // namespace media | 64 } // namespace media |
62 | 65 |
63 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 66 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
OLD | NEW |