The Cloudinary Video Player is a JavaScript-based HTML5 video player bundled with many valuable customization and integration capabilities, and is monetization and analytics-ready. The player has a lightweight bundle size with tree-shaking and lazy-loading of modules for optimal performance. It's fully responsive for use in any device or screen size, and is integrated with Cloudinary's video delivery and transformation solution.
The player is fully WCAG 2.1 AA compliant, ensuring that users with visual, auditory, motor, and cognitive impairments can fully engage with your videos using assistive technologies, keyboard navigation, and other accessibility-friendly enhancements. See our dedicated accessibility page to learn more about other Video Player accessibility features.
This guide describes cloudinary-video-player version 3.0.2.
As of version 3.0.0, the video player is optimized for better performance:
adaptive-streaming
moduleadaptive-streaming
and dash
modulesSee also:
Cloudinary supports only the documented configuration and the supplied files with the video player. Any direct changes to the player code and its elements (for example, CSS and JS files) might break its functionality, and will not be supported.
Live exampleBefore you embed a Cloudinary video player in your own website or mobile app, take a look at some sample video player code and the video player that results from it.
Alternatively, design and customize your video player with Cloudinary Video Player Studio.
For this simple example, a video tag and short bit of JavaScript creates a responsively resizing video player that plays a single video. The video is muted when loaded and includes basic controls.
Video player featuresThe Cloudinary video player is a feature-rich HTML5-based video player. This section summarizes its main functionality.
mp4
, webm
, mov
| av1
, vp9
, h265
. By default automatic format selection is applied, or you can manually specify multiple source types.Install the library as a module using your package manager or include the video player in your application via CDN.
Option 1: Install the video player and import as a moduleInstall the cloudinary-video-player
:
Import the video player as a module and import the CSS file:
To keep the package size as light as possible, the video player module includes only basic functionality. To use additional functionality, you need to import the relevant module(s) as well.
For example:
adaptive-streaming
(required for both HLS and DASH)dash
(required only when using DASH)colors
chapters
ima
interaction-areas
playlist
recommendations-overlay
shoppable
srt-text-tracks
(when using SRT format for text tracks)If you intend to use the majority of the above features, you can optionally include the video player using just the all
module, which includes all available modules as listed above.
For example:
Option 2: Include the video player directly from a CDN providerThe Cloudinary Video Player script should be included on all pages or views of your application where the video player is used. The player is available in either minified or non-minified formats.
The package includes all functionality described in this video player documentation. Core functionality is loaded initially, with additional features loaded lazily when they are used in your video player instance.
Non-minified Minified JavaScript cld-video-player.js cld-video-player.min.js CSS cld-video-player.css cld-video-player.min.cssThe version numbers used above are the latest tested versions at the time of publishing this page. It's recommended to test the latest available versions of the video player and update the version numbers in your code accordingly.
Option 3: Embed a cloud hosted playerA cloud hosted player uses an iframe to embed a fully functioning player with all relevant configuration and dependencies already included. To include a cloud hosted player instance on your page using an iframe, create and configure your player using the Video Player Studio or build the iframe manually.
Here is an example of how the embeddable iframe code will look:
SetupTo create a video player instance, invoke the cloudinary.videoPlayer
method. Provide either the HTML element of your video player or its ID, along with the cloud name associated with your product environment. You can also include any additional options. For example:
Once the video player is instantiated, use the source method to load a video. Provide either the public ID or the raw URL of the video you want to load. For example:
cloudinary.player
method.cloudinary-core
JavaScript library and used a slightly different syntax for configuring the video player (using cloudinary.Cloudinary.new
). Existing customers should note that although the current version of the Video Player still supports this old syntax and no changes are needed to your existing Video Player code, the removal of the dependency on the cloudinary-core
JavaScript library results in smaller Video Player package sizes. As such, Cloudinary recommends updating your code moving forward.Use the Video Player Studio to create and customize a video player instance or define a player profile and easily copy and paste the required code into your website or application. The studio includes features that enable you to:
Use the Cloudinary video live streaming API to create and manage live streams that you can then use with the Video Player.
Once you've created a live stream, you can set the video player source to the hls
output URI:
Alternatively, you can take the public ID of the hls
output and set the type
parameter to live
when defining your source, making sure to set hls
as your source type, for example:
You can view sample HTML and JavaScript code for the features described in this guide in the Cloudinary Video Player Samples.
Below you can find code explorers showing a basic example with a Video Player component for both React and Angular.
React sampleThis code is also available in GitHub.
Angular sampleThis code is also available in GitHub.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4