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.
Download the file
VideoPlayerDialog.py
from the Packt website.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() 16 17 self._dialog.seekSlider.setMediaObject(self.mediaObj) 18 self._dialog.volumeSlider.setAudioOutput( 19 self.audioSink) 20...