I am trying to get the following functions to work for playing back an mp3 in a web page: play, pause, and get playback position. I am using the audio tag in a WebHTMLViewer as follows (I named the component splashaudio):
me.LoadPage("
That works fine. Then, in a button Action I am trying to pause using this line:
I don’t know how to refer to the splash id; nothing seems to work. I tried wading through the DOM and based on that I have tried a lot of different names but nothing works. I think I need event listeners. I read the tutorial “WebControlSDK.pdf” which helped but it isn’t specific enough to help out for this example.
Can someone just let me know if I am on the right track trying to put get and set events for the mp3 in the WebHTMLViewer?
Thanks for the suggestion. I did see that but I am trying to learn how to do this myself.
I think the audio player example gets me about halfway there. I am going to work through the two-way communication example today which should get me a little farther. One piece to the puzzle that I think I am missing is how to send the “pause()” or “play()” to the server. From the audio player example:
The example loads the audio but it doesn’t use the .pause() or play() commands (like this in regular Javascript: document.GetControlByID(“splash”).pause()).
From the WebSDK manual I know I need to do something similar to this in Xojo:
You can’t send to the server unless you use the WebControlSDK. (wich you have found)
I have the full source of the SWORT_WebAudio class as i’ve written it myself…
It shows how you use the WebControlSDK and communications from client to server.
If you want to do that you probably want to create a new control. Perhaps subclassing the WebControlWrapper (from WebControlSDK) helps you understand how it works.
The examples should be somewhere in your installation of xojo.
Use them to help you get to where you want. It helped me alot more then the PDF did. I like online docs more…