This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to play .wav file from URL in web browser embed

 
Tahir Akram
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi;

I want to play a .wav sound file in embed default media player in IE. Sound file is on some HTTP location. I am unable to sound it in that player.

Following is the code.





Here is embed code of HTML.



1. If I write in FileOutputStream then it plays well
2. If I replace my code of getting file from URL to my local hard disk. then it also works fine.

I don't know why I am unable to play file from HTTP. And why it plays well from local hard disk.

Please help.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that Java code in a JSP? (an assumption made because you posted this in the JSP forum)

If so, move it to a servlet. Foremost, Java code has no place in a JSP. Secondly, JSP is made for rendering text response, not binary data. The JSP may be adding extraneous characters that are screwing up your data stream. Please read this article for more information
 
Always look on the bright side of life. At least this ad is really tiny:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!