Frage

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).

War es hilfreich?

Lösung

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?

Andere Tipps

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());
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top