Video.js - HTML5 Video Player

Video.js Blog

Gary Katsevman2016-08-25

Video.js 5.12.0 and 5.11.5 releases

Today, there are two releases of video.js. The first, is a patch release for the 5.11 branch. With this release, we're also updating 5.11 to stable and publishing it to the CDN.

The 5.12 release is a pre-release. It's a pretty big milestone too. Video.js finally outputs non-pre-built files so bundlers like webpack can decide what to do with them.

Notable Changes

This release is mostly a maintenance and build-change release.

  • Lint the entire codebase with our linter and run the linter as a pre-push git hook.
  • Fix CSS issues in IE8.
  • Updated dependencies using Greenkeeper.io
  • Make video.js provide ES5 source files for bundlers like webpack and browserify to use. This also makes video.js requirable in node.
    • Video.js still provides a pre-build dist files for the CSS and JavaScript for those that aren't using bundlers.
  • We've added a grunt task called check-translations that will output a list of translations missing from language files based on the en.json file which serves as a template. If you know another lanugage, this would be an easy and quick way to get started contriburing to video.js!

Known Issues

No new known issues but we have started looking into the known issues from the last release.

Looking forward

Going forward, we're looking into switching to standard-version. This will allow us to accept PRs more easily and have the changelog generated for us. Also, this will make it easier for other core contributors to accept PRs. We've previously been using the contrib tool for accepting PRs and have the CHANGELOG generated automatically at that time but getting new people started with it for merging PRs was not the easiest experience.

Raw Changelog

  • @misteroneill, @BrandonOCasey, and @pagarwal123 updates all the code to pass the linter (view)
  • @misteroneill added ghooks to run linter on git push (view)
  • @BrandonOCasey removed unused base-styles.js file (view)
  • @erikyuzwa, @gkatsev updated CSS build to inlcude the IE8-specific CSS from a separate file instead of it being inside of sass (view) (view2)
  • @gkatsev added null checks around navigator.userAgent (view)
  • greenkeeper updated karma dependencies (view)
  • @BrandonOCasey updated language docs to link to IANA language registry (view)
  • @gkatsev removed unused dependencies (view)
  • @misteroneill enabled and updated videojs-standard and fixed an issue with linting (view)
  • @misteroneill updated tests to qunit 2.0 (view)
  • @gkatsev added slack badge to README (view)
  • @gkatsev reverted back to qunitjs 1.x to unbreak IE8. Added es5-shim to tests (view)
  • @gkatsev updated build system to open es5 folder for bundles and dist folder other users (view)
  • greenkeeper updated uglify (view)
  • greenkeeper updated grunt-concurrent (view)
  • greenkeeper updated karma-chrome-launcher (view)
  • @gkatsev added tests for webpack and browserify bundling and node.js requiring (view)
  • @rlchung fixed tests that weren't disposing players when they finished (view)

Git diffstats

These are deltas between 5.11.5 and 5.12.0 with the dist folder ignored.

 .babelrc                                           |   4 -
 .gitignore                                         |   1 -
 .jshintrc                                          |  49 ++
 .npmignore                                         |   1 -
 .travis.yml                                        |   2 +-
 CHANGELOG.md                                       |  26 -
 Gruntfile.js                                       |   2 +-
 README.md                                          |   2 -
 build/grunt.js                                     | 131 ++-
 build/tasks/cdn-links.js                           |   2 +-
 build/tasks/languages.js                           |  35 -
 build/tasks/saucelabs.js                           |  24 +
 component.json                                     |   2 +-
 docs/guides/languages.md                           | 164 +++-
 docs/translations-needed.md                        | 363 --------
 lang/de.json                                       |   8 +-
 lang/en.json                                       |   2 -
 lang/fr.json                                       |  19 +-
 package.json                                       |  80 +-
 src/css/_utilities.scss                            |   2 +-
 src/css/components/_control-bar.scss               |  16 +
 src/css/components/_fullscreen.scss                |   2 +
 src/css/components/_play-pause.scss                |   2 +
 src/css/components/_progress.scss                  |   2 +-
 src/css/components/menu/_menu.scss                 |   3 +-
 src/css/ie8.css                                    |  30 -
 src/js/base-styles.js                              |  18 +
 src/js/button.js                                   |  28 +-
 src/js/clickable-component.js                      |  29 +-
 src/js/component.js                                |  79 +-
 .../audio-track-controls/audio-track-button.js     |  11 +-
 .../audio-track-controls/audio-track-menu-item.js  |  18 +-
 src/js/control-bar/control-bar.js                  |  39 +-
 src/js/control-bar/fullscreen-toggle.js            |   2 +-
 src/js/control-bar/live-display.js                 |   2 +-
 src/js/control-bar/mute-toggle.js                  |  20 +-
 src/js/control-bar/play-toggle.js                  |   8 +-
 .../playback-rate-menu-button.js                   |  27 +-
 .../playback-rate-menu/playback-rate-menu-item.js  |  10 +-
 .../progress-control/load-progress-bar.js          |  22 +-
 .../progress-control/mouse-time-display.js         |  22 +-
 .../progress-control/play-progress-bar.js          |   6 +-
 .../progress-control/progress-control.js           |   5 +-
 src/js/control-bar/progress-control/seek-bar.js    |  41 +-
 .../progress-control/tooltip-progress-bar.js       |  10 +-
 .../spacer-controls/custom-control-spacer.js       |   4 +-
 .../caption-settings-menu-item.js                  |  18 +-
 .../text-track-controls/captions-button.js         |  13 +-
 .../text-track-controls/chapters-button.js         |  57 +-
 .../chapters-track-menu-item.js                    |  18 +-
 .../text-track-controls/descriptions-button.js     |  15 +-
 .../off-text-track-menu-item.js                    |  25 +-
 .../text-track-controls/subtitles-button.js        |   4 +-
 .../text-track-controls/text-track-button.js       |  17 +-
 .../text-track-controls/text-track-menu-item.js    |  36 +-
 .../time-controls/current-time-display.js          |  13 +-
 .../control-bar/time-controls/duration-display.js  |  15 +-
 .../time-controls/remaining-time-display.js        |   7 +-
 src/js/control-bar/track-button.js                 |   7 +-
 src/js/control-bar/volume-control/volume-bar.js    |  12 +-
 .../control-bar/volume-control/volume-control.js   |  10 +-
 src/js/control-bar/volume-menu-button.js           |  19 +-
 src/js/error-display.js                            |   5 +-
 src/js/event-target.js                             |  17 +-
 src/js/extend.js                                   |   7 +-
 src/js/fullscreen-api.js                           |   6 +-
 src/js/media-error.js                              |  57 +-
 src/js/menu/menu-button.js                         |  31 +-
 src/js/menu/menu-item.js                           |  10 +-
 src/js/menu/menu.js                                |  63 +-
 src/js/modal-dialog.js                             |  20 +-
 src/js/player.js                                   | 383 ++++-----
 src/js/plugins.js                                  |   2 +-
 src/js/popup/popup-button.js                       |  10 +-
 src/js/popup/popup.js                              |  11 +-
 src/js/poster-image.js                             |   7 +-
 src/js/setup.js                                    |  40 +-
 src/js/slider/slider.js                            |  34 +-
 src/js/tech/flash-rtmp.js                          |  25 +-
 src/js/tech/flash.js                               | 157 ++--
 src/js/tech/html5.js                               | 347 +++-----
 src/js/tech/loader.js                              |  20 +-
 src/js/tech/tech.js                                | 210 +++--
 src/js/tracks/audio-track-list.js                  |   5 +-
 src/js/tracks/audio-track.js                       |  10 +-
 src/js/tracks/html-track-element-list.js           |   4 +-
 src/js/tracks/html-track-element.js                |   8 +-
 src/js/tracks/text-track-cue-list.js               |  12 +-
 src/js/tracks/text-track-display.js                | 144 ++--
 src/js/tracks/text-track-list-converter.js         |  28 +-
 src/js/tracks/text-track-list.js                   |   6 +-
 src/js/tracks/text-track-settings.js               | 347 ++++----
 src/js/tracks/text-track.js                        |  51 +-
 src/js/tracks/track-enums.js                       |  29 +-
 src/js/tracks/track-list.js                        |  12 +-
 src/js/tracks/track.js                             |  13 +-
 src/js/tracks/video-track-list.js                  |   4 +-
 src/js/tracks/video-track.js                       |  10 +-
 src/js/utils/browser.js                            |  32 +-
 src/js/utils/buffer.js                             |   9 +-
 src/js/utils/dom.js                                |  95 +--
 src/js/utils/events.js                             | 429 +++++-----
 src/js/utils/fn.js                                 |   6 +-
 src/js/utils/format-time.js                        |   2 +-
 src/js/utils/guid.js                               |   2 +-
 src/js/utils/log.js                                |  14 +-
 src/js/utils/merge-options.js                      |  14 +-
 src/js/utils/stylesheet.js                         |   7 +-
 src/js/utils/time-ranges.js                        |  68 +-
 src/js/utils/to-title-case.js                      |   2 +-
 src/js/utils/url.js                                |  29 +-
 src/js/video.js                                    |  53 +-
 test/api/api.js                                    | 421 +++++-----
 test/globals-shim.js                               |   2 -
 test/index.html                                    |   2 -
 test/karma.conf.js                                 |  17 +-
 test/require/browserify.js                         |   8 -
 test/require/node.js                               |   9 -
 test/require/webpack.js                            |   8 -
 test/unit/button.test.js                           |  32 +-
 test/unit/clickable-component.test.js              |  31 +-
 test/unit/close-button.test.js                     |  22 +-
 test/unit/component.test.js                        | 639 +++++++--------
 test/unit/controls.test.js                         | 101 ++-
 test/unit/events.test.js                           | 240 +++---
 test/unit/extend.test.js                           |  20 +-
 test/unit/media-error.test.js                      |  69 --
 test/unit/menu.test.js                             |  54 +-
 test/unit/modal-dialog.test.js                     | 138 ++--
 test/unit/player.test.js                           | 912 ++++++++++-----------
 test/unit/plugins.test.js                          | 196 +++--
 test/unit/poster.test.js                           |  68 +-
 test/unit/setup.test.js                            |  20 +-
 test/unit/tech/flash-rtmp.test.js                  |  68 +-
 test/unit/tech/flash.test.js                       | 203 ++---
 test/unit/tech/html5.test.js                       | 491 +++++------
 test/unit/tech/tech-faker.js                       |  86 +-
 test/unit/tech/tech.test.js                        | 438 +++++-----
 test/unit/test-helpers.js                          |  71 +-
 test/unit/tracks/audio-track-list.test.js          | 108 ++-
 test/unit/tracks/audio-track.test.js               |  88 +-
 test/unit/tracks/audio-tracks.test.js              |  70 +-
 test/unit/tracks/html-track-element-list.test.js   |  50 +-
 test/unit/tracks/html-track-element.test.js        |  68 +-
 test/unit/tracks/text-track-controls.test.js       | 202 ++---
 test/unit/tracks/text-track-cue-list.test.js       |  79 +-
 test/unit/tracks/text-track-list-converter.test.js |  67 +-
 test/unit/tracks/text-track-list.test.js           |  23 +-
 test/unit/tracks/text-track-settings.test.js       | 178 ++--
 test/unit/tracks/text-track.test.js                | 203 +++--
 test/unit/tracks/text-tracks.test.js               | 401 +++++----
 test/unit/tracks/track-baseline.js                 |  37 +-
 test/unit/tracks/track-list.test.js                | 104 ++-
 test/unit/tracks/track.test.js                     |  16 +-
 test/unit/tracks/video-track-list.test.js          | 111 ++-
 test/unit/tracks/video-track.test.js               |  87 +-
 test/unit/tracks/video-tracks.test.js              |  71 +-
 test/unit/utils/dom.test.js                        | 426 ++++------
 test/unit/utils/fn.test.js                         |  13 +-
 test/unit/utils/format-time.test.js                |  48 +-
 test/unit/utils/log.test.js                        |  26 +-
 test/unit/utils/merge-options.test.js              |  16 +-
 test/unit/utils/time-ranges.test.js                |  49 +-
 test/unit/utils/to-title-case.test.js              |  10 +-
 test/unit/utils/url.test.js                        | 103 ++-
 test/unit/video.test.js                            | 186 ++---
 166 files changed, 5233 insertions(+), 6541 deletions(-)
Gary Katsevman2016-07-22

Video.js 5.11.0 Prelease

Today sees the prerelease of version 5.11.0. I wanted to take a moment to talk about some of the changes, additions, and known issues.

This is a pre-release only. It's available on npm under the next tag and also available on the CDN under the fully qualified version number: //vjs.zencdn.net/5.11.0/video.js. It'll stay in pre-release state for around a week or more to make sure that there aren't any glaring bugs, so, please give it a shot and open issues if you find anything.

Notable Changes

  • In version 5.0, we wanted to deprecate videojs.players property in favor of of the videojs.getPlayers() getter. However, it's proved to be very useful and it is now being un-deprecated so it will no longer print deprecations in the console.
  • If the player is created without a source set and a user hits play, video.js will now wait for the a source to be provided before starting playback. This eliminates an error that happens when we try to play an empty source.
  • Our custom captions settings dialog was updated to be more accessible by using more aria attributes and better option names in drop downs.

Known Issues

  • In video.js 5.10, to be able to better respond to the source of the video element changing directly without going through video.js, we disposed SourceHandlers on subsequent loadstarts and cleared out the current source. However, this causes an issue with videojs-contrib-dash. A contributor investigated and found out that the two PRs mentioned before cause the issue. If a video is created with an MPEG-DASH source element, we end up seeing a loadstart event because of the source element and then when Dash.js kicks in and starts playback using MSE, we get another loadstart event. Since we see the second loadstat event we dispose of the SourceHandler, that is, videojs-contrib-dash and Dash.js, and the video doesn't play. A work around, while we figure out a correct solution, would be not to use source elements with DASH sources and only use the video.js API in the meantime.

Raw Changelog

  • @BrandonOCasey Document audio/video track usage (view)
  • @hartman Correct documentation to refer to nativeTextTracks option (view)
  • @nickygerritsen Also pass tech options to canHandleSource (view)
  • @misteroneill Un-deprecate the videojs.players property (view)
  • @nickygerritsen Add title to all clickable components (view)
  • @nickygerritsen Update Dutch language file (view)
  • @hartman Add descriptions and audio button to adaptive classes (view)
  • @MattiasBuelens Retain details from tech error (view)
  • @nickygerritsen Fix test for tooltips in IE8 (view)
  • @mboles added loadstart event to jsdoc (view)
  • @hartman added default print styling (view)
  • @ldayananda updated videojs to not do anything if no src is set (view)
  • @nickygerritsen removed unused tracks when changing sources. Fixes ##3000 (view)
  • @vit-koumar updated Flash tech to return Infinity from duration instead of -1 (view)
  • @alex-phillips added ontextdata to Flash tech (view)
  • @MattiasBuelens updated components to use durationchange only (view)
  • @misteroneill improved Logging for IE < 11 (view)
  • @vdeshpande updated control text of modal dialog (view)
  • @ldayananda fixed mouse handling on menus by using mouseleave over mouseout (view)
  • @mister-ben updated language to inherit correctly and respect the attribute on the player (view)
  • @sashyro fixed nativeControlsForTouch option (view)
  • @tbasse fixed techCall null check against tech (view)
  • @rbran100 checked src and currentSrc in handleTechReady to work around mixed content issues in chrome (view)
  • @OwenEdwards fixed caption settings dialog labels for accessibility (view)
  • @OwenEdwards removed spurious head tags in the simple-embed example (view)
  • @ntadej added a null check to errorDisplay usage (view)
  • @misteroneill fixed logging issues on IE by separating fn.apply and stringify checks (view)
  • @misteroneill fixed npm test from running coveralls locally (view)
  • @gkatsev added es6-shim to tests. Fixes Flash duration test (view)
  • @misteroneill corrects test assertions for older IEs in the log module (view)
  • @gkatsev fixed setting lang by looping through loop element variable and not constant tag (view)

Git diffstats

These are deltas between 5.11.0 and 5.10.7

CHANGELOG.md                                       |    33 +
build/grunt.js                                     |     3 +-
component.json                                     |     2 +-
docs/examples/simple-embed/index.html              |     3 -
docs/guides/audio-tracks.md                        |    69 +
docs/guides/languages.md                           |    12 +-
docs/guides/text-tracks.md                         |   184 +
docs/guides/tracks.md                              |   186 +-
docs/guides/video-tracks.md                        |    70 +
docs/index.md                                      |     2 +-
lang/en.json                                       |     1 +
lang/nl.json                                       |    19 +-
package.json                                       |     7 +-
src/css/_print.scss                                |     5 +
src/css/components/_adaptive.scss                  |     9 +-
src/css/components/_captions-settings.scss         |    26 +-
src/css/video-js.scss                              |     2 +
src/js/clickable-component.js                      |    12 +-
.../control-bar/time-controls/duration-display.js  |     8 +-
.../time-controls/remaining-time-display.js        |     1 +
src/js/menu/menu-button.js                         |     4 +-
src/js/modal-dialog.js                             |     2 +-
src/js/player.js                                   |    68 +-
src/js/tech/flash-rtmp.js                          |     3 +-
src/js/tech/flash.js                               |    21 +-
src/js/tech/html5.js                               |    73 +-
src/js/tech/tech.js                                |    16 +-
src/js/tracks/text-track-settings.js               |   176 +-
src/js/utils/browser.js                            |     3 +
src/js/utils/create-deprecation-proxy.js           |    50 -
src/js/utils/log.js                                |   124 +-
src/js/video.js                                    |    16 +-
test/globals-shim.js                               |     1 +
test/unit/button.test.js                           |     5 +-
test/unit/player.test.js                           |    22 +-
test/unit/plugins.test.js                          |    20 +-
test/unit/tech/flash.test.js                       |    51 +-
test/unit/tech/html5.test.js                       |    16 +-
test/unit/tech/tech.test.js                        |    17 +-
test/unit/tracks/text-track-settings.test.js       |    51 +-
test/unit/tracks/text-track.test.js                |    13 +-
test/unit/utils/create-deprecation-proxy.test.js   |    45 -
test/unit/utils/log.test.js                        |   104 +-
103 files changed, 971 insertions(+), 55554 deletions(-)
Matthew McClure2015-06-08

It's here: 5.0 release candidates!

Today we’re releasing our first official 5.0 release candidate. We’re really excited to get this into the wild, but a lot has changed under hood. It should be stable for normal usage, but we’ve got a limited number of test devices (and testers for that matter), so what we need now is for people to bang on 5.0 and let us know what breaks!

You can either grab the master branch from Github and run grunt to create your own build, or we’ll push each new release candidate to the CDN. We’re going to be moving quickly and pushing new candidates when we uncover / fix bugs, so be sure to check for new versions! As of this post, the newest release is 5.0-rc.2. If you’d like to see a demo, we’ve got one up on JSBin.

What’s different?

New Base Theme

The most obvious difference you’ll see when you load up the release candidate is most likely going to be the new base theme. We’ve worked hard to simplify the theme and make it possible to do as much as possible with purely CSS.

screenshot

There are elements in the control bar that aren’t shown by default, but can be by simply overriding a little CSS. For example, if you’d rather use an inline volume control instead of the popup menu, you could make these changes:

css .video-js .vjs-volume-menu-button { display: none; } .video-js .vjs-mute-control, .video-js .vjs-volume-control { display: flex; }

This just hides the .vjs-volume-menu-button control, and unhides the mute control / inline volume control. Other things that are available but hidden by default are a time divider (.vjs-time-devider), total duration (.vjs-duration), and a spacer (.vjs-custom-control-spacer).

ES6

Thanks to the incredible Babel project, we’re able to write ES2015 and have it transpiled to ES5. It’s fantastic, and means we get glorious things such as string interpolation, so reading our codebase just got a whole lot ${_.sample(['better', 'awesomer', 'more fantastic', 'less plus-y'])}.

On our Wiki we have a page devoted to ES6 features we use extensively. There are probably a few little things missing, but if you familiarize yourself with those features you should feel comfortable reading the Video.js source.

We’re also using Browserify (with a Babelify transform), so now we’re able to take advantage of all the browser packages NPM has to offer. One big area this has allowed us to improve is utility functions, which are now provided by Lodash.

Plugins

Plugins are initialized earlier than before, giving plugin developers even more control over the player experience. They’re now initialized before other components are added (like the control bar), but after the player div is created. Keep in mind you’ll now need to wait for the ready event to do things such as append items to the control bar.

The plugin-development world should have also gotten more predictable since we’ve gotten a little less aggressive with our minification. Keep in mind that when you want to subclass a component externally (not using ES2015), you’ll want to use videojs.extends.

You can find more information on our 5.0 change details wiki page.

Want to be helpful?

Use it! We’ve spent months using this player in very specific ways while development, but there’s always the issue of “not being able to see the forest for the trees”. If you find issues while testing the player, please let us know on the issue tracker.

Matthew McClure2015-02-18

Video.js 4.12 - The last of the 4 minors

Much improved WebVTT support

We added basic WebVTT support really early on, which we were pretty proud of. As browsers added support, however, our shim started to lag a bit, or at the very least, cause issues with browsers that required native support (here’s looking at you, iOS).

So, we’re happy to announce that our text track support is vastly improved with this version! Instead of continuing to try and build out our own WebVTT parser, we’ve pulled in Mozilla’s fantastic work, VTT.js. This is the WebVTT implementation used in Firefox / Gecko, so we’re confident that this is a substantial leap forward for Video.js and our accessibility efforts.

Don’t use captions? Feeling disappointed?

You shouldn’t feel disappointed, this is a great day! This release includes a lot of fixes, and although fixes are always exciting to the people affected, other people can feel a hefty dose of “meh”. We’re excited to say, however, that this release is exciting for another, very important reason.

This is the last minor release in the version 4 family. There might be a few patches, but from now on, master is officially version 5.0-in-waiting. Party.

party

Notable updates and fixes for 4.12

  • The hide / show methods now toggle a class (.vjs-hidden) instead of applying inline styles. Make sure to update your stylesheet as well!
  • A new .vjs-scrubbing class gets applied while, you guessed it, scrubbing so menus can be prevented from erroneously showing on hover.
  • Improved url parsing in IE9.
  • Ever wondered what version you’re using? Now there’s a VERSION key. Woot.
  • New .vjs-ended class that’s added when playback reaches the end of the timeline (also known as: ended).
  • Player networkState and readyState properties available across techs
  • Video.js is now exported as a named AMD module
  • Mobile scrolling improvements
  • And more! Fixes galore!

Translation party continues

We’re now up to 19 community submitted translations! Entirely new translations in this release include:

  • Traditional Chinese
  • Vietnamese
  • Czech
  • Catalan
  • Bulgarian
  • Turkish

Video.js in the wild

To be terribly honest, there is a level of starstruck over a few of these. Normally we just do one, but hey…

Social Media

Global News Outlets

New plugins from the community

  • videojs-Background: A plugin that allows for videos to be displayed as a full background to any element.
  • videojs-brightcoveAnalytics: Allow tracking of views/impressions & engagement data in videojs for Brightcove videos
  • videojs-caption: Have the most flexibility and power for displaying caption videojs
  • videojs-transcript: Display an interactive transcript from caption or subtitle tracks.
  • videojs-autoplay-toggle: adds an autoplay toggle which will persist to cookies or localstorage.
  • videojs-offset: Allows you to play a segment of the video.
  • videojs-youtube-progress: Preserve progress seeker when control bar is hidden.
  • projectorjs: A small no-dependencies JavaScript library that enables the display of overlays on native HTML5 video elements, or (optionally) video elements powered by videojs.
  • videojs-record: A video.js plugin for recording audio/video files.
  • videojs-dashjs: Loads dash.js as a tech to support MPEG-DASH videos.
  • videojs-silverlight: Allows you to play WMV, WMA, MP4, MP3, WAV and FLAC medias through Silverlight within Video.js.
  • videojs-vlc: Allows you to play all media through VLC web plug-in within Video.js.
  • videojs-aurora: Allows you to play WAV, OGG, MP3, M4A, AAC and FLAC medias through Aurora.js within Video.js.
  • videojs-java: Allows you to play AIFF, AVI, GSM, MID, MPG, MP2, MOV, AU and WAV medias through Java within Video.js.

Raw list of changes

  • @PeterDaveHello added a Traditional Chinese translation (view)
  • @mmcc updated the hide/show functions to use a class instead of inline styles (view)
  • @mister-ben added better handling of the additional videojs() arguments when the player is already initialized (view)
  • @anhskohbo added a Vietnamese translation (view)
  • @Sxmanek added a Czech translation (view)
  • @jcaron23 added the vjs-scrubbing CSS class and prevented menus from showing while scrubbing (view)
  • @dmlap fixed URL parsing in IE9 (view)
  • @gkatsev Fixed issue where ManualTimeUpdatesOff was not de-registering events (view)
  • @brycefisher Added a guide on player disposal (view)
  • @toniher added a Catalan translation (view)
  • @mmcc added a VERSION key to the videojs object (view)
  • @mmcc fixed an issue with text track hiding introduced in #1681 (view)
  • @dmlap exported video.js as a named AMD module (view)
  • @dmlap fixed poster hiding when the loadstart event does not fire (view)
  • @chikathreesix fixed an object delete error in Chrome (view)
  • @steverandy fixed an issue with scrolling over the player on touch devices (view)
  • @mmcc improved tap sensitivity (view)
  • @mister-ben added a vjs-ended class when playback reaches the end of the timeline (view)
  • @dmlap Add network and ready state properties (view)
  • @woollybogger exported the hasClass function (view)
  • @DevGavin fixed the Chinese translation (view)
  • @iSimonWeb added font-path variable (view)
  • @shoshomiga added a Bulgarian translation (view)
  • @ragecub3 added a Turkish translation (view)
  • @gkatsev greatly improved text track support and implemented vtt.js as the webvtt parser (view)
  • @gkatsev fixed captions showing by default in Chrome and Safari (view)
  • @mister-ben fixed a woff warning in Firefox (view)

Matthew McClure2014-10-02

Video.js 4.9 - Now <audio> can join the party!

HTML5 Audio support

A common request we’ve seen is to be able to use Video.js with an <audio> tag, and now you can! Usage is almost identical, you can just include a data-setup={} attribute on an <audio> tag or initialize via Javascript.

<audio
  id="audio_example"
  class="video-js vjs-default-skin"
  controls
  preload="auto"
  width="600"
  height="600"
  poster="/img/awesome-album-art.png"
  data-setup="{}"
>
  <source src="/audio/awesome-music.mp3" type="audio/mp3" />
</audio>

The only differences in behavior are that the poster image and controls are never hidden. This allows you to keep up something like album art during playback rather than a black video element. Since there’s no interesting content to hide (other than the poster image), we leave the controls showing to mimic a familiar audio player experience.

Audio Screenshot

Note: The Flash fallback still doesn’t support audio-only sources, but we’d like to add that in the future. In the meantime, audio playback with MP3 and Ogg sources should work fine in any (modern) browser that’s not IE8, so enjoy!

More translations!

We’ve been really excited by the continued support in terms of new translations. This release contains Brazilian Portuguese, Japanese, Italian, French, and Korean, as well as some improvements to the previous Spanish translation. We’d love to see the trend continue, so if you’re fluent in a language please consider submitting improvements or whole new localizations!

Video.js in the wild

Coursera is an education platform that offers free courses online from some of the world’s top institutions. They’ve built great tools for video interaction on top of Video.js, and are even going to talk about some of the work they’re doing at October’s SF Video Meetup.

Coursera Screenshot

New Plugins

videojs-wavesurfer - Adds a navigable waveform for audio files, using the excellent wavesurfer.js library.

Full list of changes

  • @deedos added a Brazilian Portuguese translation (view)
  • @baloneysandwiches added a hasClass method (view)
  • @mynameisstephen fixed an issue where slider event listeners were not being cleaned up (view)
  • @alexrqs cleaned up the Spanish translation (view)
  • @t2y added a Japanese translation (view)
  • @chikathreesix fixed an issue where data-setup options could be missed (view)
  • @seniorflexdeveloper added new translations and translation updates (view)
  • @chikathreesix exported the videojs.Flash.embed method (view)
  • @doublex fixed an issue with IE7 backwards compatibility (view)
  • @mmcc made it possible to override the font-size of captions and subtitles (view)
  • @philipgiuliani added an Italian translation (view)
  • @twentyrogersc fixed the return value when setting the poster source (view)
  • @heff updated to swf v4.5.0 to fix event issues (view)
  • @rpless made the VolumeMenuButton volume more accesible via tab navigation (view)
  • @mmcc added support for audio tags (html5 audio only) (view)

Matthew McClure2014-09-03

Video.js 4.8.0 released...Prost!

This isn’t the flashiest minor release ever, but it’s hot off the press and ready for use. As mentioned in the last (few) release posts, we’re making a concerted effort to be more consistent with releases, so hopefully the trend of bite-sized, scheduled releases will continue.

Translations

We only just released localization with version 4.7, but we’ve already had two pull-requests for new translations! The German translation is included with this release, and you’ll find the French translation in the next patch release. If you’re fluent in another language, you can help Video.js be even more internationally accessible by submitting a pull request translating just 24 words / phrases. </shameless_plug>

Video.js in the wild

Heavybit Industries has a speaker series they host at their office, and they’ve been kind enough to start posting these sessions online in their library. The experience they’ve built using Video.js is impressive, including syncing the video progress with a transcript below the player.

Heavybit Screenshot

New plugins

Full list of changes

  • @andekande added a German translation (view)
  • @mattosborn fixed a bug where getting the video element src would overwrite it (view)
  • @songpete fixed a bug where keyboard events were bubbling and causing additional actions (view)
  • @knabar made the inactivity timeout configurable (view)
  • @seniorflexdeveloper added language files to the distribution for including specific languages (view)
  • @gkatsev improved handling of null and NaN dimension values (view)
  • @gkatsev fixed an issue where the controls would break if Flash was initialized too quickly (view)
  • @mmcc fixed an issue where if no playback tech was supported the error could not be caught (view)

Steve Heffernan2014-08-06

Video.js v4.7.0 - Built mostly by NEW contributors! Also Google chooses Video.js

We’re continuing to work hard on improving the contributor experience around the Video.js project and it’s paying off. Over half of the changelog is thanks to brand new contributors! Issues and pull requests are getting addressed faster than ever, and I was even allowed to give a talk at OSCON on some of the strategies we’re using. If you’re instersted in getting involved, join the #videojs IRC room or post an issue to let us know.

Google Chooses Video.js for Google Media Framework

Google recently announced a new framework for building video experiences and monetization. There are versions of the framework for native iOS and Android apps, and for the browser they chose to use Video.js. Check out their video.js plugin, and as it says in their announcement, “Stay tuned as well for a deeper dive into Video.js with IMA soon!”

Localization

In this release we’ve built the infrastructure for displaying text in other languages. Examples of text include error messages and text used for accessibility. This feature can extend to plugins as well.

Today you can include other languages by including the JSON translations object from the language you want with the player, like in this example for Spanish (es).

videojs.options.languages['es'] = { [translations object] }

You can find translations files in the lang folder of the project. We don’t have many translations yet, but we’re looking for translators if you’d like to help!

Multiple buffered regions

With HTML5 video you can skip ahead in the video and the browser will start downloading the part of the file needed for the new position, which is different from how Flash video works by default. Flash will download from the start to the end of the file so you can only skip ahead once it has download that part of the video.

In the HTML5 video API we’re given the buffered property which returns a list of time ranges that the browser has downloaded data for. Early on in HTML5 video, browsers only ever reported one time range, but now we have a direct view of what’s been downloaded.

In the newest version of the video.js skin you can see the specific regions.

We’ve kept it subtle so it’s not too big of a change. We’d love to hear your thoughts on it.

DASH Everywhere-ish

If you haven’t seen it yet, check out the post on Tom Johson’s work getting DASH supported in Video.js, using Flash or the new Media Source Extensions. MPEG-DASH is an adaptive streaming format that Netflix and YouTube are using to stream video to cutting-edge browsers. It has the potential to replace Apple’s HTTP Live Streaming format as the main format used for adaptive streaming.

Video.js on Conan!

Conan O'Brien’s TeamCoco site is using Video.js with a nicely customized skin and ads integration. Check it out!

New Skin by Cabin

The team at Cabin put together a simple and clean new skin for video.js.

New Plugins

A lot of great new plugins have been released!

  • videojs-ima: Easily integrate the Google IMA SDK into Video.js to enable advertising on your video content.
  • videojs-brightcoveAnyaltics: Allow tracking of views/impressions & engagement data in videojs for Brightcove videos
  • videojs-logobrand: Add a logo/brand image to the player that appears/disappears with the controls. (also useful as a basic plugin template for learning how Video.JS plugins work.)
  • videojs-seek: Seeks to a specific time point specified by a query string parameter.
  • videojs-preroll: Simple preroll plugin that displays an advertisement before the main video
  • videojs-framebyframe: Adds buttons for stepping through a video frame by frame
  • videojs-loopbutton: Adds a loop button to the player
  • videojs-ABdm: Use CommentCoreLibrary to show comments (which is called as DanMu) during playing.
  • videojs-hotkeys: A plugin for Video.js that enables keyboard hotkeys when the player has focus.

New Release Schedule

As part of improving the contributor experience we’re moving to scheduled releases. We’ll now put out a release every other Tuesday as long as there’s new changes to release. This will help give everyone a better idea of when specific features and fixes will become available.

Full list from the change log

  • Added cross-browser isArray for cross-frame support. fixes #1195 (view)
  • Fixed support for webvtt chapters. Fixes #676. (view)
  • Fixed issues around webvtt cue time parsing. Fixed #877, fixed #183. (view)
  • Fixed an IE11 issue where clicking on the video wouldn’t show the controls (view)
  • Added a composer.json for PHP packages (view)
  • Exposed the vertical option for slider controls (view)
  • Fixed an error when disposing a tech using manual timeupdates (view)
  • Exported missing Player API methods (remainingTime, supportsFullScreen, enterFullWindow, exitFullWindow, preload) (view)
  • Added a base for running saucelabs tests from grunt (view)
  • Added additional browsers for saucelabs testing (view)
  • Added support for listening to multiple events through a types array (view)
  • Exported the vertical option for the volume slider (view)
  • Fixed Component trigger function arguments and docs (view)
  • Now copying all attributes from the original video tag to the generated video element (view)
  • Added files to be ignored in the bower.json (view)
  • Fixed an error that could happen if Flash was diposed before the ready callback was fired (view)
  • The up and down arrows can now be used to control sliders in addition to left and right (view)
  • Added a player.currentType() function to get the MIME type of the current source (view)
  • Fixed a potential conflict with other event listener shims (view)
  • Added support for multiple time ranges in the load progress bar (view)
  • Added vjs-waiting and vjs-seeking css classnames and updated the spinner to use them (view)
  • Now restoring the original video tag attributes on a tech change to support webkit-playsinline (view)
  • Fixed an issue where the user was unable to scroll/zoom page if touching the video (view)
  • Added “sliding” class for when slider is sliding to help with handle styling (view)

Cheers,

-heff

Discuss on Twitter | Discuss on Hacker News

Steve Heffernan2014-05-20

Video.js version 4.6.0 released! It's been a productive month.

The video.js community has been in full force lately and it’s resulted in a lot of great features and fixes, including UI updates, better error messages, and even a Video.js Polymer element built by Addy Osmani himself.

New Live UI

Video.js has supported different forms of live video for a while, but a recent update has made the user experience a little clearer. Specifically, a ‘LIVE’ badge is added to the controls and the seek bar is hidden when seeking isn’t permitted.

Clearer Errors

A big effort went into improving error situations that developers and viewers might encounter. In cases where the viewer’s browser supports neither JavaScript nor HTML5 Video, a more helpful message is shown that informs the viewer how they can support video playback.

In cases where a common media error occurs (e.g. the file doesn’t exist or the network fails), an “X” icon is displayed showing that playback can’t continue, and a message is shown describing the issue. Additionally an error message is logged to the javascript console.

For developers, better logging functions have been added including videojs.log.error(), and they’re being used throughout the code base to provide better information and help track down issues.

IE11 Fullscreen

Video.js relies on native browser fullscreen even when Flash is used. IE11 is the first version of Internet Explorer to support native browser fullscreen, and video.js has now been updated to take advantage of that feature and provide a better fullscreen experience for those users.

Playback Rate Switching

If you ever wanted to speed up or slow down the rate of a video, now you can! HTML5 video browsers have been adding support for playback rate switching, and video.js now has an optional UI component that will let you select the speed. Flash however does not support playback rate switching, so unfortunately it’s not a feature that users on older browsers (e.g. IE8) can use.

See a demo.

New community plugins

The latest plugins to be added to the video.js plugins list.

  • videojs-vr: Project video onto different geometric shapes (Sphere, Cube, Cylinder) and view in 3d with optional Oculus Rift support
  • video-speed: Adds customizable video-speed control
  • OpenVideoAnnotation - create annotations in video-js using annotator
  • videojs-overlay: display simple HTML overlays during video playback
  • video.js-polymer: A video.js element for the Polymer web components framework

If you’d like a head-start on the scaffolding for a new video.js plugin, check out the Yeoman video.js plugin generator.

Full list from the change log

  • Updated the UI to support live video (view)
  • The UI now resets after a source change (view)
  • Now assuming smart CSS defaults for sliders to prevent reflow on player init (view)
  • Fixed the title element placement in menus (view)
  • Fixed title support for menu buttons (view)
  • Fixed extra mousemove events on Windows caused by certain apps, not users (view)
  • Fixed error due to undefined tech when no source is supported (view)
  • Fixed the progress bar not finishing when manual timeupdate events are used (view)
  • Added a more informative and styled fallback message for non-html5 browsers (view)
  • Added the option to provide an array of child components instead of an object (view)
  • Fixed casing on webkitRequestFullscreen (view)
  • Made tap events on mobile less sensitive to touch moves (view)
  • Fixed the default flag for captions/subtitles tracks (view)
  • Fixed compilation failures with LESS v1.7.0 and GRUNT v0.4.4 (view)
  • Added better error handling across the library (view)
  • Updated captions/subtiles file fetching to support cross-origin requests in older IE browsers (view)
  • Added support for playback rate switching (view)
  • Fixed an issue with the loadstart event order that caused the big play button to not hide (view)
  • Modernized the fullscreen API and added support for IE11 (view)
  • Added cross-browser testing with SauceLabs, and added Karma as the default test runner (view)
  • Fixed saucelabs integration to run on commits in TravisCI (view)
  • Added a clearer error message when a tech is undefined (view)
  • Added a cog icon to the font icons (view)
  • Added a player option to offset the subtitles/captions timing (view)

The new version is available on videojs.com and has been added to the CDN.

Cheers,

-heff

Steve Heffernan2014-03-27

Video.js version 4.5.0 released! Nothing to see here, move along

Well, sort of… this release is the result of a lot of hard work to speed up the version release process, meaning they’ll be coming a lot faster now with smaller sets of changes.

In this release we’ve added support for the Component(1) package manager, fixed the captions positioning when the controls are hidden, and helped Android devices know when they can support HLS. ;-) There were a few other changes as well but a lot of the work this round was done on the processes around the project. If you’ve spent time in the github issues, you’ll hopefully notice an improvement in the response rate on issues and the speed in which bugs get fixed.

New plugins

  • videojs-vast: A VideoJS plugin to play pre-roll videos from a VAST feed
  • videojs-comscore: Reports to comScore using their latest Streaming Tag SDK

Video.js in the wild

Toyota Europe! (click a video on that page) I was in Paris a few weeks ago and stopped by the Toyota store on Champs-Elysées. Next to the cars are multimedia touch screens that tell you details and allow you to watch videos. The video player looked kind of familiar, and sure enough it was video.js with a very nice custom skin. It turns out the Toyota Europe website uses video.js as well. Very cool.

If you find video.js on an interesting site somewhere, let us know in the comments.

Full list from the change log

  • Added component(1) support (view)
  • Captions now move down when controls are hidden (view)
  • Added the .less source file to the distribution files (view)
  • Changed src() to return the current selected source (view)
  • Added a grunt task for opening the next issue that needs addressing (view)
  • Fixed Android 4.0+ devices’ check for HLS support (view)

The new version is available on videojs.com and has been added to the CDN.

Cheers,

-heff

Steve Heffernan2014-02-19

Video.js version 4.4.0 released - Now supporting RequireJS and Browserify

Version 4.4.0 is here with over 20 updates and fixes. The most notable addition may be support for AMD and CommonJS module loaders, meaning you can now include Video.js using RequireJS or Browserify. Video.js can be installed through npm already, and we’ll soon add support for bower and component(1) as well.

New plugins

The plugin list continues to grow, with more in the works. Checkout the new endcard plugin built by The Onion.

Video.js in the wild

The Brightcove Play 2014 website recently went live with Video.js as the player. We’re also hard at work building Brightcove’s next-gen player with Video.js at the core, so stay tuned.

Full list from the changelog

  • Made the poster updateable after initialization (view)
  • Exported more textTrack functions (view)
  • Moved player ID generation to support video tags with no IDs (view)
  • Moved to using QUnit as a dependency (view)
  • Added the util namespace for public utility functions (view)
  • Fixed an issue with calling duration before Flash is loaded (view)
  • Added player methods to externs so they can be overridden (view)
  • Fixed html5 playback when switching between media techs (view)
  • Fixed Firefox+Flash mousemove events so controls don’t hide permanently (view)
  • Fixed a test for touch detection (view)
  • Updated the src file list for karma tests (view)
  • Added more tests for API properties after minification (view)
  • Updated projet to use npm version of videojs-swf (view)
  • Added support for dist zipping on windows (view)
  • Fixed iOS fullscreen issue (view)
  • Fixed touch event bubbling (view)
  • Fixed ARIA role attribute for button and slider (view)
  • Fixed and issue where a component’s dispose event would bubble up (view)
  • Quieted down deprecation warnings (view)
  • Update seek handle to display the current time (view)
  • Added requirejs and browserify support (UMD) (view)

The new version is available on videojs.com and has been added to the CDN.

Cheers,

-heff

Steve Heffernan2013-11-05

Video.js version 4.3.0 released w/ shiny new API docs

The biggest change in this update is actually an overhaul of the API docs. The best example of the new docs is the Player doc, which is the API most video.js users will work with.

The new docs are now automatically generated from the code and code comments, making it easier to keep them up to date with what’s currently in the codebase.

One interesting note about the doc-generator is that it uses esprima, a tool that reads javascript files and gives back the “abstract syntax tree” of the code.

For the following javascript:

var hi;

Esprima would generate:

{
    "type": "Program",
    "body": [
        {
            "type": "VariableDeclaration",
            "declarations": [
                {
                    "type": "VariableDeclarator",
                    "id": {
                        "type": "Identifier",
                        "name": "hi"
                    },
                    "init": null
                }
            ],
            "kind": "var"
        }
    ]
}

We’re using the AST of the video.js codebase to generate the majority of the information in the docs, which means it requires fewer comments and less work to keep the docs really great as we continue to build. If you’re interested in seeing how we’re handling that, check out the doc-generator repo (it’s currently only useful with the video.js codebase, but it could be extended to support more).

New CSS Options

Additional updates include new loading spinner icon options, and a new class for centering the big play button.

Many users have been clear that they’d prefer the big play button in the center of the video. While we feel the trend is still moving towards getting the play button out of the way of the content, we wanted to make this feature easier to customize. You can now use the vjs-big-play-centered class on your video tag to center the play button.

To try the new spinner icon options, check out the designer and change the icon name used by the spinner class.

Even more plugins!

Finally, the most exciting developments are actually happening in the video.js community, with more and more plugins being built. We’re up to 26 in the plugins list, with more on the way.

If you have some code you’ve built on top of video.js that you think might be valuable to others, please share it on the plugins list, or post an issue on the video.js repo if you have questions about the plugin process.

Full list from the changelog

  • Added Karma for cross-browser unit testing (view)
  • Unmuting when the volume is changed (view)
  • Fixed an accessibility issue with the big play button (view)
  • Exported user activity methods (view)
  • Added a classname to center the play button and new spinner options (view)
  • Added API doc generation (view)
  • Added support for codecs in Flash mime types (view)

The new version is available on videojs.com and has been added to the CDN.

Cheers,

-heff

Steve Heffernan2013-10-15

4.2.2 Patch Release

Two bugs have been squashed with this patch:

  • An issue most commonly seen in Firefox where video playback would break when a race condition would occur during video loading (#756)
  • An issue where the duration would get stuck at 0:00 when loading the player dynamically (#775)

See the changes made

This version can be downloaded on videojs.com, is available on the CDN, and the existing /4.2/ CDN version has been updated to 4.2.2. (may take time to propagate to your area)

Cheers,

-heff

Steve Heffernan2013-09-06

Video.js 4.2.0 released! RTMP, CSS designer, and stability

Happy September! The 4.2.0 release of Video.js has a few interesting updates, and a bunch of stability and polish.

RTMP Support

First of all, thanks to an impressive collaboration of community members, we now have RTMP support (in beta). Check out the example.

It’s still pretty basic support for RTMP, but we think it will cover a lot of the general use cases. The feature support includes:

  • Single stream (no client-side adaptive support)
  • Flash only, HTML5 video doesn’t support RTMP (but HLS is supported on iOS devices)
  • On-demand only. We haven’t updated the UI to support live yet.

To load an RTMP stream in a Video.js player, you’ll use a source tag in the same way you would other source types:

<source
  src="rtmp://your.streaming.provider.net/cfx/st/&amp;mp4:path/to/video.mp4"
  type="rtmp/mp4"
/>

The connection and stream parts are determined by splitting the URL on the first ampersand (&) or the last slash (/).

[http://myurl.com/streaming&amp;/is/fun](http://myurl.com/streaming&amp;/is/fun) --&gt;
  connection: [http://myurl.com/streaming](http://myurl.com/streaming)
  stream: /is/fun

-or-

[http://myurl.com/streaming/is/fun](http://myurl.com/streaming/is/fun) --&gt;
  connection: [http://myurl.com/streaming/is](http://myurl.com/streaming/is)
  stream: fun

The available source types include rtmp/mp4 or rtmp/flv.

RTMP has been a much requested feature over the years and it’s great to finally have it in the player. Thanks to everyone involved in that work.

Player Skin Designer

If you missed the previous blog post, be sure to check out the new interface for designing the player skin. It really shows off the customizability of the video.js controls, which are built completely in HTML and CSS.

With the 4.2 release the styles in the designer have been brought up-to-date with the latest player styles.

Control Bar Updates

Also in a previous post, I described a number of updates that were made to the control bar to fix cross browser/device issues and improve the overall functionality. As of 4.2.0 all of those updates have made it into the stable release.

Other Updates

Along with previous updates there’s been a number of patches and enhancements along the way. Here’s a full list:

  • Added LESS as a CSS preprocessor for the default skin (view)
  • Exported MenuButtons for use in the API (view)
  • Fixed ability to remove listeners added with one() (view)
  • Updated buffered() to account for multiple loaded ranges (view)
  • Exported createItems() for custom menus (view)
  • Preventing media events from bubbling up the DOM (view)
  • Major reworking of the control bar and many issues fixed (view)
  • Fixed an issue with minifiying the code on Windows systems (view)
  • Added support for RTMP streaming through Flash (view)
  • Made tech.features available to external techs (view)
  • Minor code improvements (view)
  • Updated time formatting to support NaN and Infinity (view)
  • Fixed an undefined error in cases where no tech is loaded (view)
  • Exported addClass and removeClass for player components (view)
  • Made the fallback message customizable (view)
  • Fixed an issue with the loading spinner placement and rotation (view)
  • Fixed an issue with fonts being flaky in IE8

The latest version can be found on videojs.com through the download link or the CDN hosted version.

Cheers,

-heff

Steve Heffernan2013-06-28

Video.js 4.1.0 Released

Just in time for the weekend, the next minor version of Video.js is now available. Updates include:

  • Turned on method queuing for unready playback technologies (flash) (view)
  • Blocking user text selection on player components (view)
  • Exported requestFullScreen() and cancelFullScreen() in the minified version (view)
  • Exported the global players reference, videojs.players (view)
  • Added google analytics to the CDN version (view)
  • Exported fadeIn/fadeOut for the Component API (view)
  • Fixed an IE poster error when autoplaying (view)
  • Exported bufferedPercent for the API (view)
  • Augmented user agent detection, specifically for Android versions (view)
  • Fixed IE9 canPlayType error (view)
  • Fixed various issues with captions (view)

You can get the latest version on videojs.com, either as a download or hosted on our CDN.

Have a great weekend!

-heff

Steve Heffernan2013-05-09

Video.js 4.0 now available!

Today we’re releasing Video.js 4.0, which is the most solid, lightweight, and I dare say prettiest version yet. It’s available for download, on Github, and hosted for free on our CDN.

Version 4.0 received the most community collaboration of any previous version, which speaks to the growing strength of the JavaScript community, the growing popularity of HTML5 video, and an increase in Video.js usage. Over the last year the number of sites using Video.js has more than doubled, and each month there are over 200 million hits to the CDN-hosted version alone! Thank you to all of the Video.js community members for contributing code and filing bug reports.

This version is also a milestone in that it’s the first version released since Brightcove acquired Zencoder last year. For those who missed the announcement, it was a very good thing for Video.js. In the past, Video.js was a side project for Zencoder that I maintained on top of my regular responsibilities (as if startup life isn’t exciting enough). Post-acquisition, Brightcove has not only put me full-time on Video.js, but the Brightcove video player team has become contributors to the project. The Brightcove team is probably the most experienced video player team in the world, supporting the most advanced video technology, for the biggest brands, across all the devices. It’s been a privilege to work with them and they’ve made major contributions to this version.

4.0 Major Feature Summary:

Improved performance through an 18% size reduction using Google Closure Compiler in advanced mode

  • Greater stability through an automated cross-browser/device test suite using TravisCI, Bunyip, and Browserstack.
  • New plugin interface and plugin listing for extending Video.js
  • New default skin design that uses font icons for greater customization
  • Responsive design and retina display support
  • Improved accessibility through better ARIA support
  • Moved to Apache 2.0 license
  • 100% JavaScript development tool set including Grunt

Improved Performance

With version 4.0, performance was our top priority, and a major factor of performance is the time it takes to load the library. What would seem to be minor size reductions can have a big impact, especially when a library will be loaded millions of times a month all over the world. We chose to use Google’s Closure Compiler because its “advanced mode” currently provides the most aggressive options for code minification, and so far we’ve seen an 18% reduction in code size, with the potential for more.

Closure Compiler also claims to rewrite code for better runtime performance, though we haven’t had a chance to benchmark this yet.

Some preliminary load-time benchmarking* shows:

  • Player load times in under 50 milliseconds
  • Playback start times in under 150 milliseconds
  • Actual video playback seen in under 0.5 seconds (using a CDN hosted MP4)

*Initial tests used Chrome with an empty cache on a modern MacBook Pro with a Wi-Fi connection. More formal testing to follow.

Greater Stability

Automated cross-browser, cross-device testing is the Holy Grail of testing for a JavaScript library. While building version 4.0, we’ve been able to reach that goal through the use of a number of tools, including:

  • TravisCI - Automatically runs unit tests through PhantomJS on every pull request made to the Video.js source code
  • Bunyip + Browserstack - Allows us to run tests in cloud-hosted instances of any browser from IE6 to the latest Chrome, and also a wide range of iOS and Android devices.

This ability to easily run tests across environments before any new release will give us more protection against regressions, and can allow for a faster feature release cycle.

New Plugin Interface

The new plugins API allows developers to more easily add custom features to Video.js. The API works similarly to the jQuery plugin interface, giving developers access to add to or overwrite any piece of Video.js. Once a plugin has been created, it can be shared on the Video.js plugin list page on the wiki.

New Default Skin

With help from the Brightcove UX team, we’ve created a new default skin that’s simpler, more polished, and more customizable. One of the most interesting features is that we’ve moved from using images for icons to font icons. The use of font icons allows you to change the color and size of the icons simply by changing a CSS value. You can see an example of this on the Video.js homepage.

Improved Accessibility

Greg Kraus, a Video.js community member from NCSU.edu, did some great work testing and improving Video.js accessibility through better use of ARIA roles. The changes make it so keyboard-only users, screen reader users, and voice-interface users will be able to interact with the video player. UPDATE: Read more in Greg’s blog post.

Moved to Apache 2.0 License

Earlier versions of Video.js were released under the LGPLv3 license. LGPL often gets confused with its stricter sibling, GPL, which requires that all code the software touches must also be open source. Video.js is meant to be open and free to use in all contexts, and we want that to be clear, so version 4.0 is now released under Apache 2.0, the same license Twitter Bootstrap is released under.

100% JavaScript Tool Set

Previously Video.js used Ruby for development tools, including Rake for deployment tasks, and zenflow–an internal Zencoder tool that builds on gitflow for development process workflow. With 4.0 we’ve moved to Grunt for tasks and we’re building out a tool similar to zenflow in Node.js.

Videojs.com Now Open Source

As part of this release we’ve also made the Videojs.com website open source. So if you see something that should be added or fixed, fork it.

What now?

Even with all of the updates listed above, this is simply a jumping-off point for what will be an exciting year for Video.js. We’re continuing to improve performance, multi-platform stability, and customizability through plugins and skins. Members of the community have already started work on plugins for some of the more requested features, like playlists, analytics, and advertising.

Follow @videojs or sign up for our newsletter to stay up-to-date on new features and roadmap updates.

If you’d like to get involved in the project, check out our contributing guide.

Cheers,
-heff

Steve Heffernan2012-03-23

Version 3.2 Update

First of all, check out the new video tag builder. The previous version of this site had an embed code builder, and people were pretty disappointed that the new site didn’t. So I’m happy to announce that it’s available again, now as an HTML5 video tag builder that could probably be used outside of Video.js, it includes track tags, and even lets you test the settings. Let me know if you have any feedback on it.

The most notable change in this release is probably the completely overhauled <track> tag support.

https://gist.github.com/4092295.js?file=html5-track-tag.html

The new version supports subtitles, captions, and even chapters. When you include tracks of different kinds, Video.js will automatically create menus in the player where users can select the language to display, or which chapter to jump to. Video.js also now supports the new WebVTT text format, which is not far off from the previously supported WebSRT format but did take some tweaking in the parser. Not all WebVTT placement features are supported yet, but the basics of displaying text are, and we’ll be working to get more WebVTT features built in.

Additionally there was work done to make some API methods accessible earlier. For any method that isn’t a getter (returns a specific value from the player), if you call the method before the playback technology (HTML5/Flash) is ready, it will now cache the call until it is ready. So where previously you might have had to wait for the ready callback:

https://gist.github.com/4092295.js?file=wait-for-ready.js

You could now do:

https://gist.github.com/4092295.js?file=no-wait-for-ready.js

Again, that’s just for methods where you are setting a value or triggering an action. If you try to get a value back like myPlayer.duration(), you’ll get nothing until the player is ready.

One other feature that was requested in the forums was automatically translating relative video URLs to absolute URLs for the flash fallback. This was an issue with the CDN hosted version which involved loading a remote SWF file which didn’t have the same context as the player. Before we would just tell people to use full URLs (http://) but that shouldn’t be an issue anymore.

Thanks to everyone that’s helped contribute code lately, and apologies for any long response times in the forums as I continue to try to push out code.

Here’s the full change log for the release.

3.2.0 / 2012-03-20 / baxter

  • Updated docs with more options.
  • Overhauled HTML5 Track support.
  • Fixed Flash always autoplaying when setting source.
  • Fixed localStorage context
  • Updated ‘fullscreenchange’ event to be called even if the user presses escape to exit fullscreen.
  • Automatically converting source URL to absolute for Flash fallback.
  • Created new 'loadedalldata’ event for when the source is completely downloaded
  • Improved player.destroy(). Now removes elements and references.
  • Refactored API to be more immediately available.

Cheers,
-Heff

Steve Heffernan2012-01-30

Version 3.1 Update

This is the first release since the initial 3.0 launch, aside from some hotfixes that went out immediately. It includes a number of fixes for things that users in the forums found right off the bat.

One feature that’s optional for testing in this release is iFrame Mode for Flash. One the of the unique things about Video.js is we haven’t built any controls into our Flash player, and instead use HTML and CSS to create the controls for the Flash side as well. This keeps the experience consistent and the Flash player very lightweight, however there’s a number of issues that you run into with Flash when you take an approach like this. If you’ve ever tried to resize the parent of a Flash object, or hide a Flash object and then show it again, you’ve probably run into the issue of Flash reloading in Firefox. This is a bug that’s been in Firefox for quite a long time however it looks like it might be fixed by version 13 (currently 9). To add on top of this, with the new browser fullscreen API, the other browsers now also reload Flash when you go to native fullscreen.

We’ve found a bit of a fix where if you embed the Flash object in an iframe first, it can get around the reloading in some of these cases. So in the new version there’s an option to turn this on and try it.

https://gist.github.com/4092929.js?file=iframe-mode.js

We’ll be doing some more testing to make sure it’s stable before we push it out to everyone.

Here’s the full change log for the release.

3.1.0 / 2012-01-30 / leonardo

  • Added CSS fix for Firefox 9 fullscreen (in the rare case that it’s enabled)
  • Replaced swfobject with custom embed to save file size.
  • Added flash iframe-mode, an experimental method for getting around flash reloading issues.
  • Fixed issue with volume knob position. Improved controls fading.
  • Fixed ian issue with triggering fullscreen a second time.
  • Fixed issue with getting attributes in Firefox 3.0
  • Escaping special characters in source URL for Flash
  • Added a check for if Firefox is enabled which fixes a Firefox 9 issue
  • Stopped spinner from showing on ‘stalled’ events since browsers sometimes don’t show that they’ve recovered.
  • Fixed CDN Version which was breaking dev.html
  • Made full-window mode more independent
  • Added rakefile for release generation

Cheers,
-Heff

Steve Heffernan2012-01-10

Video.js Version 3.0!

After months and months of work we’re happy to announce Video.js version 3.0. Some of the exiting new features include:

  • Same HTML/CSS Skin for both HTML5 and Flash video
  • Super lightweight Flash fallback player for browsers that don’t support HTML5 video
  • Free CDN hosting by Level3 A lot more releases and developments are on their way!

Cheers,
-Heff

Steve Heffernan2010-12-10

2.0.2 Release - Subtitle Optimization + Safari on Leopard FS Fix

Smallish update with some fixes and optimizations. Rewrote the subtitles parser so it’s a lot more optimized and fixes a subtitle display bug. Put in a check for Safari running on Mac OSX 10.5 (Leopard), which doesn’t like native fullscreen for some reason. Triggering full window mode instead.

Full List

  • Feature: Rewrote and optimized subtitle code.
  • Feature: Protecting against volume ranges outside of 1 and 0.
  • Fix: Bug in Safari for Mac OS 10.5 (Leopard) that was breaking fullscreen.

Download version 2.0.2

Steve Heffernan2010-11-22

2.0.0 Release - Behaviors, fallback APIs, and more.

Big update. The biggest change for current users is a move back to using DIVs for control bar elements instead of unordered lists. There were a lot of conflicting styles issues when using lists, which shouldn’t be an issue with divs. So if you upgrade, don’t forget to upgrade your stylesheets as well.

Beyond that, a lot of code was reorganized and modularized to create a platform for further expansion, like custom plugins and controls. The concept of “behaviors” was added, so you can activate any element on the page to act like a video controls. For instance, the following code snippet will make the specified element act like a play button, and play the video when clicked.

myplayer.activateElement(myElement, "playButton");

The next code snippet will make the element act like a play progress bar, meaning it will grow horizontally as the video plays.

myplayer.activateElement(myElement, "playProgressBar");

More documentation on this is coming.

The code is now prepped for APIs to the fallback flash players. So if you call myPlayer.play(), it will trigger a play in both the HTML5 and the Flash version, whichever is currently being used. A flowplayer API is just about done, and other popular Flash players will follow.

Finally, you can change the fallback order by modifying the playerFallbackOrder option, which is an array of player platforms. So if you want Flash to be dominant, you would pass the following option.

VideoJS.setupAllWhenReady({
  playerFallbackOrder: ["flash", "html5", "links"]
});

This also leaves room for other platforms to be added, like Quicktime.

So coming up is Flash player APIs, and another cool feature I don’t want to mention just yet.

Full list:

  • Feature: Created “behaviors” concept for adding behaviors to elements - Feature: Switched back to divs for controls, for more portable styles
  • Feature: Created playerFallbackOrder array option. [“html5”, “flash”, “links”]
  • Feature: Created playerType concept, for initializing different platforms
  • Feature: Added play button for Android
  • Feature: Added spinner for iPad (non-fullscreen)
  • Feature: Split into multiple files for easier development
  • Feature: Combined VideoJS & V into the same variable to reduce confusion
  • Fix: Checking for m3u8 files (Apple HTTP Streaming)
  • Fix: Catching error on localStorage full that safari seems to randomly throw
  • Fix: Scrubbing to end doesn’t trigger onEnded

Download version 2.0.0

Steve Heffernan2010-11-09

1.1.5 Release - Subtitles using track, Android fix & more

  • Feature: Switched to track method for setting subtitles. Now works like spec.
  • Feature: Created “players” concept for defining fallbacks and fallback order
  • Fix: Android playback bug.
  • Fix: Massive reorganization of code to make easier to navigate

I’ve switched the subtitles to use the new track element defined in the HTML5 spec. You can now add subtitles by creating a track element pointing to your WebSRTsubtitles source.

<video ...>
  <track kind="subtitles" src="../demo-subtitles.srt" srclang="en-US" label="English"></track>
</video>

The closing track tag is needed, otherwise Safari thinks everything else is a child of the track, even with a self-closing track tag. Not sure why that is, but it’s kind of annoying.

Also a fix for Android playback was added. Android HTML5 video is pretty rough. The canPlayType function returns nothing on Android so VideoJS has a check to see if the source is mp4/m4v, and assumes it’ll play. Then VideoJS adds a click event to the video so it’ll play when you touch it. Also the Android will show the poster image, but no indication that it’s a video and not just an image. Hopefully this will be improved in the next Android version.

Beyond that, I did a massive reorganization of the code, so it should be easier to navigate if you’re planning to hack at it or contribute.

Download version 1.1.5

Steve Heffernan2010-11-06

Version 1.1.4 Release - CSS Loading Spinner & More

The most notable update in this version is a loading indicator (spinner), for when the video is buffering or seeking. The spinner works pretty well, however it’s limited by how accurately each browser tells us what it’s currently doing through triggered events. The spinner works best in Firefox so far. Safari/Chrome are less consistent with what events are triggered and when. For this reason I’m using a more careful approach that makes sure the spinner gets hidden, as opposed to making sure the spinner always shows when the player is busy. There’s a few bugs I had to account for too, like when Safari throws a “waiting” event, but then no other event to let us know it’s not waiting anymore.

The spinner icon is made with CSS3 effects (border-radius and transform). The spinning animation is created with a little javascript for now. In webkit browsers the animation could have been done with CSS3 animation, but I’d rather keep it consistent between browsers. The technique comes from Kilian Valkhof with initial integration into VideoJS by Janez Troha (dz0ny)

Other features and fixes include:

  • Feature: Added loading spinner.
  • Feature: Improved styles loaded checking.
  • Feature: Added volume() function to get and set volume through the player. - Fix: Fix issue where FF would loop video in background when ended.
  • Fix: Bug in Chrome that shows poster & plays audio if you set currentTime too quickly.
  • Fix: Bug in Safari where waiting is triggered and shows spinner when not needed
  • Fix: Updated to show links if only unplayable sources and no Flash.
  • Fix: Issue where if play button was loaded after play, it wouldn’t hide.

Download version 1.1.4

Steve Heffernan2010-10-19

Version 1.1.3 Release

Version 1.1.3 of VideoJS is now available.

Probably the most notable change is a switch to using a big play button before the movie plays for the first time, as opposed to showing the control bar. The main reason for doing this is actually a bug in Safari. If you try to call any functions on the video other than play, before the video has loaded, Safari will error out. Some people mentioned that fullscreen mode did not work in Safari for them, and this is most likely what was happening for them. This would only happen if you were not preloading the video. You can still go back to showing the controls first through the showControlsAtStart option, but it’s not recommended.

Other features and fixes include:

  • Feature: Width/Height functions for resizing the player
  • Feature: Made initial click & hold trigger new value on progress and volume
  • Feature: Made controls not hide when hovering over them
  • Fix: Removed trailing comma that was breaking IE7
  • Fix: Removed some vars from global scope
  • Fix: Changed a document.onmousemove to an eventListener to prevent conflicts
  • Fix: Added a unique ID to FlowPlayer demo object to fix a FlowPlayer bug. Thanks @emirpprime.
  • Fix: Safari error on unloaded video

Let me know if you have any questions.