Reputation: 12275
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).
Upvotes: 0
Views: 395
Reputation: 12275
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());
Upvotes: 3
Reputation: 4327
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?
Upvotes: 2