Get Media Duration

Demo to preview the plugin:

Introduction

Get the media duration of a video or audio file before uploading it.
Supported formats: AVI, mp3, mp4, mpeg, ogg

Plugin Element Properties

The plugin contains a Media Duration visual element that should be used on a page.
Image without caption
Element Actions
1. Select and Check -ย creates a file input field for the user to select a file and a video element to load the media for duration analysis. It handles file input changes, computes the duration of the selected media file, and publishes the duration in both seconds and minutes.Supported formats: avi,mp3,mp4,mpeg,ogg
Image without caption
  1. Upload - handles file uploads by converting a selected file to Base64 and then sending it to a server endpoint to be stored. Upon successful upload, the function updates the Bubble application's state with the URL of the uploaded file and triggers an event.
Image without caption
Exposed states
Name
Description
Type
Duration in Seconds
The duration of the media file in seconds.
Number
Duration in Minutes
The duration of the media file in minutes, calculated from the seconds.
Number
Uploaded urlย 
The URL of the uploaded file, made available to the Bubble application after a successful upload.
Text
File Size
The size of the selected file
Text
Element Events
Name
Description
Duration
An event that is triggered after the media file's duration is successfully computed and published.
File uploaded
An event triggered when the file upload is completed successfully.

Workflow example

  1. Place the Media Duration visual element on the page
Image without caption
  1. Use the Select and check media action
Image without caption
  1. Use the returned states to display the media file duration
Image without caption

Changelogs