Class VdoPlayerSupportFragment
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,com.vdocipher.aegis.player.PlayerHost
public final class VdoPlayerSupportFragment extends Fragment implements PlayerHost
Support library based equivalent of VdoPlayerFragment.
A VdoPlayerSupportFragment hosts a VdoPlayer for media playback.
It can be dropped into your activity layout and initialized using initialize to obtain a VdoPlayer instance.
-
-
Field Summary
Fields Modifier and Type Field Description public int
videoStretchMode
public int
resizeMode
-
Constructor Summary
Constructors Constructor Description VdoPlayerSupportFragment()
-
Method Summary
Modifier and Type Method Description int
getVideoStretchMode()
Return currently set video stretch mode. void
setVideoStretchMode(int videoStretchMode)
Set stretch mode for video scaling inside the fragment layout. int
getResizeMode()
Returns the resize mode. void
setResizeMode(int resizeMode)
Sets the resize mode. void
onAttach(Context context)
void
onCreate(Bundle savedInstanceState)
View
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void
onActivityCreated(Bundle savedInstanceState)
void
onViewStateRestored(Bundle savedInstanceState)
void
onStart()
void
onResume()
void
restore()
void
resume()
void
onPause()
void
onSaveInstanceState(Bundle outState)
void
onStop()
void
onDestroyView()
void
onDestroy()
void
onDetach()
void
stopPlayer()
void
setAspectRatio(float widthToHeightRatio)
Set aspect ratio for the fragment view. void
addInitializationListener(PlayerHost.InitializationListener initListener)
Register a listener for initialization callbacks from this PlayerHost void
removeInitializationListener(PlayerHost.InitializationListener initListener)
Remove a registered InitializationListener VdoPlayer
getPlayer()
Get the VdoPlayer hosted by this PlayerHost. void
initialize(PlayerHost.InitializationListener listener)
Initializes the PlayerHost with an InitializationListener to listen for initialization callbacks. -
-
Method Detail
-
getVideoStretchMode
@Deprecated() int getVideoStretchMode()
Return currently set video stretch mode.
-
setVideoStretchMode
@Deprecated() void setVideoStretchMode(int videoStretchMode)
Set stretch mode for video scaling inside the fragment layout.
- Parameters:
videoStretchMode
- one of PlayerHost.
-
getResizeMode
int getResizeMode()
Returns the resize mode.
-
setResizeMode
void setResizeMode(int resizeMode)
Sets the resize mode.
- Parameters:
resizeMode
- The resize mode.
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onActivityCreated
void onActivityCreated(Bundle savedInstanceState)
-
onViewStateRestored
void onViewStateRestored(Bundle savedInstanceState)
-
onStart
void onStart()
-
onResume
void onResume()
-
restore
void restore()
-
resume
void resume()
-
onPause
void onPause()
-
onSaveInstanceState
void onSaveInstanceState(Bundle outState)
-
onStop
void onStop()
-
onDestroyView
void onDestroyView()
-
onDestroy
void onDestroy()
-
onDetach
void onDetach()
-
stopPlayer
void stopPlayer()
-
setAspectRatio
void setAspectRatio(float widthToHeightRatio)
Set aspect ratio for the fragment view.
The dimension (width or height) that is fixed in layout will be kept and the other dimension will be increased or decreased to match the aspect ratio.
- Parameters:
widthToHeightRatio
- the desired aspect ratio
-
addInitializationListener
void addInitializationListener(PlayerHost.InitializationListener initListener)
Register a listener for initialization callbacks from this PlayerHost
- Parameters:
initListener
- listener for initialization callbacks
-
removeInitializationListener
void removeInitializationListener(PlayerHost.InitializationListener initListener)
Remove a registered InitializationListener
- Parameters:
initListener
- the listener to remove
-
getPlayer
VdoPlayer getPlayer()
Get the VdoPlayer hosted by this PlayerHost. This may only be called after an onInitializationSuccess callback following initialize
- Returns:
VdoPlayer hosted by this PlayerHost
-
initialize
void initialize(PlayerHost.InitializationListener listener)
Initializes the PlayerHost with an InitializationListener to listen for initialization callbacks.
-
-
-
-