Index: media/base/mediaplayer_observer.h |
diff --git a/media/base/mediaplayer_observer.h b/media/base/mediaplayer_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd156daedc50f027c5f87811da8c94f1b9a235fb |
--- /dev/null |
+++ b/media/base/mediaplayer_observer.h |
@@ -0,0 +1,36 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ |
xhwang
2016/10/01 07:12:14
nit: media and player are two words.
xjz
2016/10/03 22:31:08
Renamed to MediaObserver.
|
+#define MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ |
+ |
+#include "base/callback.h" |
+#include "media/base/audio_decoder_config.h" |
+#include "media/base/cdm_context.h" |
+#include "media/base/video_decoder_config.h" |
+ |
+namespace media { |
+ |
+// This class is an observer of media player events. |
+class MEDIA_EXPORT MediaPlayerObserver { |
xhwang
2016/10/01 07:12:14
As commented before, we don't use "MediaPlayer" ou
xjz
2016/10/03 22:31:08
Renamed as "MediaObserver".
|
+ public: |
+ MediaPlayerObserver(); |
+ virtual ~MediaPlayerObserver(); |
+ |
+ // Called when the media element or its ancestor is entered/exited fullscreen. |
xhwang
2016/10/01 07:12:14
What if the ancestor (e.g. a <div>) entered fullsc
xjz
2016/10/03 22:31:08
We currently treat this scenario same as the media
|
+ virtual void OnEnteredFullscreen() = 0; |
+ virtual void OnExitedFullscreen() = 0; |
+ |
+ // Called when CDM is attached to the media element. |
xhwang
2016/10/01 07:12:14
Add a comment that the |cdm_context| is only guara
xjz
2016/10/03 22:31:08
Done.
|
+ virtual void OnSetCdm(CdmContext* cdm_context) = 0; |
+ |
+ // Set video/audio config after demuxer is initialized. |
xhwang
2016/10/01 07:12:14
nit: "Set" is ambiguous. This is really just notif
xjz
2016/10/03 22:31:08
Changed to pass PipelineMetadata instead to know i
|
+ virtual void OnDecoderConfigChanged( |
+ const AudioDecoderConfig& audio_config, |
+ const VideoDecoderConfig& video_config) = 0; |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ |