| 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 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 // This class is an observer of media player events. | 13 // This class is an observer of media player events. |
| 14 class MEDIA_EXPORT MediaObserver { | 14 class MEDIA_EXPORT MediaObserver { |
| 15 public: | 15 public: |
| 16 MediaObserver(); | 16 MediaObserver(); |
| 17 virtual ~MediaObserver(); | 17 virtual ~MediaObserver(); |
| 18 | 18 |
| 19 // Called when the media element entered/exited fullscreen. | 19 // Called when the media element entered/exited fullscreen. |
| 20 virtual void OnEnteredFullscreen() = 0; | 20 virtual void OnEnteredFullscreen() = 0; |
| 21 virtual void OnExitedFullscreen() = 0; | 21 virtual void OnExitedFullscreen() = 0; |
| 22 | 22 |
| 23 // Called when the media element starts/stops being the dominant visible |
| 24 // content. |
| 25 virtual void OnBecameDominantVisibleContent(bool is_dominant) {} |
| 26 |
| 23 // Called when CDM is attached to the media element. The |cdm_context| is | 27 // Called when CDM is attached to the media element. The |cdm_context| is |
| 24 // only guaranteed to be valid in this call. | 28 // only guaranteed to be valid in this call. |
| 25 virtual void OnSetCdm(CdmContext* cdm_context) = 0; | 29 virtual void OnSetCdm(CdmContext* cdm_context) = 0; |
| 26 | 30 |
| 27 // Called after demuxer is initialized. | 31 // Called after demuxer is initialized. |
| 28 virtual void OnMetadataChanged(const PipelineMetadata& metadata) = 0; | 32 virtual void OnMetadataChanged(const PipelineMetadata& metadata) = 0; |
| 29 | 33 |
| 30 // Called to indicate whether the site requests that remote playback be | 34 // Called to indicate whether the site requests that remote playback be |
| 31 // disabled. The "disabled" naming corresponds with the | 35 // disabled. The "disabled" naming corresponds with the |
| 32 // "disableRemotePlayback" media element attribute, as described in the | 36 // "disableRemotePlayback" media element attribute, as described in the |
| 33 // Remote Playback API spec: https://w3c.github.io/remote-playback | 37 // Remote Playback API spec: https://w3c.github.io/remote-playback |
| 34 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; | 38 virtual void OnRemotePlaybackDisabled(bool disabled) = 0; |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 } // namespace media | 41 } // namespace media |
| 38 | 42 |
| 39 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ | 43 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ |
| OLD | NEW |