| 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. |disable_pipeline_auto_suspend| indicates whether to disable |
| 20 // any optimizations that might suspend the media pipeline. |
| 21 virtual void SwitchRenderer(bool disable_pipeline_auto_suspend) = 0; |
| 22 |
| 23 // Requests to activate monitoring changes on viewport intersection. |
| 24 virtual void ActivateViewportIntersectionMonitoring(bool activate) = 0; |
| 25 }; |
| 26 |
| 14 // This class is an observer of media player events. | 27 // This class is an observer of media player events. |
| 15 class MEDIA_EXPORT MediaObserver { | 28 class MEDIA_EXPORT MediaObserver { |
| 16 public: | 29 public: |
| 17 MediaObserver(); | 30 MediaObserver(); |
| 18 virtual ~MediaObserver(); | 31 virtual ~MediaObserver(); |
| 19 | 32 |
| 20 // Called when the media element entered/exited fullscreen. | 33 // Called when the media element entered/exited fullscreen. |
| 21 virtual void OnEnteredFullscreen() = 0; | 34 virtual void OnEnteredFullscreen() = 0; |
| 22 virtual void OnExitedFullscreen() = 0; | 35 virtual void OnExitedFullscreen() = 0; |
| 23 | 36 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 // Remote Playback API spec: https://w3c.github.io/remote-playback | 51 // Remote Playback API spec: https://w3c.github.io/remote-playback |
| 39 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; | 52 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; |
| 40 | 53 |
| 41 // Called when the media is playing/paused. | 54 // Called when the media is playing/paused. |
| 42 virtual void OnPlaying() = 0; | 55 virtual void OnPlaying() = 0; |
| 43 virtual void OnPaused() = 0; | 56 virtual void OnPaused() = 0; |
| 44 | 57 |
| 45 // Called when a poster image URL is set, which happens when media is loaded | 58 // Called when a poster image URL is set, which happens when media is loaded |
| 46 // or the poster attribute is changed. | 59 // or the poster attribute is changed. |
| 47 virtual void OnSetPoster(const GURL& poster) = 0; | 60 virtual void OnSetPoster(const GURL& poster) = 0; |
| 61 |
| 62 // Set the MediaObserverClient. |
| 63 virtual void SetClient(MediaObserverClient* client) = 0; |
| 48 }; | 64 }; |
| 49 | 65 |
| 50 } // namespace media | 66 } // namespace media |
| 51 | 67 |
| 52 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ | 68 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ |
| OLD | NEW |