Simple audio player

461 views
Skip to first unread message

Steph

unread,
May 5, 2012, 5:11:22 AM5/5/12
to phon...@googlegroups.com
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.

Cheers,
Steph

Devgeeks

unread,
May 5, 2012, 5:52:47 AM5/5/12
to phon...@googlegroups.com

Stephanie Sherriff

unread,
May 6, 2012, 2:29:52 AM5/6/12
to phon...@googlegroups.com
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.

Cheers,
Steph

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

Simon MacDonald

unread,
May 15, 2012, 8:04:28 PM5/15/12
to phon...@googlegroups.com
Hey Steph,

Did you make any progress on this? I'm looking at doing something similar for a side project.

Toshiya TSURU

unread,
May 15, 2012, 9:18:23 PM5/15/12
to phon...@googlegroups.com
I'm interested in this topic, too.

Also I'm looking for a plugin which can change playback speed.
Toshiya TSURU <turut...@gmail.com>
http://blog.turutosiya.com/

Devgeeks

unread,
May 15, 2012, 9:22:08 PM5/15/12
to phon...@googlegroups.com
For playback speed, doesn't webkit support changing this via: audio.playbackRate ?

Toshiya TSURU

unread,
May 15, 2012, 9:33:13 PM5/15/12
to phon...@googlegroups.com
maybe "audio.playbackRate" is not supported on iOS, isn't It?

Devgeeks

unread,
May 15, 2012, 9:47:38 PM5/15/12
to phon...@googlegroups.com
According to Apple: "Available in iOS 3.0 and later"


On Wednesday, May 16, 2012 11:33:13 AM UTC+10, Toshiya TSURU wrote:
maybe "audio.playbackRate" is not supported on iOS, isn't It?

Toshiya TSURU

unread,
May 15, 2012, 9:54:04 PM5/15/12
to phon...@googlegroups.com
great, Thanks!

Steph

unread,
May 28, 2012, 9:35:27 PM5/28/12
to phon...@googlegroups.com
I did come up with something. It doesn't allow for seeking before the audio starts playing, but it is better than nothing. I am using it in a Sencha Touch app, but my basic code can probably be adjusted to work in any sort of javascript app, so I'll put it together and post it on here when I get home tonight.

Cheers,
Steph


On Wednesday, 16 May 2012 10:04:28 UTC+10, Simon wrote:
Hey Steph,

Did you make any progress on this? I'm looking at doing something similar for a side project.
On Sun, May 6, 2012 at 2:29 AM, Stephanie Sherriff <steph.s...@gmail.com> wrote:
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.

Cheers,
Steph


On Sat, May 5, 2012 at 7:52 PM, Devgeeks <to...@devgeeks.org> wrote:


On Saturday, May 5, 2012 7:11:22 PM UTC+10, Steph wrote:
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.

Cheers,
Steph

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

ericburnley

unread,
Jul 25, 2013, 6:26:33 PM7/25/13
to phon...@googlegroups.com
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.

http://iphone.dan.co.jp/404mnf.cgi/archives/51733122.html
Reply all
Reply to author
Forward
0 new messages