OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_BASE_MEDIA_OBSERVER_H_ | 5 #ifndef MEDIA_BASE_MEDIA_OBSERVER_H_ |
6 #define MEDIA_BASE_MEDIA_OBSERVER_H_ | 6 #define MEDIA_BASE_MEDIA_OBSERVER_H_ |
7 | 7 |
8 #include "media/base/cdm_context.h" | 8 #include "media/base/cdm_context.h" |
9 #include "media/base/pipeline_metadata.h" | 9 #include "media/base/pipeline_metadata.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 class MEDIA_EXPORT MediaObserverClient { | |
15 public: | |
16 virtual ~MediaObserverClient() {} | |
17 | |
18 // Requests to restart the media pipeline and create a new renderer as soon as | |
19 // possible. | |
20 virtual void SwitchRenderer() = 0; | |
miu
2017/02/13 23:36:08
Observation: It seems both SwitchRenderer() and Di
xjz
2017/02/14 01:46:10
Done. I did observe this too. But I was not sure w
| |
21 | |
22 // Requests to activate monitoring changes on viewport intersection. | |
23 virtual void ActivateViewportIntersectionMonitoring(bool activate) = 0; | |
24 | |
25 // Requests to disable pipeline auto suspend for optimization. | |
26 virtual void DisablePipelineAutoSuspend(bool disable) = 0; | |
27 }; | |
28 | |
14 // This class is an observer of media player events. | 29 // This class is an observer of media player events. |
15 class MEDIA_EXPORT MediaObserver { | 30 class MEDIA_EXPORT MediaObserver { |
16 public: | 31 public: |
17 MediaObserver(); | 32 MediaObserver(); |
18 virtual ~MediaObserver(); | 33 virtual ~MediaObserver(); |
19 | 34 |
20 // Called when the media element entered/exited fullscreen. | 35 // Called when the media element entered/exited fullscreen. |
21 virtual void OnEnteredFullscreen() = 0; | 36 virtual void OnEnteredFullscreen() = 0; |
22 virtual void OnExitedFullscreen() = 0; | 37 virtual void OnExitedFullscreen() = 0; |
23 | 38 |
(...skipping 14 matching lines...) Expand all Loading... | |
38 // Remote Playback API spec: https://w3c.github.io/remote-playback | 53 // Remote Playback API spec: https://w3c.github.io/remote-playback |
39 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; | 54 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; |
40 | 55 |
41 // Called when the media is playing/paused. | 56 // Called when the media is playing/paused. |
42 virtual void OnPlaying() = 0; | 57 virtual void OnPlaying() = 0; |
43 virtual void OnPaused() = 0; | 58 virtual void OnPaused() = 0; |
44 | 59 |
45 // Called when a poster image URL is set, which happens when media is loaded | 60 // Called when a poster image URL is set, which happens when media is loaded |
46 // or the poster attribute is changed. | 61 // or the poster attribute is changed. |
47 virtual void OnSetPoster(const GURL& poster) = 0; | 62 virtual void OnSetPoster(const GURL& poster) = 0; |
63 | |
64 // Set the MediaObserverClient. | |
65 virtual void SetClient(MediaObserverClient* client) = 0; | |
48 }; | 66 }; |
49 | 67 |
50 } // namespace media | 68 } // namespace media |
51 | 69 |
52 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ | 70 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ |
OLD | NEW |