Hi,
I am trying to implement an audio HTTP stream player using the phonon framework. I can successfully play local files and even streams using a QUrl or filename as MediaSource, but this is not enough fir what i need.
The goal of my application is to play a live audio stream, that uses authentication. The authentication can be achieved by a normal http username&password, or by setting a certain value in the HTTP User Agent header. The problem is that I cannot use any of these two authentication schemes with the MediaSource url support - I cannot see any username/password support, and I cannot modify the headers of the HTTP connection.
So, I want to do the whole network part manually, connecting to the URL with a QNetworkManager, etc.. which will allow me to set the header and/or use username and password authentication.
My problem is that I think I can make this work (I have written different proof-of-concept parts of the code), but I am left with the problem that this is a live stream, therefore never ends. If I download the stream to a file, and play from there, (which is my current idea) this file will never be truncated and will end up becoming really huge after several days of play. So I need some kind of cache of the stream I'm downloading, which can delete the already played bytes and append the new downloaded bytes to the end.
My question - if this is a correct way to do what I want, which would be the best way to implement this stream cache? Using a QIODevice, as this is what I need to feed to the MediaSource.
Thanks in advance.
Bookmarks