I am trying to build a basic PLAY function inside an app for a short mp3 file on iOS.
I have no idea how to customise the native player hence I am using custom icons to play/pause/stop and need help displaying duration and amount played on the card.
Code: Select all
// set up the player
mobileControlSet "myPlayer", "filename", specialFolderPath("engine") & "/filetoplay.mp3"
mobileControlSet "myPlayer", "preserveAspect", true
mobileControlSet "myPlayer", "showController", true
// hide native player as controlling mp3 with custom icons
mobileControlSet "myPlayer", "visible", false
# for testing, display native player on card - works fine
# mobileControlSet "myPlayer", "rect", "10,400,300,370"
Code: Select all
on mouseUp
mobileControlDo "myPlayer", "play"
end mouseUp
1. The total length of the mp3 file in mins & secs, e.g. 1:02
2. The amount of the file played, i.e. counting up how much of the file has been played in realtime.
I have studied mobileControlGet and tried a myriad of patterns but can't seem to work it out.
Code: Select all
put mobileControlGet ("myPlayer","currentTime") into tcurrentTime
put mobileControlGet ("myPlayer","playableDuration") into tDuration
put tDuration into fld "test"