Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: media/blink/webmediaplayer_delegate.h

Issue 1570043002: Implement MediaSession on top of the WebMediaPlayerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session
Patch Set: Merge. Cleanup. Fix RequestPlay. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/blink/webmediaplayer_delegate.h
diff --git a/media/blink/webmediaplayer_delegate.h b/media/blink/webmediaplayer_delegate.h
index 6cd96200814026c830bc9172194d8d044a59629d..1e102f20b3a7770f9bc344e759d1966053d8a30c 100644
--- a/media/blink/webmediaplayer_delegate.h
+++ b/media/blink/webmediaplayer_delegate.h
@@ -18,25 +18,29 @@ class WebMediaPlayerDelegate {
public:
virtual void OnHidden() = 0;
virtual void OnShown() = 0;
+ virtual void OnPlay() = 0;
+ virtual void OnPause() = 0;
};
WebMediaPlayerDelegate() {}
+ // Subscribe to observer callbacks. Must be called in order to use any of the
+ // other methods.
+ virtual void AddObserver(Observer* observer) = 0;
+
// The specified player started playing media.
- virtual void DidPlay(blink::WebMediaPlayer* player) = 0;
+ virtual void DidPlay(Observer* observer,
+ bool has_video,
+ bool has_audio,
+ bool is_remote,
+ base::TimeDelta duration) = 0;
// The specified player stopped playing media.
- virtual void DidPause(blink::WebMediaPlayer* player) = 0;
-
- // The specified player was destroyed. Do not call any methods on it.
- // (RemoveObserver() is still necessary if the player is also an observer.)
- virtual void PlayerGone(blink::WebMediaPlayer* player) = 0;
-
- // Subscribe to observer callbacks.
- virtual void AddObserver(Observer* observer) = 0;
+ virtual void DidPause(Observer* observer, bool reached_end_of_stream) = 0;
- // Unsubscribe from observer callbacks.
- virtual void RemoveObserver(Observer* observer) = 0;
+ // The specified player was destroyed. Removes the observer from any future
+ // notifications. Do not call any methods on it.
+ virtual void PlayerGone(Observer* observer) = 0;
// Returns whether the render frame is currently hidden.
virtual bool IsHidden() = 0;

Powered by Google App Engine
This is Rietveld 408576698