Adding Preview Audio & Video files

Introduction

jDownloads supports adding either an audio file or a video file, which may have embedded audio, to a Download. Typically these are shown in the Downloads and the Download Details views as controlled by the relevant layout.

Further you may add a preview file, which is generally a short version of the downloadable file.  If you do not add a preview file then jDownloads will use the main downloadable file as the preview.  If you require visitors to be registered, to pay for the file or similar to Download please note that most browsers will be able download the preview and that there is no reliable way of inhibiting that ability.  So we would always recommend that you create a short preview as a separate file.  There is a note at the bottom of this article on a  simple ways to make a preview file using web based services.
Typical examples of audio and video preview files are show opposite.

The Audio preview file may be shown as a simple control bar, or if an mp3 file optionally also with additional details.

Either type of preview is shown by including the place holder variable {preview_player} in the layout. The extra information in an MP3 audio file requires an {mp3_id3_tag} in the layout. It has no effect if it is not mp3 type.
preview01 preview02
Most of the standard layouts already have the {preview_player} in place. Despite its name this just shows the location and name of the preview file.

Options Settings

In both the front-end and the back-end there are settings required in the V4 button optionsV4 tab mediaplayer tab.

The first thing is to decide if the audio and video support is to be through HTML5 elements or by using the Flowplayer addon.  HTML5 is recommended. The settings are similar for both options

The settings for both options are the same.  The width and height are set as maximum values so that  the aspect ratio is maintained.

As usual if the first option is set to No then the other four options are hidden.

preview15

The other part that may need setting is the MP3 details mini layout.

This is also in the V4 button optionsV4 tab mediaplayer tab.  In most cases no change is required.


preview17

User Groups settings

It is also neccessary to set up the appropriate setting in those User Groups allowed to create and edit Downloads.
In the  V4 button user group settingsV4 tab group creation edit tab set the Allowed File types and the allowed Preview File Types.

jDownloads supports mp3, wav, wma and oga audio files and mp4, webm and ogv video files.

Also in the V4 tab files sectionin the 'tick box' section ensure you set the preview tick box.
V4 tickbox preview
preview10

Here we show adding in the Front End, adding in the backend is very similar.

The Files tab in the Create/Edit form is the place where the preview is added as illustrated opposite.

The types of preview file and the permitted maximum upoload size in kB are set for each User Group that has permission to create or edit a Download.

One could also allow ogg types which are assumed as video.

preview03
Note: According to Wikipedia, https://en.wikipedia.org/wiki/HTML5_video (opens in new window/tab), MP4 in the regular H264 version seems to be supported in all browsers.

Making a Preview

There are numerous applications for audio and video editting that you can download to you device.  These generally comprehensive features so there could be a 'learning curve' challenge.  So if you are just wanting to make a short preview clip for a few file files or to only make previews occaisionally then perhaps a web based service might be a solution.  The limiting factor here is the upload time for the original file, particularly videos as they tend to be large!

For audio previews a simple effective and free service is at https://audiotrimmer.com (opens in new window/tab)
Similarly for videos https://online-video-cutter.com/ (opens in a new window/tab)

ColinM July 2019 modified June 2023

Print Email

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.