O'Reilly logo

Python Multimedia Beginner's Guide by Ninad Sathaye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - developing the video player code

Let's develop the rest of the video player backend. We will re-use several methods from the AudioPlayerDialog class with a few minor changes. Only the important methods will be covered in this section.

  1. Download the file VideoPlayerDialog.py from the Packt website.
  2. The constructor of the class is shown below.
    1 def __init__(self): 2 QMainWindow.__init__(self) 3 self.mediaSource = None 4 self.audioPath = '' 5 6 # Initialize some other variables. 7 self._filePath = '' 8 self._dialog = None 9 10 # Create self._dialog instance and call 11 # necessary methods to create a user interface 12 self._createUI() 13 14 self.mediaObj = self._dialog.videoPlayer.mediaObject() 15 self.audioSink = self._dialog.videoPlayer.audioOutput() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required