What I have tried is
#include <QtGui/QApplication>
#include <qmediaplayer.h>
#include <qmediaplaylist.h>
#include <qmediaplaylistcontrol.h>
#include <qvideowidget.h>
#include <QMediaPlaylistWriter>
#include <qmediaplaylistioplugin.h>
#include <qmediastreamscontrol.h>
#include <qmediaservice.h>
#include <qmediaplaylistprovider.h>
#include <qmediaplaylistsourcecontrol.h>
#include <mainwindow.h>
int main(int argc, char *argv[])
{
MainWindow mainWindow;
QMediaPlayer *mediaPlayer = new QMediaPlayer;
QMediaPlaylist *list = new QMediaPlaylist(mediaPlayer);
list
->addMedia
(QUrl("Song"));
QVideoWidget *widget = new QVideoWidget(&mainWindow);
widget->show();
mediaPlayer->play();
mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
mainWindow.showExpanded();
return app.exec();
}
#include <QtGui/QApplication>
#include <qmediaplayer.h>
#include <qmediaplaylist.h>
#include <qmediaplaylistcontrol.h>
#include <qvideowidget.h>
#include <QMediaPlaylistWriter>
#include <qmediaplaylistioplugin.h>
#include <qmediastreamscontrol.h>
#include <qmediaservice.h>
#include <qmediaplaylistprovider.h>
#include <qmediaplaylistsourcecontrol.h>
#include <mainwindow.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
QMediaPlayer *mediaPlayer = new QMediaPlayer;
QMediaPlaylist *list = new QMediaPlaylist(mediaPlayer);
list->addMedia(QUrl("Song"));
QVideoWidget *widget = new QVideoWidget(&mainWindow);
widget->show();
mediaPlayer->play();
mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
mainWindow.showExpanded();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks