View Single Post
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#2
I think there is a bug in the example.
It is about this line http://doc.qt.nokia.com/qtmobility-1...layer-cpp.html
if (!player->isAvailable()) {
QMessageBox::warning(this, tr("Service not available"),
tr("The QMediaPlayer object does not have a valid service.\n"\
"Please check the media service plugins are installed."));

controls->setEnabled(false);
playlistView->setEnabled(false);
openButton->setEnabled(false);
#ifndef PLAYER_NO_COLOROPTIONS
colorButton->setEnabled(false);
#endif
fullScreenButton->setEnabled(false);
}
In the constructor of Player.
At this point of time the player object (a QMediaObject)
isn't available.
I changed the code a bit and moved this part of the initialization
in a public slot and connected QMediaObjects' availabilityChanged
signal with this code.
Now it works and you can open and play a video file:
Attached Files
File Type: gz player.tar.gz (30.6 KB, 342 views)
 

The Following User Says Thank You to nicolai For This Useful Post: