Fast forward and backward and progress bar for mp3 player

Hello!

How to make fast forward, rewind and progress bar for mp3 player?
That is, I want to do the following things:

  1. I press the button forward, after which the mp3 file is rewound forward for a certain number of seconds.
  2. I press the back button, after which the mp3 file is rewound back for a certain number of seconds
  3. I click on any place in the progress bar (for example, 1:44) and playback of the mp3 file starts at 1:44.

Thank you in advance for your help.

you might want to try the Player extension, which offers the method StartAt to start playing at a given position
https://puravidaapps.com/player.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Oh, thanks. But is there a progress bar implemented there?

You can make your own using the slider

1 Like

That is, it’s impossible to do in the original player? Right?

1 Like

as @Ken already mentioned, use a slider component together with the StartAt method of the player extension to start your mp3 file at the selected position

Taifun

2 Likes

Thank you. I’m just taking the first steps, so I thought, “What if all this can be realized using a standard player, but I just don’t know how to do this?” Now I know that for this I need to use your extension.

1 Like

Hello again!
I have managed to implement the “fast forward” and “rewind” buttons. I just point StartAt + 10,000 milliseconds and -10,000 milliseconds. But I can’t make a progress bar using a slider.
Please tell me how to do this.

1 Like

Use the currentPosition and Duration blocks in combination with a clock timer (every second?) with your slider (disable thumb!)

1 Like

Every second? Oh, hell, haha ​​… It’s a pity that there is no ready-made solution. OK, I’ll try to do it on my own and as soon as I have questions, I will add this topic. I think this thread will be interesting to other people as well. Because before asking this question, I searched for information on the Internet. Usually they tell how to make a primitive mp3 player and there is no question (and an answer, respectively) about the buttons for rewinding a track and a progress bar. I hope that when the next curious person asks this question, they will get to this topic and save their time.

1 Like

Something like this?

1 Like

^^^ Nice :wink:

I would like to see a solution this way. :wink:

1 Like

I thought that is what you just did :wink:

... but not by disabling any slider.

1 Like

Yes, yes, something like this, as in any decent mp3 player, haha. So a user may quickly go to the middle of the track, listen to the beginning, go to the end and so on.
Can you show how you did it, please?

Ok, try this and if you have adapted / optimized my approach for yourself, post the result so that everyone can learn from it.

Of couse, you can also use mp3:

1 Like

Many thanks! First of all, I will try to repeat all your code and then start experimenting.

1 Like

I found a way to do everything with just one slider: display the current runtime, fast forward and rewind. Unfortunately, this is much more complicated with AI2 than with Kodular, because among other things the Slider component in AI2 has no TouchDown and TouchUp events.

So test this APK on your devices:

Since this question also arises frequently: You should also be able to pick and play mp3 files from the external (removable) SD card.

3 Likes

Wow! It’s great! And quite by accident, I also started trying Kodular when I came across some limitations here. No, this is not an advertisement for another service, haha.

I have already downloaded your apk. I will test it very soon. I think other people will do this as well, as this is a really important question.

I started testing the application.

  1. LDPlayer emulator (Android 4.4)
  2. ZTE Smartphone (Android 7.0)

Everything works fine for me. Dear friends, let’s help this wonderful girl. Try to test this application on your smartphones as well.

2 Likes