# Plyr A simple, accessible HTML5 media player. [Checkout the demo](http://plyr.io) ## Why? We wanted a lightweight, accessible and customisable media player that just supports *modern* browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job. ## Features - **Accessible** - full support for captions and screen readers. - **Lightweight** - just 4.8KB minified and gzipped. - **Customisable** - make the player look how you want with the markup you want. - **Semantic** - uses HTML5 form inputs for volume (range) and progress element for playback progress. - **Responsive** - any screen size. - **No dependencies** - written in vanilla JavaScript. - **API** - easy to use API. - **Fallback** - if there's no support, the native players are used. - **Fullscreen** - options to run the player full browser or the user can toggle fullscreen. ## Changelog Check out [the changelog](changelog.md) ## Planned development - Accept a string selector, a node, or a nodelist for the `container` property of `selectors`. - Accept a selector for the `html` template property. - Multiple language captions (with selection) - Localisation of control labels If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/Selz/plyr/issues/new) or of course, forking and sending a pull request. ## Implementation Check `docs/index.html` and `docs/dist/docs.js` for an example setup. ### Bower If bower is your thang, you can grab Plyr using: ``` bower install plyr ``` More info on setting up dependencies can be found in the [Bower Docs](http://bower.io/docs/creating-packages/#maintaining-dependencies) ### CDN If you want to use our CDN, you can use the following. Currently it's HTTP only. ```html ``` You can also access the `sprite.svg` file at `http://cdn.plyr.io/1.0.18/sprite.svg`. ### CSS If you want to use the default css, add the `plyr.css` file from /dist into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request. ```html ``` ### SVG The SVG sprite for the controls icons is loaded in by AJAX to help with performance. This is best added before the closing ``, before any other scripts. ```html ``` More info on SVG sprites here: [http://css-tricks.com/svg-sprites-use-better-icon-fonts/](http://css-tricks.com/svg-sprites-use-better-icon-fonts/) and the AJAX technique here: [http://css-tricks.com/ajaxing-svg-sprite/](http://css-tricks.com/ajaxing-svg-sprite/) ### HTML The only extra markup that's needed to use plyr is a `
` wrapper. Replace the source, poster and captions with urls for your media. ```html
``` And the same for `