Configure Trim
VideoEditor SDK supports configuring the VideoTrimToolPanel
to enforce a minimum and maximum duration of the trimmed video.
Min / Max Duration#
By default, the minimum video duration enforced is 0.5 seconds and there is no limit on the maximum video duration. In this example, we only allow videos that are at least two seconds and at most five seconds long.
Behavior and user alerts for exceptions#
If enabled, the trim length will initially be set to the maximumVideoLength
. If this value is not set, or the video length is shorter than the maximumVideoLength
, it will be set to the full length of the video. The user interface will not allow a trim length that is shorter than minimumVideoLength
or longer than maximumVideoLength
, so users will never be able to generate a video that lies outside these defined limits. However, there are two cases where this behavior can only be achieved with an alert:
- If a
minimumVideoLength
has been set for the trim tool and the length of the input video is shorter than that, we will present an alert as soon as the editor is opened stating that the video is too short. After confirming that alert, the editor is closed. - If a
minimumVideoLength
has been set for the composition tool and the length of the video composition does not yet overstep that length, tapping on the export button will present an alert that notifies the user that they will have to add additional videos to the composition to export the video. After confirming the alert, the composition tool will automatically open. If you do not allow your users to add additional videos to the composition whenUiConfigComposition.allowAddVideoClips
is set tofalse
, the behavior will be identical as if the trim tool would have been used above.
Trim or Video Composition tool#
The video composition tool will only be used if it is included in your subscription and if it is included in the menu items or if both the video composition and trim tool are not included as menu items. Otherwise, the trim tool is used if it is included in your subscription.