added in version 25.4.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
Deprecated since version 27.1.0

VideoFragment

public class VideoFragment
extends PlaybackFragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ android.support.v17.leanback.app.PlaybackFragment
       ↳ android.support.v17.leanback.app.VideoFragment


This class was deprecated in API level 27.1.0.
use VideoSupportFragment

Subclass of PlaybackFragment that is responsible for providing a SurfaceView and rendering video.

Summary

Inherited constants

From class android.support.v17.leanback.app.PlaybackFragment
From interface android.content.ComponentCallbacks2

Public constructors

VideoFragment()

Public methods

SurfaceView getSurfaceView()

Returns the surface view.

View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDestroyView()
void setSurfaceHolderCallback(SurfaceHolder.Callback callback)

Adds SurfaceHolder.Callback to SurfaceView.

Protected methods

void onVideoSizeChanged(int width, int height)

Called when size of the video changes.

Inherited methods

From class android.support.v17.leanback.app.PlaybackFragment
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Public constructors

VideoFragment

added in version 25.4.0
VideoFragment ()

Public methods

getSurfaceView

added in version 25.4.0
SurfaceView getSurfaceView ()

Returns the surface view.

Returns
SurfaceView

onCreateView

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

Parameters
inflater LayoutInflater

container ViewGroup

savedInstanceState Bundle

Returns
View

onDestroyView

void onDestroyView ()

setSurfaceHolderCallback

added in version 25.4.0
void setSurfaceHolderCallback (SurfaceHolder.Callback callback)

Adds SurfaceHolder.Callback to SurfaceView.

Parameters
callback SurfaceHolder.Callback

Protected methods

onVideoSizeChanged

added in version 26.1.0
void onVideoSizeChanged (int width, 
                int height)

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

Parameters
width int: Intrinsic width of video

height int: Intrinsic height of video