Plugins for the main mediaelement project
JavaScript CSS
Latest commit e9cda2d Feb 7, 2017 @ron666 ron666 committed on GitHub Merge pull request #10 from pvnr0082t/add-badge
add CDNJS version badge in


MediaElement.js Plugins


This repository contains plugins built for MediaElementJS.

Table of Contents


Download the package from, and reference any plugins you need from dist folder and add any configuration related to the plugin.

Or you can use a CDN; check or

For example, if you want to install Markers plugin do the following:

<script src="/path/to/mediaelement-and-player.min.js"></script>
<script src="/path/to/dist/markers/markers.min,js"></script>
        markerColor: '#ff0000',
        // other configuration elements

Some of them will contain CSS styles so place them after the main player stylesheet:

<link rel="stylesheet" href="/path/to/mediaelementplayer.min.css">
<link rel="stylesheet" href="/path/to/dist/postroll/postroll.min.css">

Guidelines to Contribute


Download it at and follow the steps to install it, or install node.js with npm.

Once installed, at the command prompt, type npm install, which will download all the necessary tools.

General Conventions

  • Tab size is 8 for indentation.
  • ALWAYS make changes to the files in the /src/ directory, and NEVER in /build/ directory. This is with the sole purpose of facilitating the merging (and further, the compiling) operation, and help people to see changes more easily.
  • Use JSDoc conventions to document code. This facilitates the contributions of other developers and ensures more quality in the product.
  • BEFORE PUSHING any changes, run npm run jshint to ensure code quality.
  • The file for the feature must be placed inside a folder matching its name (i.e, loop/loop.js).
  • Update package.json with a command under the script configuration to make sure it will be bundled and compiled properly. For more reference, review the file.
  • Make sure you also write comments about their purpose, and add them into the README file to keep documentation up-to-date.
  • You can also include CSS inside the feature folder, matching the name of the feature JS file and adding CSS styles for "legacy" and BEM naming convention.
.mejs__feature, .mejs-feature {
    // all your styles

Template to create a Feature

 * [Name of feature]
 * [Description]

// Feature configuration
Object.assign(mejs.MepDefaults, {
    // Any variable that can be configured by the end user belongs here.
    // Make sure is unique by checking API and Configuration file.
    // Add comments about the nature of each of these variables.

Object.assign(MediaElementPlayer.prototype, {

    // Public variables (also documented according to JSDoc specifications)

     * Feature constructor.
     * Always has to be prefixed with `build` and the name that will be used in MepDefaults.features list
     * @param {MediaElementPlayer} player
     * @param {$} controls
     * @param {$} layers
     * @param {HTMLElement} media
    build[feature_name]: function(player, controls, layers, media) {
        // This allows us to access options and other useful elements already set.
        // Adding variables to the object is a good idea if you plan to reuse 
        // those variables in further operations.
        let t = this;

        // All code required inside here to keep it private;
        // otherwise, you can create more methods or add variables
        // outside of this scope

    // Optionally, each feature can be destroyed setting a `clean` method

     * Feature destructor.
     * Always has to be prefixed with `clean` and the name that was used in MepDefaults.features list
     * @param {MediaElementPlayer} player
    clean[feature_name]: function(player, controls, layers, media) {}

    // Other optional public methods (all documented according to JSDoc specifications)

A word on ES6 for Features

All the features are written using Ecmascript 2015 specifications.

Seesrc/ directory, and check how the files were written to ensure compatibility.

Note: the for...of loop could have been used, but in order to bundle them and reduce the size of the bundled files, it is strongly recommended to avoid its use.

Available plugins


Changes available at Change Log