Package com.amazonaws.ivs.broadcast
Class ImagePreviewSurfaceTarget
java.lang.Object
com.amazonaws.ivs.broadcast.ImagePreviewSurfaceTarget
A special kind of preview which is not an Android View.
The application should supply an Android Surface through
setSurface(Surface, int, int)
and clear through clearSurface().
This preview is not a View, so it has no window attachment lifecycle. It
remains valid until release() is called.
Don't forget to call release() when done.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the surface, previews will not be rendered until {setSurface(Surface, int, int)} is called againvoidrelease()Release this preview, after calling this method the preview is not valid anymore and you will need a new onevoidsetMirrored(boolean isMirrored) Flips the preview horizontally.voidsetSurface(android.view.Surface surface, int width, int height) Specifies a new surface for rendering the preview
-
Method Details
-
setMirrored
public void setMirrored(boolean isMirrored) Flips the preview horizontally. This will betrueby default for the front facing camera, andfalsefor everything else.- Parameters:
isMirrored- Whether this view should be mirrored horizontally.- Throws:
IllegalStateException- If the preview has already been released.
-
setSurface
public void setSurface(@NonNull android.view.Surface surface, int width, int height) Specifies a new surface for rendering the preview- Parameters:
surface- An Android Surface to render towidth- Surface widthheight- Surface height- Throws:
IllegalStateException- If the preview has already been released.
-
clearSurface
public void clearSurface()Clears the surface, previews will not be rendered until {setSurface(Surface, int, int)} is called again- Throws:
IllegalStateException- If the preview has already been released.
-
release
public void release()Release this preview, after calling this method the preview is not valid anymore and you will need a new one
-