I have some mp3 files in the DirAssets directory and some buttons in a webpage.
When a button is pressed the webview overide sub gives this file location.
debug mode file location
URL_override button = file:///private/var/mobile/Containers/Data/Application/A8915E2D-1D5C-4FB1-911B-8098DFDED499/tmp/virtual_assets/koe11025.mp3
release mode file location
this location will be completely different, it's in Containers/Bundels/etc don't like this.
How can I play this with mediaplayer in debug and release mode.
In B4A this was so easy
But with B4I I don't get it right the file location are different in debug and release mode
how can I get this right, or should i just search for the mp3 file name in both strings
(Debug and Release) and play the file with see below.
When a button is pressed the webview overide sub gives this file location.
debug mode file location
URL_override button = file:///private/var/mobile/Containers/Data/Application/A8915E2D-1D5C-4FB1-911B-8098DFDED499/tmp/virtual_assets/koe11025.mp3
release mode file location
this location will be completely different, it's in Containers/Bundels/etc don't like this.
How can I play this with mediaplayer in debug and release mode.
In B4A this was so easy
B4X:
If Url.EndsWith("mp3") Then
Url=Url.Replace("file:///android_asset/","") 'strip file:///android_asset
Player.Load(File.DirAssets,Url)
Player.Play
Return True
End If
But with B4I I don't get it right the file location are different in debug and release mode
how can I get this right, or should i just search for the mp3 file name in both strings
(Debug and Release) and play the file with see below.
B4X:
Player.Initialize(File.DirAssets,filename,"Player")
Player.Play
Last edited: