07-10-2013 06:05 PM
So I have been doing some debugging and I have an app where I stream music. When 15% of the song has downloaded, I pass the media player the file path and tell it to start playing. This works wonderfully as I am writing to the same file it reads from. But the issue appears when I recently implemented having a seek bar, I put all the appropriate error handling to keep a user from trying to seek to a position that isn't downloaded yet, but when the song is completely downloaded, it won't seek past its 15%. My guess is that the media player gets an idea of how long the song is before it starts playing and when I try to seek to a position that now exists since the song started playing, but doesn't exist according to its starting value it doesn't understand how to seek there, even though it will read the song all the way through no problem.
To figure out that this is in fact the issue I did the following:
I changed this:
MediaError::Type error = player->seekTime((int)position);
player->setSourceUrl(QUrl("")); player->setSourceUrl(QUrl(currentSong->url())); MediaError::Type error = player->seekTime((int)position);
And it works as expected.
Should I report this anywhere?!