#include #include #include #include #include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); // Create video widget QVideoWidget *videoWidget = new QVideoWidget; // Create media player QMediaPlayer *player = new QMediaPlayer; // Create audio output and assign volume QAudioOutput *audioOutput = new QAudioOutput; audioOutput->setVolume(0.8); // Volume from 0.0 to 1.0 // Connect audio and video player->setAudioOutput(audioOutput); player->setVideoOutput(videoWidget); // Choose a file QString filename = QFileDialog::getOpenFileName( nullptr, "Select Video File", "", "Video Files (*.mp4 *.avi *.mkv *.mov *.webm);;All Files (*)" ); if (!filename.isEmpty()) { player->setSource(QUrl::fromLocalFile(filename)); // the file could also be an URL. In this case, do not open a file and use: //QUrl videoUrl("http://profesores.elo.utfsm.cl/~agv/elo329/1s22/Assignments/20220430_100849.mp4"); //player->setSource(videoUrl); player->play(); videoWidget->resize(800, 600); videoWidget->show(); } return app.exec(); }