- Notifications
You must be signed in to change notification settings - Fork7.5k
Video.js - open source HTML5 video player
License
videojs/video.js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Update: Big changes coming in Video.js 10, early 2026!Read the discussion.
Video.js is a full featured, open source video player for all web-based platforms.
Right out of the box, Video.js supports all common media formats used on the web including streaming formats like HLS and DASH. It works on desktops, mobile devices, tablets, and web-based Smart TVs. It can be further extended and customized by a robust ecosystem ofplugins.
Video.js was started in May 2010 and since then:
- Millions of websites have used VideoJS over time (sourceBuiltwith)
- Billions of end-users every month of just the CDN-hosted copy (source Fastly stats)
- 900+ amazing contributors to the video.js core
- Hundreds ofplugins
Thanks to the awesome folks over atFastly, there's a free, CDN hosted version of Video.js that anyone can use. Add these tags to your document's<head>:
<linkhref="//vjs.zencdn.net/8.23.4/video-js.min.css"rel="stylesheet"><scriptsrc="//vjs.zencdn.net/8.23.4/video.min.js"></script>
Alternatively, you can include Video.js by getting it fromnpm, downloading it fromGitHub releases or by including it viaunpkg or another JavaScript CDN, like CDNjs.
<!-- unpkg : use the latest version of Video.js --><linkhref="https://unpkg.com/video.js/dist/video-js.min.css"rel="stylesheet"><scriptsrc="https://unpkg.com/video.js/dist/video.min.js"></script><!-- unpkg : use a specific version of Video.js (change the version numbers as necessary) --><linkhref="https://unpkg.com/video.js@8.23.4/dist/video-js.min.css"rel="stylesheet"><scriptsrc="https://unpkg.com/video.js@8.23.4/dist/video.min.js"></script><!-- cdnjs : use a specific version of Video.js (change the version numbers as necessary) --><linkhref="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.23.4/video-js.min.css"rel="stylesheet"><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.23.4/video.min.js"></script>
Next, using Video.js is as simple as creating a<video> element, but with an additionaldata-setup attribute. At a minimum, this attribute must have a value of'{}', but it can include any Video.jsoptions - just make sure it contains valid JSON!
<videoid="my-player"class="video-js"controlspreload="auto"poster="//vjs.zencdn.net/v/oceans.png"data-setup='{}'><sourcesrc="//vjs.zencdn.net/v/oceans.mp4"type="video/mp4"></source><sourcesrc="//vjs.zencdn.net/v/oceans.webm"type="video/webm"></source><sourcesrc="//vjs.zencdn.net/v/oceans.ogv"type="video/ogg"></source><pclass="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that<ahref="https://videojs.com/html5-video-support/"target="_blank"> supports HTML5 video</a></p></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 thedata-setup attribute and initialize a<video> element manually using thevideojs function:
varplayer=videojs('my-player');
Thevideojs function also accepts anoptions object and a callback to be invoked when the player is ready:
varoptions={};varplayer=videojs('my-player',options,functiononPlayerReady(){videojs.log('Your player is ready!');// In this context, `this` is the player that was created by Video.js.this.play();// How about an event listener?this.on('ended',function(){videojs.log('Awww...over so soon?!');});});
If you're ready to dive in, theGetting Started page anddocumentation are the best places to go for more information. If you get stuck, head over to ourSlack!
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 thecontributing guide for more! Contributions and project decisions are overseen by theVideo.js Technical Steering Committee (TSC).
By submitting a pull request, you agree that your contribution is provided under theApache 2.0 License and may be included in future releases. No contributor license agreement (CLA) has ever been required for contributions to Video.js. See theDeveloper's Certificate of Origin 1.1.
Please note that this project is released with aContributor Code of Conduct. By participating in this project you agree to abide by its terms.
Video.js islicensed under the Apache License, Version 2.0. "Video.js" is a registered trademark ofBrightcove, Inc.
Project development is sponsored by the role ofCorporate Shepherd, held by various companies throughout the project history:
- 2010-2012: Zencoder Inc.
- 2013-2025:Brightcove Inc.
- 2025-present:Mux Inc.
Video.js usesBrowserStack for compatibility testing.
The free CDN-hosted copy of the libray is sponsored byFastly.
Website hosting is sponsored byNetlify
About
Video.js - open source HTML5 video player
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.

