Video.js - open source HTML5 & Flash video player
Clone or download
Latest commit 74bbc5d Sep 13, 2018
Failed to load latest commit information.
.github chore(welcome bot): add welcome bot config (#5313) Jul 11, 2018
build feat(css): run autoprefixer on css (#5239) Jun 21, 2018
docs chore(https): update a lot of links to be https (#5372) Aug 10, 2018
lang fix(lang): Fixed typos in cs translation (#5407) Sep 4, 2018
sandbox fix(time-display): restore hidden label text for screen readers. (#5157) May 11, 2018
src fix(ResizeManager): fixup the null check (#5427) Sep 11, 2018
test fix: always return a promise from play, if supported (#5227) Aug 10, 2018
.babelrc refactor: remove IE8 specific changes (#5041) Mar 23, 2018
.editorconfig Added .editorconfig and travis CI badge Dec 11, 2012
.gitignore feat: built-in HLS playback support (#5057) Mar 30, 2018
.jsdoc.json chore(https): update a lot of links to be https (#5372) Aug 10, 2018
.npmignore chore(npmignore): don't publish zip file to npm (#5249) Jun 20, 2018
.nvmrc chore: switch to node 8 (#4813) Dec 14, 2017
.remarkignore chore(docs): Documentation Linting and TOC generation (#3841) Dec 20, 2016
.remarkrc.js chore(docs): Documentation Linting and TOC generation (#3841) Dec 20, 2016
.travis.yml chore: re-enable Greenkeeper 🌴 and make it update package-lock.json (#… Feb 20, 2018 7.2.3 Sep 13, 2018 docs(coc): introduce (#4160) Mar 23, 2017 docs(collaborator-guide): Clarify how to Land a PR using the GitHub UI ( May 23, 2018 docs: Update and to include lab… Jan 30, 2018
Gruntfile.js @gkatsev updated build system to open es5 folder for bundles and dist… Aug 17, 2016
LICENSE More build and testing cleanup. Also some reorganization. Apr 2, 2015 docs(examples): remove IE9 text track HTML markup in the doc/examples… May 23, 2018
composer.json chore(https): update a lot of links to be https (#5372) Aug 10, 2018
package-lock.json 7.2.3 Sep 13, 2018
package.json 7.2.3 Sep 13, 2018
postcss.config.js feat(css): run autoprefixer on css (#5239) Jun 21, 2018
rollup.config.js fix: build core script files as UMD (#5220) Jun 4, 2018

Video.js logo

Video.js - HTML5 Video Player

Build Status Coverage Status Greenkeeper badge Slack Status


Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 and Flash video, as well as YouTube and Vimeo (through plugins). It supports video playback on desktops and mobile devices. This project was started mid 2010, and the player is now used on over 50,000 100,000 200,000 400,000 websites.

Table of Contents

Quick Start

Thanks to the awesome folks over at Fastly, there's a free, CDN hosted version of Video.js that anyone can use. Add these tags to your document's <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.

In the CDN-hosted versions of Video.js we include a stripped down Google Analytics pixel that tracks a random sampling (currently 1%) of players loaded from the CDN. This allows us to see (roughly) what browsers are in use in the wild, along with other useful metrics such as OS and device. If you'd like to disable analytics, you can simply include the following global before including Video.js via the free CDN:

<script>window.HELP_IMPROVE_VIDEOJS = false;</script>

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

<!-- unpkg -->
<link href="" rel="stylesheet">
<script src=""></script>

<!-- cdnjs -->
<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 Getting Started page and documentation are the best places to go for more information. If you get stuck, head over to our 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.

Code of Conduct

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.