Android Question [SOLVED] MediaPlayerStream Position Property

RandomCoder

Well-Known Member
Licensed User
Longtime User
Has something changed?
I'm trying to add the position property to the Audio library as per this forum post...
MediaPlayerStream - SeekTo and getCurrentPosition
It appears that others have initailly had problems getting the property to show but they have then got it to work.
I've followed the instructions meticulously...
You should do as follow:
1- Close B4A Application
2- Go to the installation folder of B4A App
3- Go to Library Folder
4- Replace the Audio.xml file I provided previously. In case you don't want to replace rename the current file and copy mine as well.
5- Open B4A App and load your project.
6- just call mp.Position and it should be available now.
But still I can not get the property to show. Has the .jar file changed with Audio lib version 1.63?
I realise that even if I manage to get the property to be listed, it still might not work on my device, but i'd like to give it a try if at all possible. Attached is the modified Audio.XML file (renamed file extension due to forum rules) I am attempting to use. I've manually added the position property in the MediaPlayerStream Class and refreshed the audio lib. What else can I be doing wrong?

All suggestions gratefully received, thanks.
RandomCoder
 

Attachments

  • Audio.txt
    23.6 KB · Views: 462

RandomCoder

Well-Known Member
Licensed User
Longtime User
B4X:
Dim jo As JavaObject = mps
Log(jo.RunMethod("getPosition", null))

This works perfectly but can someone explain to me why it is "getPosition" and not "getCurrentPosition" as I am trying to better understand my code and how it all works. The documentation for the RunMethod states to use the case-sensitive Method name and I expected this to be getCurrentPosition as listed in the Android documentation for the MediaPlayer class...
http://developer.android.com/reference/android/media/MediaPlayer.html
I tried using getCurrentPosition but this caused an error and made reference to the B4A wrapper. Therefore I'm thinking that getPosition must be something to do with B4A and not the MediaPlayer class?

Confused!
RandomCoder
 
Upvote 0
Top