Last updated: Nov-08-2023
You can customize your video player in a number of ways using Cloudinary's customization options, or alternatively, add more advanced customizations using the VideoJS API.
By default, the video player has a semi-transparent dark theme. The theme you select controls the color of the video player controls, controls background color, title style, and the color of the right-click context menu commands and central play button. You can change the theme skin by adding the class:
cld-video-player-skin-<value> to the video tag. For example, to specify the light theme, include this in your
If you would like more control over the color scheme for the player, you can customize this using the
colors constructor parameter.
To set the color scheme for the player, you need to specify three colors (as hex values) to be used for the
basecolor is used for the video player controls bar and information bar. It's also used for the central play button and right-click context menu.
accentcolor is used for the seek bar, volume control and for highlighting interactions with the UI, e.g. when hovering over a menu item.
textcolor is used for all the text and icons that are present within the video player UI.
You can configure the color scheme as part of the
Here's an example of a customized player using a Cloudinary color scheme and custom logo:
This section covers:
The examples below highlight some of the available options you might want to use when configuring your video player instances
Defining video transformations for your video player instance will apply these same transformations to all video sources. The example below demonstrates a simple crop:
- In the
- In the
You can also apply transformations to a single video by including the transformation when setting
For information on available video transformations, see:
The standard video player seek bar has two additional configuration options available to enhance the experience for your users:
Seek thumbnails show a preview of upcoming content to the user while they are seeking the video. This functionality is enabled by default. To disable it, set the
seekThumbnailsconstructor parameter to
AI-based highlights graph shows a visual representation of the highlights of the video based on how our AI preview algorithm determines the level of interest for each part of the video. To enable this functionality, set the
aiHighlightsGraphconstructor parameter to
Here is a simple example that demonstrates both features. Hover over the seek bar to view both thumbnails and graph.
Some additional common configurations include:
- Setting the autoplay mode. For example, use
on-scrollto cause the video to start playing when more than half the player is visible on screen.
- Setting a specific image as the video poster, including applying image transformations on the specified image.
- Adding a floating player when less than half the player becomes visible on screen. This can be set to appear in the bottom
rightand includes a button to close.
- Defining the preferred set of video source types. By default, the players uses automatic format selection to select the most optimal file type based on the user's device and browser.
- Customizing the video player font. (The font is applied to titles, descriptions, recommendations, time counter, etc.)
In the video tag:
As a videoPlayer method construction parameter:
The above are just a few common options. For details on all available options, see the Video Player configuration options section in the Video Player API Reference.
Additionally, see the Cloudinary Video Player samples which demonstrate many of these configuration settings.
Most standard HTML5 video attributes (
muted, etc) retain their standard default behavior (
auto mode for
preload and false for all others).
By default, the video player automatically uses the middle image of your video as a poster image (the equivalent of
<cloud_name>/video/<type>/<videoID>.jpg). You can specify a different public ID and/or image transformations using the
Additionally, by default, when the player requests your video, it will automatically request the best format from the default source types (
.mp4). If the transformation defined already exists for the requested source type, it's delivered. Otherwise, the relevant transformation is transcoded and streamed in real time. You can override the default format options using the
You can set transformations and a number of other configurations either in the
<video> tag or in the
In general, if you set the same configuration parameter for a specific video source, those values override the values of the parallel setting for the player.
However, if transformations are defined for both the source and the player, the transformation definitions are merged. For example, you could define width, height, and text overlay transformations at the player level, and then apply some special effect transformations for a particular video source. The resulting video will include all of the above transformations.
data-cld-autoplay-mode) is similar to the standard HTML5
autoplay parameter, but includes additional possible values. You should not include both settings in your player, but if you do, the Cloudinary autoplay mode setting takes precedence.
Video titles, subtitles, and descriptions can help give your audience quick information about your video. This information is displayed as follows:
- The title and subtitle is displayed at the top of the video player whenever the controls are displayed.
- The title is displayed on the playlist thumbnails in the playlist widget or 'Next up' preview.
- The title, subtitle, and description are displayed for the primary video recommendation when recommendations are enabled. The title is displayed for the remaining recommendations.
- If a title is not defined for any of the above, the video's public ID is used instead. If a subtitle or description is not defined, those elements are not displayed.
For example, the recommendation pane below shows the title, subtitle, and description of the main recommendation video, and titles for the remaining recommendations.
description. The default Title (Caption) and Description (Alt) fields shown in the Metadata tab are not used by the video player.
- In the
- For a
info parameter is set for a source, its values override the parallel entries in the resource context.
You can add subtitles and captions in
vtt format to your videos as a separate text track for the video player. This allows them to be toggled on or off while the video is playing. If you're looking to automatically generate transcripts to use as subtitles and captions, you can use the Google AI Video Transcription addon or Microsoft Azure Video Indexer addon.
To add text tracks, set the
textTracks parameter is an object containing the information about all the text tracks to be added to the video source. You can configure tracks for both
For each text track set the following parameters:
label- The label that appears in the menu when toggling closed captions, e.g. "English".
language- The language code indicating the language of the captions, e.g. "en".
default- Boolean. Whether the captions should be displayed by default when the video is loaded.
url- The link to the
vttfile to use for the captions. You can upload your
vttfiles to Cloudinary as raw files.
Here's an example of setting subtitles and captions for a
Video chapters provide information about different sections of a video and allow for quick navigation to those sections. The video player will be updated to show chapter markers on the seek bar and the chapter titles will appear in the control bar. You can define these chapters either through a VTT file or manually via the
chapters configuration object. The
chapters can be defined when setting the video source or alternatively as a constructor parameter when creating a player instance. You can define the chapters in two ways:
- Using a VTT file: Provide the URL of a VTT file that contains the chapter information. You can create your file and upload it to Cloudinary as a raw file.
- Using chapters object: Define the chapters directly in the chapters object by specifying the start time in seconds as the key and the chapter title as the corresponding value.
To use a VTT file, you need to specify the URL in the chapters object like so:
Your VTT file should follow the standard WebVTT format. Here's a sample VTT file:
To manually set chapters, you can define them in the chapters object. The keys represent the start time in seconds, and the values represent the chapter titles. For example:
Optionally, you can show a button that displays a list of available chapters by adding the
controlBar constructor parameter and setting the
chaptersButton parameter to true.
Here's a full example that demonstrates adding chapters from a VTT file and displaying the chapters button:
The Cloudinary video player is built over the VideoJS player, v8. You can access all underlying capabilities of the VideoJS API, using the
- In previous versions of the Cloudinary Video Player, you accessed the VideoJS API with
videoPlayer.videojs. Due to changes in the VideoJS API, you must now update these references to
- Adding customizations with video.js could cause conflicts when future versions of the Cloudinary video player are released. Before upgrading your version of the video player, it's important to verify that your customizations are still working correctly.
For full details on all of the available functionality, see the VideoJS Player API documentation.