1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package org.chromium.content.browser;
6
7import android.view.View;
8import android.widget.MediaController.MediaPlayerControl;
9
10/**
11 * Represents the video controls of the content video view (the fullscreen video player).
12 * Abstracts ContentVideoView from android.widget.MediaController to allow embedders to
13 * override the behavior and/or the look of the default controls.
14 */
15public interface ContentVideoViewControls {
16
17    /**
18     * The interface that the host of the controls and the video needs to implement.
19     */
20    public interface Delegate extends MediaPlayerControl {
21    }
22
23    /**
24     * Show the controls on screen. It will go away
25     * automatically after 3 seconds of inactivity.
26     */
27    public void show();
28
29    /**
30     * Show the controls on screen. It will go away
31     * automatically after 'timeout' milliseconds of inactivity.
32     * @param timeout_ms The timeout in milliseconds. Use 0 to show
33     * the controls until hide() is called.
34     */
35    public void show(int timeout_ms);
36
37    /**
38     * Remove the controls from the screen.
39     */
40    public void hide();
41
42    /**
43     * Check if the controls are shown or hidden at the moment.
44     */
45    public boolean isShowing();
46
47    /**
48     * Enable or disable the controls.
49     */
50    public void setEnabled(boolean enabled);
51
52    /**
53     * Set the media player interface to use to update/implement the controls.
54     * @param delegate The delegate implementation by the controls host.
55     */
56    public void setDelegate(Delegate delegate);
57
58    /**
59     * Set the view that acts as the anchor for the control view.
60     * This can for example be a VideoView, or your Activity's main view.
61     * When VideoView calls this method, it will use the VideoView's parent
62     * as the anchor.
63     * @param view The view to which to anchor the controls when visible.
64     */
65    public void setAnchorView(View view);
66}