Home > Mobile >  MP4 in background(MainWindow) qt6.3
MP4 in background(MainWindow) qt6.3

Time:08-02

I would like to know if there is any class that I can work with that accepts mp4, because the multimedia class is not active in qt6.3. I'm trying to load mp4 files in the background, but I didn't find classes in qt(6.3)

CodePudding user response:

You can use QMediaPlayer for this.

player = new QMediaPlayer;
player->setSource(QUrl::fromLocalFile("/Users/lpapp/Music/song.mp4"));
player->play();

For video rendering, you can even use the QVideoWidget class:

videoWidget = new QVideoWidget;
player->setVideoOutput(videoWidget);
videoWidget->show();
  • Related