Closed HelgeStenstrom closed 5 years ago
Go for it :)
This pull request is a draft, because I want some comments on it. The main difference compared with the previous demo application, is that this one is not a subclass of StreamPlayer. That is an advantage in my opinion, but it's a matter of preferred style. There are no feature differences; they do exactly the same thing, so keeping both variants seems a bit meaningless.
StreamPlayer has a huge amount of public methods, and many of them are not used. I'm wondering if the unused methods should be removed, or if they should be used by the demo application, or at least by some unit tests. I don't think they should remain unused. If you want to showcase them in an application, then it might be worthwhile to have both a minimal application, and one that use all or most of the available methods in StreamPlayer.
Let me see this tomorrow at work.
Yes i have to make a documentation on how to use all the methods . Actually all of them have a purpose ,XR3Player is using most of them .
We need a documentation somewhere :)
This implementation doesn't subclass StreamPlayer, and it doesn't implement the StreamPlayerListener interface. Instead, the application has an instance of the regular StreamPlayer, and there is a separate implementation of the StreamPlayerListener interface.
One thing I dislike, is that the StreamPlayerListener depends on the StreamPlayer; it imports it, and has an instance of it, because that is how it gets the total number of bytes.
I have also added an alternative progress logging message.
I would have prefered to create the listener i main(), but it needs information that only the application has (the filename), so it has to be created in the application.
Besides that, it works as usual.