Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Play sound file in RAP
Play sound file in RAP [message #754657] Thu, 03 November 2011 19:01 Go to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
I need to play wav/mp3 in RAP webpage. If I use Java to play local sound file, it will actually play the sound on Server. If I use Javascript to play sound, it must be a sound file on internet. I know I can register the sound file as web resource and play it with Javascript, but that would limit to fixed found files which doesn't meet my requirment. Any ideas?

Thanks!
Xihui
Re: Play sound file in RAP [message #754906 is a reply to message #754657] Fri, 04 November 2011 20:52 Go to previous messageGo to next message
wouterr is currently offline wouterrFriend
Messages: 6
Registered: October 2011
Junior Member
Try SoundManager2, it's a javascript library that uses html5 or flash to play a soundfile clientside.
Re: Play sound file in RAP [message #754908 is a reply to message #754657] Fri, 04 November 2011 20:52 Go to previous messageGo to next message
wouterr is currently offline wouterrFriend
Messages: 6
Registered: October 2011
Junior Member
Try SoundManager2, it's a javascript library that uses html5 or flash to play a soundfile clientside.
Re: Play sound file in RAP [message #754944 is a reply to message #754657] Sat, 05 November 2011 16:23 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
What do you mean with

"that would limit to fixed found files"
Re: Play sound file in RAP [message #754945 is a reply to message #754657] Sat, 05 November 2011 16:23 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
What do you mean with

"that would limit to fixed found files"
Re: Play sound file in RAP [message #756039 is a reply to message #754945] Thu, 10 November 2011 15:18 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
It looks too complicated to use SoundManager2.

What I want just play a sound file on server in webpage. It should be easy for RAP to provide such a function, isn't it?
Re: Play sound file in RAP [message #756040 is a reply to message #754944] Thu, 10 November 2011 15:18 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
It looks too complicated to use SoundManager2.

What I want just play a sound file on server in webpage. It should be easy for RAP to provide such a function, isn't it?
Re: Play sound file in RAP [message #756085 is a reply to message #756040] Thu, 10 November 2011 19:48 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

In my opinion when you use the browser widget, anything you want to do inside this browser widget you have to do with html, JavaScript etc. So you use the browser widget for anything that you can do with a normal browser. So you can point a user to www.google.com or you can write your own HTML pages.

The browser widget is there to encapsulate a browser inside a RAP Application. You should not blame RAP for anything you can or cannot do with a browser.

You can try to use HTML 5 see http://www.w3schools.com/html5/tag_audio.asp

It is possible to pass data from your Rap Application to the browser by using the BrowserFunction


Regards Bertin





Re: Play sound file in RAP [message #756086 is a reply to message #756040] Thu, 10 November 2011 19:48 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

In my opinion when you use the browser widget, anything you want to do inside this browser widget you have to do with html, JavaScript etc. So you use the browser widget for anything that you can do with a normal browser. So you can point a user to www.google.com or you can write your own HTML pages.

The browser widget is there to encapsulate a browser inside a RAP Application. You should not blame RAP for anything you can or cannot do with a browser.

You can try to use HTML 5 see http://www.w3schools.com/html5/tag_audio.asp

It is possible to pass data from your Rap Application to the browser by using the BrowserFunction


Regards Bertin
Re: Play sound file in RAP [message #756226 is a reply to message #756085] Fri, 11 November 2011 15:09 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
Thank you Bertin, but I'm not blaming RAP.

If I use browser widget and HTML5 like this:
<audio controls="controls">
  <source src="song.ogg" type="audio/ogg" />
  <source src="song.mp3" type="audio/mp3" />
  Your browser does not support the audio element.
</audio>


My questions is where should I put "song.mp3" on the server?

To be clearer, what I want is a function like this:

//Play a server side sound file on client
RAP.playSound("/absolute/path/to/mp3/on/server/");

[Updated on: Fri, 11 November 2011 15:16]

Report message to a moderator

Re: Play sound file in RAP [message #756227 is a reply to message #756085] Fri, 11 November 2011 15:09 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
Thank you Bertin, but I'm not blaming RAP.

If I use browser widget and HTML5 like this:

<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mp3" />
Your browser does not support the audio element.
</audio>


My questions is where should I put "song.mp3" on the server?
Re: Play sound file in RAP [message #756285 is a reply to message #756227] Fri, 11 November 2011 19:21 Go to previous messageGo to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

You need to provide a way to download the file to the browser. See the FAQ[1], but you can replace the anchor tag in the example with the audio tag from above.

Cole

[1] http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link.3F
Re: Play sound file in RAP [message #756287 is a reply to message #756227] Fri, 11 November 2011 19:21 Go to previous message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

You need to provide a way to download the file to the browser. See the FAQ[1], but you can replace the anchor tag in the example with the audio tag from above.

Cole

[1] http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link.3F
Previous Topic:Play sound file in RAP
Next Topic:Qooxdoo Errors
Goto Forum:
  


Current Time: Wed Apr 24 22:40:56 GMT 2024

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

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

Back to the top