Skip to content

Most visited

Recently visited

navigation
added in version 25.4.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.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


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

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)