[Interest] How do use QMediaPlayer on a QIODevice?
Nikos Chantziaras
realnc at gmail.com
Sat Jun 8 14:11:37 CEST 2013
On 08/06/13 13:41, Nikos Chantziaras wrote:
> QMediaPlayer is unable to play anything, be it video or audio, from a
> QIODevice. Even this simple example fails:
>
> QMediaPlayer* player =
> new QMediaPlayer(0, QMediaPlayer::StreamPlayback);
>
> QFile* file = new QFile("/tmp/audio.ogg");
> if (not file->open(QFile::ReadOnly)) {
> abort();
> }
> player->setMedia(QUrl(), file);
> player->play();
>
> It doesn't play, and this is printed on stderr:
>
> Error: "Could not demultiplex stream."
I've now tested the above on Windows 7. It works just fine there.
More information about the Interest
mailing list