Open-source project
mediaelement/mediaelement avatar
mediaelement/mediaelement

mediaelement/mediaelement: one HTML5 player API across browsers and streaming formats

HTML5 <audio> or <video> player with support for MP4, WebM, and MP3 as well as HLS, Dash, YouTube, Facebook, SoundCloud and others with a common HTML5 MediaElement API, enabling a consistent UI in all browsers.

8,296 stars1,535 forksJavaScriptMIT

At a glance

What is it?
MediaElement.js wraps native audio and video in a single HTML5 MediaElement API, adding HLS, Dash and third-party sources such as YouTube and SoundCloud behind the same UI. It suits teams that must keep one player interface across old and new browsers, and it is the wrong tool for anyone who wants the browser's native controls left untouched.
Who is it for?
Adopt MediaElement.js when you need one player API and one set of controls across browsers and source formats, and you are willing to read the docs folder rather than a single README page. Do not adopt it if native browser controls are enough, or if you cannot accept a build that still carries a Flash-era compatibility layer and a Grunt toolchain.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 141 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem MediaElement.js solves: one player API, many source formats

Browsers do not agree on which media formats they can play, and they do not agree on how the player looks. A native <video> element renders differently in every browser, and a format that plays in one browser can fail silently in another. MediaElement.js addresses both problems at once. It presents a single HTML5 MediaElement API for audio and video, and the README describes it as "One file. Any browser. Same UI." The supported source list goes past plain MP4, WebM and MP3: the repository description names HLS, Dash, YouTube, Facebook and SoundCloud as well.

The audience is front-end teams that ship a player as part of a product and cannot let the controls change shape per browser. It is also aimed at projects with a long tail of older browsers, since the README states support for IE11+, MS Edge, Chrome, Firefox, Safari, iOS 8+ and Android 4.0+. That range is unusually wide for a media player, and it explains most of the design decisions in the codebase.

How the player is put together: core, renderers and a shared API

The repository layout shows the split clearly. The package main entry is full.js, with standalone.js as a smaller build, and the source lives in src/ with build output in build/ and media assets in media/. The demo folder carries index.html plus demo.js and demo.min.js, along with WebVTT caption files such as english.vtt and german.vtt, which is where the caption and chapter behaviour can be inspected without writing anything.

The API surface is documented separately from the README. The README points to docs/installation.md for install, docs/usage.md for creating instances, docs/api.md for options, and docs/utils.md for utilities and feature detection. That structure matters: the README itself is an index, not a manual. Anyone who reads only the README and then files an issue is told, in the README's own words, to read the whole documentation first.

The streaming and third-party sources are not baked into the core build. The README directs readers to mediaelement-plugins for additional features, so HLS, Dash and the social platforms are plugin territory rather than core. That is a reasonable boundary, but it means the feature list in the description is really a feature list of the ecosystem, not of the package you get from npm alone.

Installing MediaElement.js and playing a first file

The README does not inline install commands. It states that the full installation documentation is in docs/installation.md, and the package is published on npm under the name mediaelement with version 7.1.0 in package.json. The package also appears on CDNJS and jsDelivr, both of which the README links as badges. So the practical starting point is either a package manager or a CDN script tag, and the exact snippet should be taken from docs/installation.md rather than guessed.

Once the files are present, the usage pattern is to mark up a normal media element and let the player take it over. The demo folder shows the intended shape of a page, and docs/usage.md covers instance creation. The README does not print the markup itself, so the only concrete file references available are the ones the repository ships: demo/index.html, demo/demo.js and the WebVTT tracks english.vtt and german.vtt. Read demo/index.html first, then docs/usage.md, and copy the initialisation call from there.

For development work, the repository uses Grunt. Gruntfile.js sits at the top level and the devDependencies list grunt, grunt-browserify, grunt-babel, grunt-contrib-uglify and grunt-eslint, among others. The npm test script runs Mocha through Istanbul for coverage. That is a 2017-era toolchain, and it shows in the dependency versions.

Where MediaElement.js gets in the way

The compatibility promise has a cost. Supporting IE11 and Android 4.0 means the codebase carries a Flash-era topic tag and a build pipeline built around Babel 6, Browserify 13 and Grunt 1. A modern project that only targets current browsers will find that weight hard to justify, and the devDependency list is a fair proxy for how much of the stack is legacy.

The documentation is also spread thin. The README is a table of contents that points at docs/installation.md, docs/usage.md, docs/api.md, docs/utils.md, docs/guidelines.md and docs/resources.md. There is a MIGRATION.md for moving between versions and a changelog.md, but nothing in the README describes rollback, and the README does not document what happens when a source format is unsupported at runtime. If you need a guaranteed error path for an unplayable stream, plan to build it yourself on top of the events API.

Finally, the streaming formats are not in the box. If your requirement is HLS or Dash playback and you install only the core package, you have not solved your problem yet. The README sends you to mediaelement-plugins for that, which adds another dependency to track and another version to keep aligned with the player.

MediaElement.js compared with leaving the native element alone

The obvious alternative is the browser's own <video> and <audio> elements with the controls attribute. The difference is not cosmetic. Native controls are rendered by the browser, so their appearance, keyboard behaviour and menu contents are outside your control and differ between Chrome, Firefox and Safari. MediaElement.js replaces them with its own HTML and CSS, which is exactly why the README can promise the same UI everywhere. If your product needs a consistent control bar and a consistent caption button, that is the reason to take on the dependency.

If you only need playback in current browsers and you are happy with native controls, the native element is smaller, has no build step and cannot fall out of sync with a plugin. The trade is that you also give up the unified API across formats and the older-browser support. A second alternative is a different player library, but the README does not name one, and the repository does not compare itself to anything, so there is no in-repo basis for a feature-by-feature comparison.

The honest framing is that MediaElement.js buys uniformity and reach, and it charges for them in bundle weight, a legacy build chain and a documentation set you have to read in full.

Maintenance, licensing and the cost of upgrading

The repository is not archived, and the last push was on 2026-05-12. The most recent release in the list is 7.1.0 from 2025-11-12, following 7.0.7 and 7.0.6 in December 2024. Releases are therefore infrequent rather than routine, and the distance between 7.0.7 and 7.1.0 suggests minor-version jumps carry real changes. Anyone planning an upgrade should read changelog.md and MIGRATION.md before touching package.json, because the repository ships both files for that purpose.

The licence is MIT, stated in package.json and in the README, with the README's own plain-language summary: use everywhere, keep copyright, and a link back is appreciated. For most teams that means no copyleft obligation on application code, but the copyright notice must be preserved in distributions. That is a description of the licence text, not legal advice; if the player is embedded in a product with unusual distribution terms, have counsel read the licence.

Upgrade cost is mostly the build chain. The devDependencies pin Babel 6, Browserify 13, Grunt 1 and Mocha 3. If your project has moved to a modern bundler, you are consuming the built output rather than building the source, and that is the lower-risk path.

Editorial conclusion

Adopt MediaElement.js when you need one player API and one set of controls across browsers and source formats, and you are willing to read the docs folder rather than a single README page. Do not adopt it if native browser controls are enough, or if you cannot accept a build that still carries a Flash-era compatibility layer and a Grunt toolchain. Before committing, verify the current version on npm, check the MIGRATION.md steps for your starting version, and confirm that the source format you need is covered by the core build or by mediaelement-plugins.

Frequently asked questions

What is MediaElement.js?

It is an HTML5 audio and video player built on top of MediaElement.js, providing a common HTML5 MediaElement API so the same UI works across browsers. The README describes it as a complete HTML/CSS audio/video player and points to docs/installation.md and docs/usage.md for setup.

What are the features of the mediaelement player?

It plays MP4, WebM and MP3 as well as HLS, Dash, YouTube, Facebook and SoundCloud sources, and it exposes a shared API with options documented in docs/api.md. Caption tracks are supported, and the demo folder ships WebVTT files such as english.vtt and german.vtt.

Which browsers does MediaElement.js support?

The README states support for IE11+, MS Edge, Chrome, Firefox, Safari, iOS 8+ and Android 4.0+. That range is why the project carries older build tooling and a Flash-related topic tag.

Is MediaElement.js free to use?

Yes. The licence is MIT, declared in package.json and the README, and the README's summary is to use it everywhere, keep the copyright, and link back if you can.

How do I install MediaElement.js?

The README does not inline the steps; it says the full installation documentation is in docs/installation.md. The package is published on npm as mediaelement, currently version 7.1.0, and the README also links CDNJS and jsDelivr badges.

Official sources

  1. License: MIT
  2. mediaelement/mediaelement on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mediaelement-mediaelement.svg)](https://hysenlabs.com/projects/mediaelement-mediaelement)