pyqt5 video widget

In this article you’ll see the code to create a video player with PyQT5.
It contains a menu bar for opening the video file.

pyqt video player

PyQt5 supports multimedia, including a video widget: QVideoWidget. This is used in combination with the class QMediaPlayer.

The QMediaPlayer class has all kinds of properties that you may know from video players: audioAvailable, duration, position, volume and a few others.

Related course:

Introduction

We create a window (QMainWindow) that contains a widget for its contents (QWidget).
Then we add the videowidget and control widgets.

The player will only play a video, in this example we don’t use back buttons, stop buttons.

QMediaPlayer Example

The complete code below:


 

Previous Post
Next Post

Leave a Reply