Skip to content

Record Video Widget

siddutgikar edited this page May 12, 2020 · 2 revisions

The widget can be used for recording a video. It also displays the storage state errors. Tapping the widget will start recording video. A timer will be displayed below the button indicating the duration of the video recording. The following images indicate some of the operational states of the widget in the default (widget is non-customized and the connected camera is not Hasselblad) state.

  • - Default start record video
  • - Default stop record video
  • - Default record video no sdcard

Mavic 2 Pro has a Hasselblad camera. The widget will also indicate when the Mavic 2 Pro is connected by changing the record video widget theme to orange. The images below indicate some of the operational states when Mavic 2 Pro is connected.

  • - Hasselblad start record video
  • - Hasselblad stop record video
  • - Hasselblad record video no sdcard

Usage

<dji.ux.beta.cameracore.widget.cameracapture.recordvideo.RecordVideoWidget
        android:id="@+id/widget_record"
        android:layout_width="80dp"
        android:layout_height="80dp"/>

Customizations

The widget can be customized by the user to serve their purpose and theme.

Example

<dji.ux.beta.cameracore.widget.cameracapture.recordvideo.RecordVideoWidget
        android:id="@+id/widget_record"
        android:layout_width="80dp"
        android:layout_height="80dp"
        app:recordStartIcon="@drawable/ic_record_video_blue"
        app:recordStopIcon="@drawable/ic_record_button_stop_blue" />

Java Example

RecordVideoWidget recordVideoWidget = findViewById(R.id.widget_record);
recordVideoWidget.setRecordVideoStartDrawable(getResources().getDrawable(R.drawable.ic_record_video_blue));
recordVideoWidget.setRecordVideoStopDrawable(getResources().getDrawable(R.drawable.ic_record_button_stop_blue));
  • - Custom start record video
  • - Custom stop record video
  • - Custom record video no sdcard

Attributes

List of the customizable XML attributes
  • uxsdk_cameraIndex - The camera index to which the widget should react
  • uxsdk_timerTextBackground - The background of video record timer text
  • uxsdk_timerTextColor - The color of video record timer text
  • uxsdk_timerTextSize - The size of video record timer text
  • uxsdk_recordStartIcon - The start recording video icon
  • uxsdk_recordStopIcon - The stop recording video icon
  • uxsdk_recordStartHasselbladIcon - The start recording video icon when a product with Hasselblad camera is connected
  • uxsdk_recordStopHasselbladIcon - The stop recording video icon when a product with Hasselblad camera is connected
  • uxsdk_ssdFullIcon - The icon to show SSD is full
  • uxsdk_ssdSlowIcon - The icon to show SSD is slow
  • uxsdk_ssdNotInsertedIcon - The icon to show SSD is not inserted
  • uxsdk_sdCardFullIcon - The icon to show SD Card is full
  • uxsdk_sdCardSlowIcon - The icon to show SD Card is slow
  • uxsdk_sdCardNotInsertedIcon - The icon to show SD Card is not inserted
  • uxsdk_internalStorageFullIcon - The icon to show internal storage is full
  • uxsdk_internalStorageSlowIcon - The icon to show internal storage is slow
  • uxsdk_internalStorageNotInsertedIcon - The icon to show internal storage is not inserted
  • uxsdk_foregroundIconBackground - The background of the storage state/photo mode icon

APIs

List of the customization APIs
  • public void setCameraIndex(@NonNull CameraIndex cameraIndex) - set the camera index for which the widget should react

  • @NonNull public CameraIndex getCameraIndex() - get the camera index for which the widget is reacting

  • public void setRecordVideoStartDrawable(@DrawableRes int resourceId) - set the start record video drawable

  • public void setRecordVideoStartDrawable(@Nullable Drawable drawable) - set the start record video drawable

  • @Nullable public Drawable getRecordVideoStartDrawable() - get the current start record video drawable

  • public void setRecordVideoStopDrawable(@DrawableRes int resourceId) - set the stop record video drawable

  • public void setRecordVideoStopDrawable(@Nullable Drawable drawable) - set the stop record video drawable

  • @Nullable public Drawable getRecordVideoStopDrawable() - get the current stop record video drawable

  • public void setRecordVideoHasselbladDrawable(@DrawableRes int resourceId) - set the start record video drawable when a product with Hasselblad camera is connected. Currently on Mavic 2 Pro

  • public void setRecordVideoHasselbladDrawable(@Nullable Drawable drawable) - set the start record video drawable when a product with Hasselblad camera is connected. Currently on Mavic 2 Pro

  • @Nullable public Drawable getRecordVideoHasselbladDrawable() - get the current start record video drawable when a product with Hasselblad camera is connected. Currently on Mavic 2 Pro

  • public void setRecordVideoStopHasselbladDrawable(@DrawableRes int resourceId) - set the stop record video drawable for Hasselblad camera. Currently on Mavic 2 Pro

  • public void setRecordVideoStopHasselbladDrawable(@Nullable Drawable drawable) - set the stop record video drawable for Hasselblad camera. Currently on Mavic 2 Pro

  • @Nullable public Drawable setRecordVideoStopHasselbladDrawable() - get the current stop record video drawable for Hasselblad camera. Currently on Mavic 2 Pro

  • public void setInternalStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for internal storage

  • public void setInternalStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for internal storage

  • @Nullable public Drawable getInternalStorageIcon(@NonNull StorageIconState storageIconState) - get the storage state icon for internal storage

  • public void setSDCardStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for SD Card

  • public void setSDCardStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for SD Card

  • @Nullable public Drawable getSDCardStorageIcon(@NonNull StorageIconState storageIconState) - get the storage state icon for SD Card

  • public void setSSDStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for SSD storage

  • public void setSSDStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - set the storage state icon for SSD storage

  • @Nullable public Drawable getSSDStorageIcon(@NonNull StorageIconState storageIconState) - get the storage state icon for SSD storage

  • public void setForegroundIconBackground(@DrawableRes int resourceId) - Set the background of storage state or photo mode icon

  • public void setForegroundIconBackground(@Nullable Drawable drawable) - Set the background of storage state or photo mode icon

  • @Nullable public void getForegroundIconBackground(@Nullable Drawable drawable) - Get the background of storage state or photo mode icon

Clone this wiki locally