public final class VdoPlayerSupportFragment extends Fragment implements VdoPlayer.PlayerHost
VdoPlayerFragment.
A VdoPlayerSupportFragment hosts a VdoPlayer for media playback.
It can be dropped into your activity layout and initialized using
PlayerHost#initialize(InitializationListener) to obtain a VdoPlayer instance.
VIDEO_STRETCH_MODE_MAINTAIN_ASPECT_RATIO, VIDEO_STRETCH_MODE_STRETCH_TO_FIT| Constructor and Description |
|---|
VdoPlayerSupportFragment() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInitializationListener(VdoPlayer.InitializationListener initListener)
Register a listener for initialization callbacks from this PlayerHost
|
VdoPlayer |
getPlayer()
Get the VdoPlayer hosted by this PlayerHost.
|
int |
getVideoStretchMode()
Return currently set video stretch mode.
|
void |
initialize(VdoPlayer.InitializationListener listener)
Initializes the PlayerHost with an InitializationListener to listen for initialization callbacks.
|
void |
onActivityCreated(Bundle savedInstanceState) |
void |
onAttach(Context context) |
void |
onCreate(Bundle savedInstanceState) |
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) |
void |
onDestroy() |
void |
onDestroyView() |
void |
onDetach() |
void |
onPause() |
void |
onResume() |
void |
onSaveInstanceState(Bundle outState) |
void |
onStart() |
void |
onStop() |
void |
onViewStateRestored(Bundle savedInstanceState) |
void |
removeInitializationListener(VdoPlayer.InitializationListener initListener)
Remove a registered InitializationListener
|
void |
setAspectRatio(float widthToHeightRatio)
Set aspect ratio for the fragment view.
|
void |
setVideoStretchMode(int videoStretchMode)
Set stretch mode for video scaling inside the fragment layout.
|
public void onAttach(Context context)
public void onCreate(Bundle savedInstanceState)
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
public void onActivityCreated(Bundle savedInstanceState)
public void onViewStateRestored(Bundle savedInstanceState)
public void onStart()
public void onResume()
public void onPause()
public void onSaveInstanceState(Bundle outState)
public void onStop()
public void onDestroyView()
public void onDestroy()
public void onDetach()
public void setAspectRatio(float widthToHeightRatio)
widthToHeightRatio - the desired aspect ratiopublic int getVideoStretchMode()
public void setVideoStretchMode(int videoStretchMode)
videoStretchMode - one of PlayerHost.VIDEO_STRETCH_MODE_* constantspublic void addInitializationListener(VdoPlayer.InitializationListener initListener)
VdoPlayer.PlayerHostaddInitializationListener in interface VdoPlayer.PlayerHostinitListener - listener for initialization callbackspublic void removeInitializationListener(VdoPlayer.InitializationListener initListener)
VdoPlayer.PlayerHostremoveInitializationListener in interface VdoPlayer.PlayerHostinitListener - the listener to removepublic VdoPlayer getPlayer() throws VdoPlayer.PlayerHostNotReadyException
VdoPlayer.PlayerHostInitializationListener#onInitializationSuccess(PlayerHost, VdoPlayer, boolean)
callback following #initialize(InitializationListener)getPlayer in interface VdoPlayer.PlayerHostVdoPlayer.PlayerHostNotReadyException - if the PlayerHost is not initializedpublic void initialize(VdoPlayer.InitializationListener listener)
VdoPlayer.PlayerHostinitialize in interface VdoPlayer.PlayerHostlistener - listener for the callback