ContentVideoViewClient.java revision 7dbb3d5cf0c15f500944d211057644d6a2f37371
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; 8 9/** 10 * Main callback class used by ContentVideoView. 11 * 12 * This contains the superset of callbacks that must be implemented by the embedder. 13 * 14 * onShowCustomView and onDestoryContentVideoView must be implemented, 15 * getVideoLoadingProgressView() is optional, and may return null if not required. 16 * 17 * The implementer is responsible for displaying the Android view when 18 * {@link #onShowCustomView(View)} is called. 19 */ 20public interface ContentVideoViewClient { 21 /** 22 * Called when the video view is ready to be shown. Must be implemented. 23 * @param view The view to show. 24 */ 25 public void onShowCustomView(View view); 26 27 /** 28 * Called when it's time to destroy the video view. Must be implemented. 29 */ 30 public void onDestroyContentVideoView(); 31 32 /** 33 * Hints the embedder to prevent or allow the screen timeout. Optional to implement. 34 * @param screenOn indicates if the screen should be kept on or off. 35 */ 36 public void keepScreenOn(boolean screenOn); 37 38 /** 39 * Allows the embedder to replace the view indicating that the video is loading. 40 * If null is returned, the default video loading view is used. 41 */ 42 public View getVideoLoadingProgressView(); 43 44 /** 45 * Allows the embedder to replace the default playback controls by returning a custom 46 * implementation. If null is returned, the default controls are used. 47 */ 48 public ContentVideoViewControls createControls(); 49} 50