annotate johndyer-mediaelement-13fa20a/src/js/mep-feature-stop.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
rev   line source
gyorgy@0 1 (function($) {
gyorgy@0 2 // STOP BUTTON
gyorgy@0 3 MediaElementPlayer.prototype.buildstop = function(player, controls, layers, media) {
gyorgy@0 4 var stop =
gyorgy@0 5 $('<div class="mejs-button mejs-stop-button mejs-stop">' +
gyorgy@0 6 '<button type="button"></button>' +
gyorgy@0 7 '</div>')
gyorgy@0 8 .appendTo(controls)
gyorgy@0 9 .click(function() {
gyorgy@0 10 if (!media.paused) {
gyorgy@0 11 media.pause();
gyorgy@0 12 }
gyorgy@0 13 if (media.currentTime > 0) {
gyorgy@0 14 media.setCurrentTime(0);
gyorgy@0 15 controls.find('.mejs-time-current').width('0px');
gyorgy@0 16 controls.find('.mejs-time-handle').css('left', '0px');
gyorgy@0 17 controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
gyorgy@0 18 controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
gyorgy@0 19 layers.find('.mejs-poster').show();
gyorgy@0 20 }
gyorgy@0 21 });
gyorgy@0 22 }
gyorgy@0 23
gyorgy@0 24 })(mejs.$);