ruba ramesh

Greenhorn
+ Follow
since Oct 15, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ruba ramesh

I Wayan Saryada wrote:

ruba ramesh wrote:Hi,
3. Used HTML5 audio tag.
But, I am not successful in playing song. Song is of type of mp3 or wav.



Before using the servlet have you tried to only use local HTML file with the audio tag and load it to see if it is work outside the servlet environment. What browser are you use to run the HTML audio? Please make sure that your browser support the audio format.





Hmm.. Good idea. I tried out. HTML 5 is supported by Google chrome. This http://www.w3schools.com/html/html5_audio.asp reveals it's supported in IE9 and Chrome for mp3.

Thanks for the suggestion.

Rupa
11 years ago
Hi,

I have audio files stored as blob in MySql DB. I woule like to play the audio files in JSP. To achieve this, song_id is passed as parameter to servlet. Servlet retrieves the blob from DB and writes the blob as bytes in OutputStream of response object of Servlet.


Problem is I am not able to play the song in JSP file.

Tried following ways to do it.

1. Used JPlayer.
2. Embedding audio player pointing to servlet' URL as src.

<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="player" width="200" height="300">
<param name="url" value="<%=request.getContextPath()%>" />
<param name="src" value="GetSongForPlay?song_id=49"/>
<param name="showcontrols" value="true" />
<param name="autostart" value="true" />
<embed src="<%=request.getContextPath()%>/GetSongForPlay?song_id=49" width="<%=200%>" height="<%=300%>"></embed>
</object>

3. Used HTML5 audio tag.


But, I am not successful in playing song. Song is of type of mp3 or wav.

Can anybody suggest how to approach this?


Thanks
11 years ago