# MediaElement.js — Unified HTML5 Audio and Video Player
> A full-featured HTML5 media player with a consistent UI across browsers, Flash/Silverlight fallbacks for legacy support, and plugins for HLS, DASH, YouTube, and more.
## Install
Save as a script file and run:
# MediaElement.js — Unified HTML5 Audio and Video Player
## Quick Use
```bash
npm install mediaelement
```
```html
```
## Introduction
MediaElement.js provides a consistent HTML5 audio and video player interface that looks and behaves the same across all browsers. It wraps the native HTML5 media element with a skinnable UI layer and extends format support through renderers for HLS, DASH, FLV, YouTube, Vimeo, and other sources.
## What MediaElement.js Does
- Wraps HTML5 audio and video elements with a customizable player UI
- Provides consistent playback controls across all modern browsers
- Extends format support via HLS.js, DASH.js, and FLV.js renderers
- Embeds YouTube, Vimeo, Dailymotion, and other external sources
- Supports accessibility features including keyboard navigation and ARIA labels
## Architecture Overview
MediaElement.js uses a renderer abstraction layer that normalizes the API across different playback backends. The core MediaElement shim exposes play, pause, seek, and volume methods regardless of whether playback is handled by native HTML5, HLS.js, DASH.js, or an embedded iframe. The player UI is built as a separate layer on top, using CSS and JavaScript to render controls, progress bars, volume sliders, and track selectors. Plugins hook into the player lifecycle via named events.
## Self-Hosting & Configuration
- Install via npm or include the CSS and JS files from a CDN
- Initialize with ``new MediaElementPlayer(selector, options)``
- Set ``renderers`` array to control which playback backends are tried
- Customize the control bar by listing desired features in the ``features`` array
- Add subtitle tracks using standard ``