Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Sound/Audio through RAP/RWT(Playing audio and sound through RAP/RWT application)
Sound/Audio through RAP/RWT [message #1859214] Sat, 20 May 2023 00:28 Go to next message
Jence Bangladesh is currently offline Jence BangladeshFriend
Messages: 1
Registered: May 2023
Junior Member
How do I play audio through RAP/RWT application? I could not find any API call to play a sound or audio file through RAP/RWT. I know how to play audio through Javascript. Can anyone point me to the right direction through examples. Thanks.
JB
Re: Sound/Audio through RAP/RWT [message #1859248 is a reply to message #1859214] Mon, 22 May 2023 13:21 Go to previous message
Markus Knauer is currently offline Markus KnauerFriend
Messages: 179
Registered: July 2009
Senior Member

Hi Jence,

I would suggest to try it with the JavaScriptExecutor like in the snippet below (which works without any additional API):

  Client client = RWT.getClient();
  JavaScriptExecutor jse = client.getService(JavaScriptExecutor.class);
  if (jse != null) {
  	String audioUrl = ...accessible location URL of your audio file...;
  	jse.execute("new Audio('" + audioUrl + "').play()");
  }


Regards
Markus


--

Twitter: @mknauer23 and @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:RAP Selectable Label with MarkUp
Next Topic:UTF8 characters not displaying in html served by RAP appserver
Goto Forum:
  


Current Time: Sun Dec 15 00:11:38 GMT 2024

Powered by FUDForum. Page generated in 0.07415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top