added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0-beta01
Deprecated since version 1.0.0

VideoFragment

public class VideoFragment
extends PlaybackFragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ androidx.leanback.app.PlaybackFragment
       ↳ androidx.leanback.app.VideoFragment


This class was deprecated in API level 1.0.0.
use VideoSupportFragment

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

Summary

Inherited constants

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

Public constructors

VideoFragment

added in version 1.0.0
public VideoFragment ()

Public methods

getSurfaceView

added in version 1.0.0
public SurfaceView getSurfaceView ()

Returns the surface view.

Returns
SurfaceView

onCreateView

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

Parameters
inflater LayoutInflater

container ViewGroup

savedInstanceState Bundle

Returns
View

onDestroyView

public void onDestroyView ()

setSurfaceHolderCallback

added in version 1.0.0
public void setSurfaceHolderCallback (SurfaceHolder.Callback callback)

Adds SurfaceHolder.Callback to SurfaceView.

Parameters
callback SurfaceHolder.Callback

Protected methods

onVideoSizeChanged

added in version 1.0.0
protected 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