Hey all,
My app allows users to select and play a file they have recorded - works fine.
Using jQueryMobile also shows a slider that moves along as the file is played - works fine.
(using: jquery.mobile-1.0.min.js and jquery-1.6.4.min.js)
<script>
...
//This code is called when I set the position of the time shown on the screen - works fine (called from 'my_media.getCurrentPosition')
seekbar.value = position * 1000;
$('#seekbar').slider('refresh'
);
...
</script>
<input type="range" step="any" id="seekbar" name="seekbar" >
Here's my challenge: In addition to this I'd like to allow the user to move the slider to where they want in the recording and adjust the displayed time accordingly. We've all seen this on the apps on our phones.
What I can't do is fire an event that only fires when the slider is moved. I have 'change' working (see below) but as the file continues to play it keeps firing as the 'value' is actually changing. I just want the event to spark when the slider is moved.
This piece of code works but I need to do something other than 'bind' the 'change' event as that's too much. I need to specifically 'bind' the slider movement. I see there are 'slidestart' and 'slidestop' events but they don't fire when used in place of 'change' the way I have set things up. No doubt I've got it wrong!
...
$('#seekbar').bind('change', function() {
// myFunction to update timer display
updateSlider($(this).val()); // this works, shows current spot on slider
});
...
Any tips and trick are appreciated!
Thanks
Neil