lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 25.4.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

VideoSupportFragment

public class VideoSupportFragment
extends PlaybackSupportFragment

java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ android.support.v17.leanback.app.PlaybackSupportFragment
       ↳ android.support.v17.leanback.app.VideoSupportFragment


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

Summary

Inherited constants

From class android.support.v17.leanback.app.PlaybackSupportFragment

Public constructors

VideoSupportFragment()

Public methods

SurfaceView getSurfaceView()

Returns the surface view.

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

Called to have the fragment instantiate its user interface view.

void onDestroyView()

Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment.

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.PlaybackSupportFragment
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener
From interface android.arch.lifecycle.LifecycleOwner
From interface android.arch.lifecycle.ViewModelStoreOwner

Public constructors

VideoSupportFragment

added in version 25.4.0
VideoSupportFragment ()

Public methods

getSurfaceView

added in version 25.4.0
SurfaceView getSurfaceView ()

Returns the surface view.

Returns
SurfaceView

onCreateView

added in version 25.4.0
View onCreateView (LayoutInflater inflater, 
                ViewGroup container, 
                Bundle savedInstanceState)

Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null (which is the default implementation). This will be called between onCreate(Bundle) and onActivityCreated(Bundle).

If you return a View from here, you will later be called in onDestroyView() when the view is being released.

Parameters
inflater LayoutInflater: The LayoutInflater object that can be used to inflate any views in the fragment,

container ViewGroup: If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.

savedInstanceState Bundle: If non-null, this fragment is being re-constructed from a previous saved state as given here.

Returns
View Return the View for the fragment's UI, or null.

onDestroyView

added in version 25.4.0
void onDestroyView ()

Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment. The next time the fragment needs to be displayed, a new view will be created. This is called after onStop() and before onDestroy(). It is called regardless of whether onCreateView(LayoutInflater, ViewGroup, Bundle) returned a non-null view. Internally it is called after the view's state has been saved but before it has been removed from its parent.

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