Boost your player with Chromecast, Google Analytics and more
<script>// You can use either a string for the player ID (i.e., `player`), // or `document.querySelector()` for any selectorvarplayer=newMediaElement('player',{pluginPath: "/path/to/shims/",success: function(mediaElement,originalNode){// do things}});</script>
Automatic start
You can avoid running any startup scripts by adding class="mejs__player" to the <video> or <audio> tag. All the player configuration can be added through data-mejsoptions attribute.
<script>// You can use either a string for the player ID (i.e., `player`), // or `document.querySelector()` for any selectorvarplayer=newMediaElementPlayer('player',{pluginPath: "/path/to/shims/",// When using `MediaElementPlayer`, an `instance` argument// is available in the `success` callbacksuccess: function(mediaElement,originalNode,instance){// do things}});</script>
jQuery
<script>$('#mediaplayer').mediaelementplayer({pluginPath: "/path/to/shims/",// When using jQuery's `mediaelementplayer`, an `instance` argument// is available in the `success` callbacksuccess: function(mediaElement,originalNode,instance){// do things}});</script>