Video.js - open source HTML5 & Flash video player

starsStars 30270
forksForks 6678
watchersWatchers 30270
current-versionCurrent version v7.11.1
total-releasesTotal releases 226
open_issues_countOpen issues 269
dateFirst release 2013-07-16
dateLatest release 2020-12-22
updateLast update 2020-12-23

Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 video and Media Source Extensions, as well as other playback techs like YouTube and Vimeo (through 600,000 websites.

Table of Contents

Quick Start

Thanks to the awesome folks over at <head>:

<link href="//" rel="stylesheet">
<script src="//"></script>

For the latest version of video.js and URLs to use, check out the Getting Started page on our website.

Video.js version 7 (and newer) CDN builds do not send any data to Google Analytics.

In older versions of Video.js (6 and earlier), in the CDN-hosted versions we include a

Alternatively, you can include Video.js by getting it from unpkg or another JavaScript CDN like CDNjs. These releases do not include Google Analytics tracking at all.

<!-- unpkg : use the latest version of Video.js -->
<link href="" rel="stylesheet">
<script src=""></script>

<!-- unpkg : use a specific version of Video.js (change the version numbers as necessary) -->
<link href="" rel="stylesheet">
<script src=""></script>

<!-- cdnjs : use a specific version of Video.js (change the version numbers as necessary) -->
<link href="" rel="stylesheet">
<script src=""></script>

Next, using Video.js is as simple as creating a <video> element, but with an additional data-setup attribute. At a minimum, this attribute must have a value of '{}', but it can include any Video.js options - just make sure it contains valid JSON!

  <source src="//" type="video/mp4"></source>
  <source src="//" type="video/webm"></source>
  <source src="//" type="video/ogg"></source>
  <p class="vjs-no-js">
    To view this video please enable JavaScript, and consider upgrading to a
    web browser that
    <a href="" target="_blank">
      supports HTML5 video

When the page loads, Video.js will find this element and automatically setup a player in its place.

If you don't want to use automatic setup, you can leave off the data-setup attribute and initialize a <video> element manually using the videojs function:

var player = videojs('my-player');

The videojs function also accepts an options object and a callback to be invoked when the player is ready:

var options = {};

var player = videojs('my-player', options, function onPlayerReady() {
  videojs.log('Your player is ready!');

  // In this context, `this` is the player that was created by Video.js.;

  // How about an event listener?
  this.on('ended', function() {
    videojs.log('Awww...over so soon?!');

If you're ready to dive in, the Slack channel!


Video.js is a free and open source library, and we appreciate any help you're willing to give - whether it's fixing bugs, improving documentation, or suggesting new features. Check out the contributing guide for more!

Video.js uses BrowserStack for compatibility testing.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Video.js is licensed under the Apache License, Version 2.0.