Advertisement
RybaSG

Qt

Sep 5th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
  2. {
  3.     ui->setupUi(this);
  4.  
  5.     QVideoWidget *_vw = new QVideoWidget;
  6.     QMediaPlayer *_player = new QMediaPlayer(ui->cameraWidget);
  7.     ui->gridLayout_2->addWidget(_vw);
  8.     _player->setVideoOutput(_vw);
  9.  
  10.     const QUrl url = QUrl("rtsp://192.168.200.102:5554/playlist.m3u");
  11.     const QNetworkRequest requestRtsp(url);
  12.     _player->setMedia(requestRtsp);
  13.     _player->play();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement