VideoFragment

Added in 1.1.0
Deprecated in 1.1.0

public class VideoFragment extends PlaybackFragment


Subclass of PlaybackFragment that is responsible for providing a SurfaceView and rendering video. See base class PlaybackFragment for how to setup controls and how to customize showing/hiding controls.

Summary

Public constructors

Public methods

SurfaceView

Returns the surface view.

@Nullable View
onCreateView(
    LayoutInflater inflater,
    @Nullable ViewGroup container,
    Bundle savedInstanceState
)

This method is deprecated.

void

This method is deprecated.

void

Adds SurfaceHolder.Callback to android.view.SurfaceView.

Protected methods

void
onVideoSizeChanged(int videoWidth, int videoHeight)

Called when size of the video changes.

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int
From androidx.leanback.app.PlaybackFragment
static final int

A dark translucent background.

static final int

A light translucent background.

static final int

No background.

Inherited methods

From android.app.Fragment
void
dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

This method is deprecated.

final boolean

This method is deprecated.

final Activity

This method is deprecated.

boolean

This method is deprecated.

boolean

This method is deprecated.

final Bundle

This method is deprecated.

final FragmentManager

This method is deprecated.

Context

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final FragmentManager

This method is deprecated.

final Object

This method is deprecated.

final int

This method is deprecated.

final LayoutInflater

This method is deprecated.

LoaderManager

This method is deprecated.

final Fragment

This method is deprecated.

Transition

This method is deprecated.

final Resources

This method is deprecated.

final boolean

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final String
getString(int resId)

This method is deprecated.

final String

This method is deprecated.

final Fragment

This method is deprecated.

final int

This method is deprecated.

final CharSequence
getText(int resId)

This method is deprecated.

boolean

This method is deprecated.

View

This method is deprecated.

final int

This method is deprecated.

static Fragment
instantiate(Context context, String fname)

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

void
onActivityCreated(Bundle savedInstanceState)

This method is deprecated.

void
onActivityResult(int requestCode, int resultCode, Intent data)

This method is deprecated.

void
onAttach(Context context)

This method is deprecated.

void
onAttachFragment(Fragment childFragment)

This method is deprecated.

void

This method is deprecated.

boolean

This method is deprecated.

void
onCreate(Bundle savedInstanceState)

This method is deprecated.

Animator
onCreateAnimator(int transit, boolean enter, int nextAnim)

This method is deprecated.

void
onCreateContextMenu(
    ContextMenu menu,
    View v,
    ContextMenu.ContextMenuInfo menuInfo
)

This method is deprecated.

void

This method is deprecated.

View
onCreateView(
    LayoutInflater inflater,
    ViewGroup container,
    Bundle savedInstanceState
)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

LayoutInflater
onGetLayoutInflater(Bundle savedInstanceState)

This method is deprecated.

void
onHiddenChanged(boolean hidden)

This method is deprecated.

void
onInflate(AttributeSet attrs, Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void
onMultiWindowModeChanged(
    boolean isInMultiWindowMode,
    Configuration newConfig
)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onPictureInPictureModeChanged(
    boolean isInPictureInPictureMode,
    Configuration newConfig
)

This method is deprecated.

void

This method is deprecated.

void
onRequestPermissionsResult(
    int requestCode,
    String[] permissions,
    int[] grantResults
)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onTrimMemory(int level)

This method is deprecated.

void
onViewCreated(View view, Bundle savedInstanceState)

This method is deprecated.

void
onViewStateRestored(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

final void
requestPermissions(String[] permissions, int requestCode)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setHasOptionsMenu(boolean hasMenu)

This method is deprecated.

void

This method is deprecated.

void
setMenuVisibility(boolean menuVisible)

This method is deprecated.

void

This method is deprecated.

void
setRetainInstance(boolean retain)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setTargetFragment(Fragment fragment, int requestCode)

This method is deprecated.

void
setUserVisibleHint(boolean isVisibleToUser)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void
startActivityForResult(Intent intent, int requestCode)

This method is deprecated.

void
startIntentSenderForResult(
    IntentSender intent,
    int requestCode,
    Intent fillInIntent,
    int flagsMask,
    int flagsValues,
    int extraFlags,
    Bundle options
)

This method is deprecated.

void

This method is deprecated.

String

This method is deprecated.

void

This method is deprecated.

From androidx.leanback.app.PlaybackFragment
void

This method is deprecated.

Call hideControlsOverlay

ObjectAdapter
int

Returns the background type.

ProgressBarManager

Returns the ProgressBarManager that will show or hide progress bar in onBufferingStateChanged.

void
hideControlsOverlay(boolean runAnimation)

Hide controls overlay.

boolean

Returns true if controls will be auto hidden after a delay when fragment is resumed.

boolean

Returns true if controls overlay is visible, false otherwise.

boolean

This method is deprecated.

Uses isControlsOverlayAutoHideEnabled

boolean

Returns true if showing and auto-hiding controls when user interacts; false otherwise.

void

Updates the ui when the row data changes.

void
onBufferingStateChanged(boolean start)

Called when media has start or stop buffering.

void
onCreate(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void
onError(int errorCode, CharSequence errorMessage)

Called when media has error.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)

This method is deprecated.

void

Sets the list of rows for the fragment.

void

Sets the background type.

void

Enables or disables auto hiding controls overlay after a short delay fragment is resumed.

void
setFadingEnabled(boolean enabled)

This method is deprecated.

Uses setControlsOverlayAutoHideEnabled

void

Sets the PlaybackGlueHost.HostCallback.

void

This listener is called every time there is a click in RowsFragment.

void

This listener is called every time there is a selection in RowsFragment.

final void

Sets the input event handler.

void

Sets the BaseOnItemViewClickedListener that would be invoked for clicks only on androidx.leanback.widget.PlaybackRowPresenter.ViewHolder.

void

Sets the playback row for the playback controls.

void

Sets the presenter for rendering the playback row set by setPlaybackRow.

void

Interface to be implemented by UI widget to support PlaybackSeekUi.

void
setSelectedPosition(int position)

Sets the selected row position with smooth animation.

void
setSelectedPosition(int position, boolean smooth)

Sets the selected row position.

void
setShowOrHideControlsOverlayOnUserInteraction(
    boolean showOrHideControlsOverlayOnUserInteraction
)

Enables or disables showing and auto-hiding controls when user interacts.

void
showControlsOverlay(boolean runAnimation)

Show controls overlay.

void

Tickles the playback controls.

Public constructors

VideoFragment

Added in 1.1.0
Deprecated in 1.1.0
public VideoFragment()

Public methods

getSurfaceView

Added in 1.1.0
Deprecated in 1.1.0
public SurfaceView getSurfaceView()

Returns the surface view.

onCreateView

public @Nullable View onCreateView(
    LayoutInflater inflater,
    @Nullable ViewGroup container,
    Bundle savedInstanceState
)

onDestroyView

public void onDestroyView()

setSurfaceHolderCallback

Added in 1.1.0
Deprecated in 1.1.0
public void setSurfaceHolderCallback(SurfaceHolder.Callback callback)

Adds SurfaceHolder.Callback to android.view.SurfaceView.

Protected methods

onVideoSizeChanged

protected void onVideoSizeChanged(int videoWidth, int videoHeight)

Called when size of the video changes. App may override.

Parameters
int videoWidth

Intrinsic width of video

int videoHeight

Intrinsic height of video