Mercurial > hg > env-test-daniele
view johndyer-mediaelement-13fa20a/src/js/mep-feature-loop.js @ 25:4a4bd554b4c1 tip
Closing this sub branch.
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Mar 2013 14:02:54 +0000 |
parents | 032bc65ebafc |
children |
line wrap: on
line source
(function($) { // loop toggle MediaElementPlayer.prototype.buildloop = function(player, controls, layers, media) { var // create the loop button loop = $('<div class="mejs-button mejs-loop-button ' + ((player.options.loop) ? 'mejs-loop-on' : 'mejs-loop-off') + '">' + '<button></button>' + '</div>') // append it to the toolbar .appendTo(controls) // add a click toggle event .click(function() { player.options.loop = !player.options.loop; if (player.options.loop) { loop.removeClass('mejs-loop-off').addClass('mejs-loop-on'); } else { loop.removeClass('mejs-loop-on').addClass('mejs-loop-off'); } }); } })(mejs.$);