This week's book giveaway is in the HTML, CSS and JavaScript forum.
We're giving away four copies of hapi.js in Action and have Matt Harrison on-line!
See this thread for details.
Win a copy of hapi.js in Action this week in the HTML, CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JLayer wont abort the InputStream (from a HTTP Server)

 
olze oli
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a http server which gives me some media files (mp3 etc.)
i use JLayer to play the media files which works fine
the big problem is that some files are really big and the Player class just wont stop downloading them when i hit the "stop" button
i have no idea what could going on...

JLayer uses a class called "Bitstream" which has a source field - this is a PushbackInputStream.
When it now goes to the source.close() line it just wont stop download the file (into the ram).

Can please someone help me how i can fix this?
 
olze oli
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i say:
player.close(); it simply does nothing (but it calls close() on the PushbackInputStream).
When i call myUglyPlayThread.stop() it stops downloading but the thread locks :/
 
olze oli
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was a problem with apache httpclient..., no not a problem, a feature
i had to cast the stream (i get the stream via httpget())
i thought its a normal InputStream, but its an EofSomethingStream which had an abort() method which does it now for me
furthermore i use AdvancedPlayer because i can implement what happens when the close method of the player has been called
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!