Media library problem

I have several WAV files in my solution’s media library and a method on a button that uses this line to play the sound file named in a global:

application.playSound('media:///' + globals.gWAVToPlay + '.wav')

This works fine in the web client when previewed from Developer, but when solution is run in the web client from the Server, this error is returned in the log:

java.net.MalformedURLException: unknown protocol: media
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at com.servoy.j2db.scripting.JSApplication$3.run(JSApplication.java:5)
at com.servoy.j2db.util.TaskExecuter.run(TaskExecuter.java:16)
at java.lang.Thread.run(Unknown Source)

As an alternative to referencing files in the media library, I tried using the servoy_blobloader, but even though the rowid1 value was correct, it only ever plays the sound file from the first record in the database.

Does anyone have a way to make either of these methods work correctly?

Steve in LA

Hi Steve,

The sound will be played on server when using webclient. This is what you want to achieve ?

Regards, Laurian

No, I don’t want the sound to play on the server. I am building a captcha, and there needs to be a button that can be clicked that plays an audio file that speaks the characters visible in the image area of the captcha, so the audio needs to play in the client.

Sorry, this is not currently supported. You can file a case for this.

Just so I am clear before I file a case, is it application.playSound() that is not supported on the webclient or the servoy_blobloader not retrieving anything except the first record in a database that is not supported or both?

playSound is not supported in webclient, servoy_blobloader should work , I think. You can attach a sample for the functionality you want to work.