1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 import "media/mojo/mojom/media_types.mojom";
8 import "ui/gfx/geometry/mojom/geometry.mojom";
10 // PlaybackEventsRecorder allows to observe and record events occurring in the
11 // media pipeline. The interface is called by the renderer process (in
12 // blink::WebMediaPlayerImpl), while the implementation normally runs in the
14 interface PlaybackEventsRecorder {
15 // Called when player has been started or resumed.
18 // Called when player has been paused.
21 // Called when player position is being changed.
24 // Called when the player has reached the end of the current file.
27 // Called when playback has failed due to the specified error.
28 OnError(PipelineStatus status);
30 // Called when playback has been suspended while buffering the media.
33 // Called after media buffering has completed. The player is in buffering
34 // state after the following events until this method is called:
35 // 1. Player initialized (i.e. after PlaybackEventsRecorder is created).
36 // 2. Seek operation, see OnSeeking().
37 // 3. Buffering started, see OnBuffering().
38 OnBufferingComplete();
40 // Called when video playback starts and every time video resolution changes.
41 OnNaturalSizeChanged(gfx.mojom.Size size);
43 // Called periodically (e.g. every second) while playback is active.
44 OnPipelineStatistics(PipelineStatistics stats);