Camera Capture and Video Recorder

Demo to preview the settings

Introduction

This plugin lets you make screenshots and record videos on desktop and mobile devices. It supports front and back camera recording, mirroring, and custom output format selection.
Image without caption

Prerequisites

The device must be using a browser that supports media recorder. You can check if your browser is included here https://caniuse.com/mediarecorder
πŸ’‘
To use this plugin for you and your app users and access your camera and microphone, please ensure that your browser settings allow access to these devices. You may need to check and adjust your browser's permissions for camera and microphone access. Once you've ensured the settings are configured correctly, the plugin will prompt you to grant access when needed.
‼️
MediaRecorder API used for recording videos with this plugin is not currently supported for Firefox version 124 and 125
Image without caption

How to setup

Taking Screenshots

  1. Add the CamCapture element to your page. It will show the camera preview. Resize the element to your desired size.
Image without caption
  1. Double-click the element and fill in its parameters
    1. Max file size (specifies what can be the max weight of the video you can upload to bubble)
    2. File uploads enabled (check it if you intend to upload the video to bubble after the recording is finished)
    3. Camera to use (front or back)
    4. Mirror (mirror the camera image horizontally)
    5. Turn on automatically (the browser will ask camera access permission automatically on load)
    6. Enable microphone
    7. Max video length (sec) (the recording will stop automatically when this number is reached)
    8. Preferred video extension (optional)
    9. Preferred MIME type (optional)
    10. File name (what your file will be called when you download it)
    11. Download on finish (yes / no)
  1. Add a β€œTake Photo” button to your page.
Image without caption
  1. Double-click the button you’ve added. And then click β€œEdit workflows”.
  1. In the event workflow page set the β€œOnly when” field value to β€œCamCapture’s is paused is no”.
Image without caption
  1. Add the β€œTake picture with Cam Capture” action also from the Element Actions.
Image without caption
  1. Add a new image element to the page to display the result. Set the source of the image to β€œCamCapture’s Local image url”.
Image without caption
  1. Click preview and test the setup. You will be prompted to give the camera access permission. After granting the permission, click the β€œTake Photo” button and you should see your screenshot in the preview image element.

Recording And Saving Videos

  1. Add the Cam Capture element to your page. It will show the camera preview. Resize the element to your desired size.
Image without caption
  1. Add a β€œRecord” and a β€œStop” button to your page.
Image without caption
  1. Double-click the Record button. And then click β€œEdit workflows”.
  1. Set the value of the Only when field to β€œCamCapture’s is recording is no and CamCapture’s is saving s no”.
Image without caption
  1. Add the action β€œStart recording CamCapture”.
Image without caption
Image without caption
  1. Now double-click the Stop button. And then click β€œEdit workflows”.
  1. Set the value of the Only when field to β€œCamCapture is recording is yes and CamCapture is saving is no”.
Image without caption
  1. Then add a Stop recording CamCapture action to this event.
Image without caption
Image without caption
  1. Lastly, add a video player element to display the recorded video. The video player element is available as a separate plugin element inside CamCapture.
  1. Set its source to β€œCamCapture’s captured video”
Image without caption
  1. Test your setup. Click preview. Then hit the record button, and then the Stop button. Your recorded video should appear in the video element.

How to save videos?

Follow the instructions above to set up a video capture workflow.
Double click the CamCapture element and set the β€œFile uploads enabled” to β€œyes”.
Image without caption
Now when you stop the recording the video will be saved to the Bubble data store.
If you want to track the progress of your video upload, you should display your own progress bar. One way to do this is by adding Bubble’s β€œProgress Bar” plugin to your page. You can then set the value of the progress bar to β€œCam Capture’s upload percentage”.

Plugin Element Properties

Cam Capture

Image without caption
Fields:
Title
Description
Type
Specify max file size for videos above. To allow files > 50MB, you must set β€œFile uploads enabled” to β€œyes”. Note that if you enable it, you will not see the standard progress indicator when files are uploading, and will need to display progress yourself using this element’s β€œupload percentage” value.
Camera to use
β€œfront or back”. If user’s device only has one camera, it will be used regardless of this setting. You can use the β€œfacing modes” property to access a list of supported facing modes for the current device. Available options: Front, Back
Text
Mirror
Choose whether to mirror the captured image or not
Checkbox (yes/no) (optional)
Crop
Check to crop the video according to the size of the element on the page. Use an action Zoom to change a zoom level
Checkbox (yes/no)
Turn on automatically
Request camera permission and start the camera automatically when the page loads?
Checkbox (yes/no) (optional)
Enable microphone
Enable microphone, for video recordings
Checkbox (yes/no) (optional)
Max video length (seconds)
If set, recording will stop automatically when recorded duration reaches this value in seconds.
Number (optional)
Advanced options
Preferred video file extension
The file extensions supported by the video recorder are dependent on the browser used. By default, the plugin attempts to find the best option, but if you have a preference you can set it here. It will only be used if the current browser supports it. Example format: β€œwebm”, β€œmkv” (no quotes)
Text (optional)
Preferred video MIME type
The MIME types supported by the video recorder are dependent on the browser used. By default, the plugin attempts to find the best option, but if you have a preference you can set it here. It will only be used if the current browser supports it. Example formats: β€œvideo/webm”, β€œvideo/webm;codecs=vp9”, β€œvideo/x-matroska;codecs=h264” (no quotes)
Text (optional)
File name
The name of the file when downloaded / uploaded to storage
Text (optional)
Download on finish
Should the video be downloaded on stop?
Checkbox (yes/no) (optional)
Aspect ratio
Use β€œ16:9” for a fixed aspect ratio, or β€œinherit” according to the plugin element’s width and height settings. Available options: inherit, 16:9
Dropdown

Element Actions

Take picture with

Turn on

Turn off

Pause

Resume

Start recording

Stop recording

Reset

EnumerateCameras

Serial shooting

Stop serial shooting

Zoom

Exposed states

Title
Description
Type
Image url
The url of the image uploaded to bubble
Image
Has camera
Returns yes if the user’s device has a camera
Checkbox (yes/no)
Is saving
Returns yes while the captured image is saving
Checkbox (yes/no)
Cam permission was denied
Returns yes if the user has denied permission to use their camera
Checkbox (yes/no)
Is paused
Returns yes while camera feed is paused
Checkbox (yes/no)
Facing modes
A list of available facing modes
Text
Started
Returns yes once the camera permission has been granted and the camera has been turned on
Checkbox (yes/no)
Recording is supported
Returns yes if the browser supports video recording
Checkbox (yes/no)
Is recording
Returns yes while recording
Checkbox (yes/no)
Upload percentage
The file upload progress percentage, if β€œFile uploads” is enabled
Number
Element loaded
The plugin element has loaded. If the plugin is in a popup or other hidden group, it will not load until visible. Most plugin actions will not work before the element has loaded.
Checkbox (yes/no)
Image capture is supported
Returns yes if the browser supports image capture
Checkbox (yes/no)
Recorded duration (seconds)
The current duration of recorded video, in seconds
Number
Local video url
Local video url valid only in the browser
Text
VideoUrl
Url of the video saved to Bubble data store
Text
Local image url
Local image url valid only in the browser
Text
List of shots
Images from action Serial shooting
Text

Element Events

Title
Description
camera permission was denied
The user denied access to their camera
is clicked
The camera preview video was clicked
video saving started
The process of saving a video started
video saving ended
The process of saving a video ended
video can’t be uploaded
Video can’t be uploaded
video upload failed
Video upload failed due to some error
image saving started
The process of saving image started
image saving ended
The process of saving image ended
image is got (serial shooting)
Triggers after each shoot

Video Player

Image without caption
Fields:
Title
Description
Type
Video
Video file to play
File (optional)
Controls
Whether to show playback controls or not
Checkbox (yes/no)
Autoplay
Note: Autoplay is not respected by all browsers. In some browsers (e.g.Β Chrome 70.0) autoplay doesn’t work if the β€œmuted” attribute is not also enabled.
Checkbox (yes/no)
Muted
Whether the video should play muted or not
Checkbox (yes/no)
Loop
Whether the video should loop or not
Checkbox (yes/no)

Additional Features

Pause / resume

Pause (freeze) the camera preview and resume it. You can take a picture while the camera is paused.

Start / stop

By default, the camera starts automatically on page load. You can disable this behaviour by unchecking the β€œStart automatically” box in the plugin properties and instead use the β€œstart” action to control when to begin accessing the user’s camera. Use β€œstop” to stop accessing the camera, which turns off the webcam usage indicator light the device might have.

Mirror

Mirrors the camera feed and resulting image.

Front / back camera

Some devices feature both front and back cameras. You can retrieve a list of all cameras that can be used from the plugin and select which to use in the plugin properties. You can also change the camera in use dynamically using the plugin’s β€œConditional” tab.
Image without caption

Changelogs