mercredi 20 juillet 2016

QMediaPlayer is not showing the video

I'm working on video player and now i'm doing my playlists functional. So, when i've made a little system, but it's not working. Can you please say what's wrong with it? He enables audio but don't show the picture when i add the second video.

void videoWindow::video_enable(QVideoWidget *output, const QString &path)
{
int i = 1;
player = new QMediaPlayer;

playlist = new QMediaPlaylist;
qDebug() << path;
qDebug() << *filename;

playlist->addMedia(QUrl::fromLocalFile(path)); // test of the user's path

if (i == 1)
{
    player->setPlaylist(playlist);
    playlist->setCurrentIndex(1); // start from a first video in the playlist
}
else
{
    playlist->next();
}

player->setVideoOutput(output);
player->play();
i++;
}

Aucun commentaire:

Enregistrer un commentaire