media_player#

Module Contents#

MediaPlayerBase

Media player base class

MediaPlayer

Media player

class MediaPlayerBase(parent=None)#

Bases: PyQt5.QtCore.QObject

Media player base class

mediaStatusChanged#
playbackRateChanged#
positionChanged#
durationChanged#
sourceChanged#
volumeChanged#
mutedChanged#
abstract isPlaying()#

Whether the media is playing

abstract mediaStatus() PyQt5.QtMultimedia.QMediaPlayer.MediaStatus#

Return the status of the current media stream

abstract playbackState() PyQt5.QtMultimedia.QMediaPlayer.State#

Return the playback status of the current media stream

abstract duration()#

Returns the duration of the current media in ms

abstract position()#

Returns the current position inside the media being played back in ms

abstract volume()#

Return the volume of player

abstract source() PyQt5.QtCore.QUrl#

Return the active media source being used

abstract pause()#

Pause playing the current source

abstract play()#

Start or resume playing the current source

abstract stop()#

Stop playing, and reset the play position to the beginning

abstract playbackRate() float#

Return the playback rate of the current media

abstract setPosition(position: int)#

Sets the position of media in ms

abstract setSource(media: PyQt5.QtCore.QUrl)#

Sets the current source

abstract setPlaybackRate(rate: float)#

Sets the playback rate of player

abstract setVolume(volume: int)#

Sets the volume of player

abstract setMuted(isMuted: bool)#
abstract videoOutput() PyQt5.QtCore.QObject#

Return the video output to be used by the media player

abstract setVideoOutput(output: PyQt5.QtCore.QObject) None#

Sets the video output to be used by the media player

class MediaPlayer(parent=None)#

Bases: PyQt5.QtMultimedia.QMediaPlayer

Media player

sourceChanged#
isPlaying()#
source() PyQt5.QtCore.QUrl#

Return the active media source being used

setSource(media: PyQt5.QtCore.QUrl)#

Sets the current source