how to play a video using qt mobility api
this is my code
QMediaPlayer player ;
QMediaPlaylist playlist;
playlist.addMedia(QUrl("http://www.youtube.com/watch?v=JKAnROktnbY&feature=share"));
playlist.setCurrentIndex(0);
player.setPlaylist(&playlist);
player.play();
if (!player.isAvailable()) {
QMessageBox::warning(0, ("Service not available"),
("The QMediaPlayer object does not have a valid service.\n"\
"Please check the media service plugins are installed."));
}
QVideoWidget widget;
player.setVideoOutput(&widget);
widget.show();
it only show black screen

Reply With Quote

