|Simple audio player||Steph||5/5/12 2:11 AM|
I've created an extremely simple audio player which has a play/pause button and a slider that shows where the audio playing is up to.
I'd like to be able to drag the slider and move forward and back in the audio. Has anyone done this? Any help would be appreciated. Basically tips on how it would be done or if it is even possible with the current PhoneGap media object.
|Re: Simple audio player||Devgeeks||5/5/12 2:52 AM|
|Re: [PhoneGap] Re: Simple audio player||Steph||5/5/12 11:29 PM|
Although I appreciate the response, just a link to a page I already have seen since I am already using the media object in phonegap is not particularly helpful.
I guess I was more looking for people who have done this before and have some experience in the difficulty I'm facing. I am using the seekTo method, and though it sort of works, I am more struggling with the fact that in order to get the slider tracking, I"m having to use getCurrentPosition, and that along side seeking while moving the slider is overwhelming the phone and is really jerky and doesn't work very well.
I could have been more clear, but more in depth help, by someone who got something like this working. Some hints to maybe if they are listening to the dragging of the slider, or just the finish of the drag to then seek. Maybe whether or not they had to remove the getCurrentPosition while it was being dragged?
I've tried a bunch of stuff but can't seem to get the perfect combination.
|Re: [PhoneGap] Re: Simple audio player||Simon||5/15/12 5:04 PM|
Did you make any progress on this? I'm looking at doing something similar for a side project.
Simon Mac Donald
|Re: [PhoneGap] Re: Simple audio player||Toshiya TSURU||5/15/12 6:18 PM|
|Re: [PhoneGap] Re: Simple audio player||Devgeeks||5/15/12 6:22 PM|
For playback speed, doesn't webkit support changing this via: audio.playbackRate ?
|Re: [PhoneGap] Re: Simple audio player||Toshiya TSURU||5/15/12 6:33 PM|
maybe "audio.playbackRate" is not supported on iOS, isn't It?
|Re: [PhoneGap] Re: Simple audio player||Devgeeks||5/15/12 6:47 PM|
According to Apple: "Available in iOS 3.0 and later"
maybe "audio.playbackRate" is not supported on iOS, isn't It?On Wed, May 16, 2012 at 10:22 AM, Devgeeks wrote:
|Re: [PhoneGap] Re: Simple audio player||Toshiya TSURU||5/15/12 6:54 PM|
|Re: [PhoneGap] Re: Simple audio player||Steph||5/28/12 6:35 PM|
|Re: Simple audio player||ericburnley||7/25/13 3:26 PM|
I know this is an old post, just wanted to share a tool I used for something like this in case someone's still searching.
For Android, I, too, found that most sliders were pretty clunky in performance. I somehow found this page with an RGB blend tool with touch-sensitive sliders (the only thing I can read is the code and an occasional word like "DEMO"). Tried the demo in my Android 2.3 phone and was really happy with the performance, so I incorporated it as a progress bar into a media player I was working on. The touch is really responsive for sliding to the position you want, and within the body of this function, I use something like:
my_media.seekTo(Math.round((width / max) * totalDur * 1000));
Since it leverages touchstart/end, it does a real good job of providing the *perception* of fast performance, which imo is half the battle. I wind up doing a lot of touch event based styling to give that impression. I'll post back when the final project is available for download.