JavaScript CSS Other
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.github chore: make sure first-timers bot uses our template (#5001) Mar 12, 2018
build chore: generate a test example on netlify for PRs (#4912) Jan 30, 2018
docs feat: Allow techs to change poster if player option `techCanOverrideP… Mar 7, 2018
lang fix: Add alternate text to the loading spinner. (#4916) Feb 22, 2018
sandbox feat: add mediator middleware type for play() (#4868) Jan 30, 2018
src docs(time-ranges): fix wrong comment for getRange function (#5026) Mar 16, 2018
test fix(sourceset): set evt.src to empty string or src attr from load (#5016 Mar 15, 2018
.babelrc feat: Use Rollup to generate dist files (#4301) May 25, 2017
.editorconfig Added .editorconfig and travis CI badge Dec 11, 2012
.gitignore chore: gitignore all npm-debug.log.* (#4252) Apr 7, 2017
.jsdoc.json docs: make jsdoc generate anchor names so ToC links work (#4471) Jul 14, 2017
.npmignore docs: deploy docs using netlify (#4774) Dec 4, 2017
.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 6.7.4 Mar 5, 2018 docs(coc): introduce (#4160) Mar 23, 2017 docs: Update and to include lab… Jan 30, 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 chore: re-enable Greenkeeper 🌴 and make it update package-lock.json (#… Feb 20, 2018
composer.json Added a composer.json for PHP packages. closes #1241 Jun 14, 2014
package-lock.json 6.7.4 Mar 5, 2018
package.json 6.7.4 Mar 5, 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.