After I installed the 3.8 beta I had to reinstall my modified Audio.xml file. I'm not surprised, but is it possible to include the modification in future versions of b4a?
This is to make it possible to get and set the position in an audio stream in the MediaPlayerStream object, which works when modified according to this thread:
Note that the "modified" Audio.xml file that was attached had NOT actually been modified - you have to follow the instructions to insert the code right after the Duration Property in the MediaPlayerStream wrapper area of the Audio.xml file:
B4X:
<property>
<name>Position</name>
<returntype>int</returntype>
<parameter>
<name>v</name>
<type>int</type>
</parameter>
<comment>Gets or sets the playing position (in milliseconds).</comment>
</property>
Would be great if it was there for everyone to use.
The reason that this property was hidden is that it didn't work in almost all cases.
You can easily call it with JavaObject:
B4X:
Sub GetPosition(mps As MediaPlayerStream) As Int
Dim jo As JavaObject = mps
Return jo.RunMethod("getPosition", null)
End Sub
Sub SetPosition(mps As MediaPlayerStream, Position As Int)
Dim jo As JavaObject = mps
jo.RunMethod("setPosition", Array (Position))
End Sub
The reason that this property was hidden is that it didn't work in almost all cases.
You can easily call it with JavaObject:
B4X:
Sub GetPosition(mps As MediaPlayerStream) As Int
Dim jo As JavaObject = mps
Return jo.RunMethod("getPosition", null)
End Sub
Sub SetPosition(mps As MediaPlayerStream, Position As Int)
Dim jo As JavaObject = mps
jo.RunMethod("setPosition", Array (Position))
End Sub
Thanks Erel. My first attempt using this approach hadn't been successful, but I have made it work now so I can go back to using the unmodified Audio.xml file.