Renamed isRecordingVideo, added xml attribute for video max size and updated the documentation

pull/104/head
Raghav Petluru 8 years ago
parent 402b72ccee
commit d293375b8a
  1. 1
      README.md
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java
  3. 13
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  4. 2
      cameraview/src/main/res/values/attrs.xml

@ -595,6 +595,7 @@ Other APIs not mentioned above are provided, and are well documented and comment
|`getPreviewSize()`|Returns the size of the preview surface. If CameraView was not constrained in its layout phase (e.g. it was `wrap_content`), this will return the same aspect ratio of CameraView.|
|`getSnapshotSize()`|Returns `getPreviewSize()`, since a snapshot is a preview frame.|
|`getPictureSize()`|Returns the size of the output picture. The aspect ratio is consistent with `getPreviewSize()`.|
|`setVideoMaxSize(long)`|Set a max file size (in bytes) for a video recording. There is no file size limit by default unless set by the user.|
Take also a look at public methods in `CameraUtils`, `CameraOptions`, `ExtraProperties`.

@ -386,7 +386,7 @@ abstract class CameraController implements
return mPreviewSize;
}
final boolean isRecordingVideo() {
final boolean isCapturingVideo() {
return mIsCapturingVideo;
}

@ -144,6 +144,10 @@ public class CameraView extends FrameLayout {
GestureAction pinchGesture = GestureAction.fromValue(a.getInteger(R.styleable.CameraView_cameraGesturePinch, GestureAction.DEFAULT_PINCH.value()));
GestureAction scrollHorizontalGesture = GestureAction.fromValue(a.getInteger(R.styleable.CameraView_cameraGestureScrollHorizontal, GestureAction.DEFAULT_SCROLL_HORIZONTAL.value()));
GestureAction scrollVerticalGesture = GestureAction.fromValue(a.getInteger(R.styleable.CameraView_cameraGestureScrollVertical, GestureAction.DEFAULT_SCROLL_VERTICAL.value()));
//Get max size
float cameraVideoMaxSize = a.getFloat(R.styleable.CameraView_cameraVideoMaxSize, -1);
a.recycle();
// Components
@ -186,6 +190,11 @@ public class CameraView extends FrameLayout {
mapGesture(Gesture.SCROLL_HORIZONTAL, scrollHorizontalGesture);
mapGesture(Gesture.SCROLL_VERTICAL, scrollVerticalGesture);
//Set camera video maxSize
if(cameraVideoMaxSize > 0) {
setVideoMaxSize((long)cameraVideoMaxSize);
}
if (!isInEditMode()) {
mOrientationHelper = new OrientationHelper(context, mCameraCallbacks);
}
@ -1349,8 +1358,8 @@ public class CameraView extends FrameLayout {
* Returns true if the camera is currently recording a video
* @return boolean indicating if the camera is recording a video
*/
public boolean isRecordingVideo(){
return mCameraController.isRecordingVideo();
public boolean isCapturingVideo(){
return mCameraController.isCapturingVideo();
}
//endregion

@ -110,6 +110,8 @@
<attr name="cameraPlaySounds" format="boolean" />
<attr name="cameraVideoMaxSize" format="float" />
<!-- deprecated attr name="cameraZoomMode" format="enum">
<enum name="off" value="0" />
<enum name="pinch" value="1" />

Loading…
Cancel
Save