Mercurial > hg > env-test-daniele
comparison johndyer-mediaelement-13fa20a/src/js/mep-feature-loop.js @ 0:032bc65ebafc
added core components
author | George Fazekas <gyorgy.fazekas@eecs.qmul.ac.uk> |
---|---|
date | Wed, 06 Mar 2013 15:45:48 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:032bc65ebafc |
---|---|
1 (function($) { | |
2 // loop toggle | |
3 MediaElementPlayer.prototype.buildloop = function(player, controls, layers, media) { | |
4 var | |
5 // create the loop button | |
6 loop = | |
7 $('<div class="mejs-button mejs-loop-button ' + ((player.options.loop) ? 'mejs-loop-on' : 'mejs-loop-off') + '">' + | |
8 '<button></button>' + | |
9 '</div>') | |
10 // append it to the toolbar | |
11 .appendTo(controls) | |
12 // add a click toggle event | |
13 .click(function() { | |
14 player.options.loop = !player.options.loop; | |
15 if (player.options.loop) { | |
16 loop.removeClass('mejs-loop-off').addClass('mejs-loop-on'); | |
17 } else { | |
18 loop.removeClass('mejs-loop-on').addClass('mejs-loop-off'); | |
19 } | |
20 }); | |
21 } | |
22 | |
23 })(mejs.$); |