Video Play
-
hi,
i am using following code for playing video.@
/******************************************************************/
playlist = new QMediaPlaylist;
playlist->addMedia(QUrl("http://abc/video/video1.3gp"));
playlist->addMedia(QUrl("http://abc/video/video2.3gp"));
playlist->addMedia(QUrl("http://abc/video/video3.3gp"));
playlist->setCurrentIndex(1);player = new QMediaPlayer; connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64))); connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus))); connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(error(QMediaPlayer::Error))); player->setPlaylist(playlist); Qm_pQVideoWidget = new QVideoWidget(this); player->setVideoOutput(Qm_pQVideoWidget); Qm_pQVideoWidget->show(); player->play();/******************************************************************/
@
then it gives error msg"DirectShowPlayerService::doRender: Unresolved error code 8007000d"
and
"QMediaPlayer::ResourceError (1)"how to solve it.
[[mark up code, Tobias]]
-
Which platform are you trying to run this on?
-
Videos doesnt work on simulator, to test videos use a mobile to deploy and test :)
-
thanks for reply
now i have try following code
@
/********************************************/
playlist = new QMediaPlaylist;
QString filepath;
filepath.clear();
filepath.append("E:\data/abc.3gp");
QMediaResource resource(QUrl::fromLocalFile(filepath));
QMediaContent content(resource);
playlist->addMedia(content);
playlist->setCurrentIndex(1);player = new QMediaPlayer;
connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(error(QMediaPlayer::Error)));
connect(player, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(stateChanged(QMediaPlayer::State)));
player->setPlaylist(playlist);
Qm_pQVideoWidget = new QVideoWidget(this);
player->setVideoOutput(Qm_pQVideoWidget);
Qm_pQVideoWidget->show();
Qm_pQVideoWidget->activateWindow();
Qm_pQVideoWidget->showFullScreen();
/********************************************/
@
when i run this code on simulator only i can listen video,i can't see videoand when i run on device it crash.....
[Edit: Please wrap code in @ tags; mlong]
-
Sorry i only worked with video using the QML Video Element