Question

When I was trying to run the Qt::Phonon::VideoPlayer demo code, I got strange bug. The video is not rendered while sound is played well. What's wrong?

Here's my code:

if (ui->widget)
{
    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(ui->widget);

    player->load(MediaSource("D:/Films/19.wmv"));

    connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));

    player->play();
}

ui->widget is a QWidget element on my window. The code is run on button click (button is also in the window).

Was it helpful?

Solution

Sounds like you are missing a codec on your OS. Have you tried this with many different video files, do they all behave the same way?

OTHER TIPS

Found this bug surely unexpected: frame size was 1x1 px. Did not know what to do and the most surprising was the solution i took a glance somewhere over the internet:

player->setMinimumSize(ui->playerWidget->width(), ui->playerWidget->height());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top