public class BoxPreviewVideoFragment extends BoxPreviewMediaFragment implements android.view.TextureView.SurfaceTextureListener, android.view.View.OnClickListener
BoxPreviewFragment.BoxPreviewController, BoxPreviewFragment.Listener| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
OUT_IS_VIDEO_STARTED |
static java.lang.String |
TAG |
mAudioCapabilities, mAudioReceiver, mMediaControlAnchorView, mPlayer, mPlayerPosition, mSurfaceView, OUT_PLAYER_POSITIONmIsErrorShowing, mReportsTransferBytesEXTRA_BOX_ITEM, EXTRA_POSITION, EXTRA_PREVIEW_LOADED, EXTRA_THUMBNAIL_LOADED, mController, mPosition, mPreviewLoaded, mReceiver, mThumbnailLoaded| Constructor and Description |
|---|
BoxPreviewVideoFragment() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canInitPlayer()
Returns whether all the components required by the player are ready and available
|
protected RendererBuilder |
getBuilder()
Gets the builder that creates the appropriate rendering for the player
|
static com.box.androidsdk.content.requests.BoxRequestsFile.DownloadThumbnail |
getCacheThumbnailRequest(PreviewController previewController,
com.box.androidsdk.content.models.BoxFile boxFile) |
protected com.box.androidsdk.content.models.BoxRepresentation |
getDashRepresentation() |
protected android.net.Uri |
getMediaUri() |
protected BoxApiPreview.Extensions |
getPreviewExtension()
Gets the extension that will be used with the preview endpoint
|
protected void |
hideError() |
protected void |
initPlayer()
Initializes the player and notifies the activity that the fragment is ready
|
void |
loadContent(BoxExecutor executor,
java.util.Collection<java.util.concurrent.FutureTask> tasks,
PreviewStorage storage) |
protected void |
onBoxRequestError(com.box.androidsdk.content.requests.BoxResponse response) |
protected void |
onBoxRequestSuccess(com.box.androidsdk.content.requests.BoxResponse response) |
void |
onClick(android.view.View v) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onDestroyView() |
void |
onInternetConnectionChanged(boolean connected)
Entry public static final String METADATA_DOCUMENT_TAG = "doc";
point to handle a lost or found internet connection at the fragment level.
|
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
onSurfaceTextureAvailable(android.graphics.SurfaceTexture surfaceTexture,
int w,
int h) |
boolean |
onSurfaceTextureDestroyed(android.graphics.SurfaceTexture surfaceTexture) |
void |
onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture surfaceTexture,
int h,
int w) |
void |
onSurfaceTextureUpdated(android.graphics.SurfaceTexture surfaceTexture) |
void |
onVideoSizeChanged(int width,
int height,
float pixelWidthAspectRatio) |
protected void |
prepareMedia()
Ensures the media is present and ready before loading it into the player
|
void |
releasePlayer() |
protected void |
restartDownload()
Logic to handle a restarted download, such as resetting requests, adding progress bars,
and removing default views.
|
protected void |
showUnavailable(java.lang.String message)
Logic to handle unavailable previews, such as removing progress bars and showing default
views.
|
protected boolean |
tryContentUriStream()
Attempts to play a video file through the download content endpoint
|
checkTasksBeforeExecute, getMediaControls, notifyFragmentLoaded, onAudioCapabilitiesChanged, onDestroy, onErrorOccurred, onPause, onResume, onTaskCompleted, setPreviewController, surfaceChanged, surfaceCreated, surfaceDestroyed, updateLoadingStatusgetProgressBar, getVisibleViews, hideProgress, initDefaultViews, isContainerVisible, onActivityCreated, onCreate, onStart, restoreStatus, setProgress, showProgresscancelLoadContent, checkTasksBeforeExecute, createInstance, execute, getBoxFile, getBoxSession, getIntentFilter, getPosition, getPreviewController, handleMessage, isContentLoading, loadContent, notifyFragmentUnloaded, onDetach, setUserVisibleHint, showNetworkUnavailabledump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isVisible, onActivityResult, onAttach, onAttach, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPrepareOptionsMenu, onRequestPermissionsResult, onStop, onViewCreated, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, toString, unregisterForContextMenupublic static final java.lang.String TAG
protected static final java.lang.String OUT_IS_VIDEO_STARTED
public void onSaveInstanceState(android.os.Bundle outState)
onSaveInstanceState in class BoxPreviewMediaFragmentpublic void onInternetConnectionChanged(boolean connected)
BoxPreviewFragmentonInternetConnectionChanged in class BoxPreviewFragmentconnected - whether or not there is a valid internet connectionpublic android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
onCreateView in class BoxPreviewMediaFragmentpublic void onVideoSizeChanged(int width,
int height,
float pixelWidthAspectRatio)
onVideoSizeChanged in interface BoxPlayer.ListeneronVideoSizeChanged in class BoxPreviewMediaFragmentprotected void restartDownload()
BoxPreviewFragmentrestartDownload in class BoxPreviewDefaultFragmentprotected void showUnavailable(java.lang.String message)
BoxPreviewFragmentshowUnavailable in class BoxPreviewDefaultFragmentmessage - message to show when handling this error case.protected void hideError()
hideError in class BoxPreviewDefaultFragmentprotected com.box.androidsdk.content.models.BoxRepresentation getDashRepresentation()
protected RendererBuilder getBuilder()
BoxPreviewMediaFragmentgetBuilder in class BoxPreviewMediaFragmentprotected android.net.Uri getMediaUri()
getMediaUri in class BoxPreviewMediaFragmentprotected BoxApiPreview.Extensions getPreviewExtension()
BoxPreviewMediaFragmentgetPreviewExtension in class BoxPreviewMediaFragmentprotected void prepareMedia()
protected void onBoxRequestSuccess(com.box.androidsdk.content.requests.BoxResponse response)
onBoxRequestSuccess in class BoxPreviewMediaFragmentprotected void onBoxRequestError(com.box.androidsdk.content.requests.BoxResponse response)
onBoxRequestError in class BoxPreviewMediaFragmentpublic void loadContent(BoxExecutor executor, java.util.Collection<java.util.concurrent.FutureTask> tasks, PreviewStorage storage)
loadContent in class BoxPreviewDefaultFragmentpublic void onDestroyView()
onDestroyView in class BoxPreviewMediaFragmentpublic static com.box.androidsdk.content.requests.BoxRequestsFile.DownloadThumbnail getCacheThumbnailRequest(PreviewController previewController, com.box.androidsdk.content.models.BoxFile boxFile)
public void releasePlayer()
releasePlayer in class BoxPreviewMediaFragmentprotected boolean canInitPlayer()
BoxPreviewMediaFragmentcanInitPlayer in class BoxPreviewMediaFragmentprotected void initPlayer()
BoxPreviewMediaFragmentinitPlayer in class BoxPreviewMediaFragmentpublic void onSurfaceTextureAvailable(android.graphics.SurfaceTexture surfaceTexture,
int w,
int h)
onSurfaceTextureAvailable in interface android.view.TextureView.SurfaceTextureListenerpublic void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture surfaceTexture,
int h,
int w)
onSurfaceTextureSizeChanged in interface android.view.TextureView.SurfaceTextureListenerpublic boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture surfaceTexture)
onSurfaceTextureDestroyed in interface android.view.TextureView.SurfaceTextureListenerpublic void onSurfaceTextureUpdated(android.graphics.SurfaceTexture surfaceTexture)
onSurfaceTextureUpdated in interface android.view.TextureView.SurfaceTextureListenerpublic void onClick(android.view.View v)
onClick in interface android.view.View.OnClickListenerprotected boolean tryContentUriStream()