i have an audio player which retrieves a stream from a website and plays it, which works pretty good.
i want the user to be able to play forward. But i dont want the user to be able to play too far forward, so i have to detect how many bytes has been transfered. And thats where i get stuck, because i have a "wrapped" player class which plays the song from an EofSensorInputStream (thats an InputStream from apache which i cannot change to another InputStream) and i have the SliderUI which also uses the stream (passed as constructor argument) which should now detect how many bytes has been transfered.
I can read the the stream only once, so either in my SliderUI, but then the data is lost for the player. Or i play the song, but then the data is lost for the SliderUI.
I'm using htmlunit and i think it would be overkill to create a new class and change the whole htmlunit code.
i think i got a solution or workaround:
download the stream as tmp file, play the song from it and get the filesize and compare it with the content length given by the http server
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop