内容表

上一话题

QMediaPlayer

下一话题

QMediaPlaylist

QMediaPlayerControl

QMediaPlayerControl class provides access to the media playing functionality of a QMediaService . 更多

Inheritance diagram of PySide2.QtMultimedia.QMediaPlayerControl

详细描述

QMediaService can play media is will implement QMediaPlayerControl . This control provides a means to set the media to play, start , pause and stop playback, seek , and control the volume . It also provides feedback on the duration of the media, the current position ,和 buffering progress.

The functionality provided by this control is exposed to application code through the QMediaPlayer 类。

The interface name of QMediaPlayerControl is org.qt-project.qt.mediaplayercontrol/5.0 作为定义在 QMediaPlayerControl_iid .

class QMediaPlayerControl ( [ parent=None ] )
param parent

QObject

Constructs a new media player control with the given parent .

PySide2.QtMultimedia.QMediaPlayerControl. audioAvailableChanged ( audioAvailable )
参数

audioAvailable bool

PySide2.QtMultimedia.QMediaPlayerControl. availablePlaybackRanges ( )
返回类型

QMediaTimeRange

Returns a range of times in milliseconds that can be played back.

Usually for local files this is a continuous interval equal to [0.. duration() ] or an empty time range if seeking is not supported, but for network sources it refers to the buffered parts of the media.

PySide2.QtMultimedia.QMediaPlayerControl. availablePlaybackRangesChanged ( ranges )
参数

ranges QMediaTimeRange

PySide2.QtMultimedia.QMediaPlayerControl. bufferStatus ( )
返回类型

int

Returns the buffering progress of the current media. Progress is measured in the percentage of the buffer filled.

PySide2.QtMultimedia.QMediaPlayerControl. bufferStatusChanged ( percentFilled )
参数

percentFilled int

PySide2.QtMultimedia.QMediaPlayerControl. duration ( )
返回类型

qint64

Returns the duration of the current media in milliseconds.

PySide2.QtMultimedia.QMediaPlayerControl. durationChanged ( duration )
参数

duration qint64

PySide2.QtMultimedia.QMediaPlayerControl. error ( error , errorString )
参数
  • error int

  • errorString – unicode

PySide2.QtMultimedia.QMediaPlayerControl. isAudioAvailable ( )
返回类型

bool

Identifies if there is audio output available for the current media.

Returns true if audio output is available and false otherwise.

PySide2.QtMultimedia.QMediaPlayerControl. isMuted ( )
返回类型

bool

Returns the mute state of a player control.

PySide2.QtMultimedia.QMediaPlayerControl. isSeekable ( )
返回类型

bool

Identifies if the current media is seekable.

Returns true if it possible to seek within the current media, and false otherwise.

PySide2.QtMultimedia.QMediaPlayerControl. isVideoAvailable ( )
返回类型

bool

Identifies if there is video output available for the current media.

Returns true if video output is available and false otherwise.

PySide2.QtMultimedia.QMediaPlayerControl. media ( )
返回类型

QMediaContent

Returns the current media source.

另请参阅

setMedia()

PySide2.QtMultimedia.QMediaPlayerControl. mediaChanged ( content )
参数

content QMediaContent

PySide2.QtMultimedia.QMediaPlayerControl. mediaStatus ( )
返回类型

MediaStatus

Returns the status of the current media.

PySide2.QtMultimedia.QMediaPlayerControl. mediaStatusChanged ( status )
参数

status MediaStatus

PySide2.QtMultimedia.QMediaPlayerControl. mediaStream ( )
返回类型

QIODevice

Returns the current media stream. This is only a valid if a stream was passed to setMedia() .

另请参阅

setMedia()

PySide2.QtMultimedia.QMediaPlayerControl. mutedChanged ( mute )
参数

mute bool

PySide2.QtMultimedia.QMediaPlayerControl. pause ( )

Pauses playback of the current media.

If successful the player control will immediately enter the paused 状态。

PySide2.QtMultimedia.QMediaPlayerControl. play ( )

Starts playback of the current media.

If successful the player control will immediately enter the playing 状态。

另请参阅

state()

PySide2.QtMultimedia.QMediaPlayerControl. playbackRate ( )
返回类型

qreal

Returns the rate of playback.

另请参阅

setPlaybackRate()

PySide2.QtMultimedia.QMediaPlayerControl. playbackRateChanged ( rate )
参数

rate qreal

PySide2.QtMultimedia.QMediaPlayerControl. position ( )
返回类型

qint64

Returns the current playback position in milliseconds.

另请参阅

setPosition()

PySide2.QtMultimedia.QMediaPlayerControl. positionChanged ( position )
参数

position qint64

PySide2.QtMultimedia.QMediaPlayerControl. seekableChanged ( seekable )
参数

seekable bool

PySide2.QtMultimedia.QMediaPlayerControl. setMedia ( media , stream )
参数

设置当前 media source. If a stream is supplied; data will be read from that instead of attempting to resolve the media source. The media source may still be used to supply media information such as mime type.

Setting the media to a null QMediaContent will cause the control to discard all information relating to the current media source and to cease all I/O operations related to that media.

Qt resource files are never passed as is. If the service supports StreamPlayback stream is supplied, pointing to an opened QFile . Otherwise, the resource is copied into a temporary file and media contains the url to that file.

另请参阅

media()

PySide2.QtMultimedia.QMediaPlayerControl. setMuted ( mute )
参数

mute bool

设置 mute state of a player control.

另请参阅

isMuted()

PySide2.QtMultimedia.QMediaPlayerControl. setPlaybackRate ( rate )
参数

rate qreal

设置 rate of playback.

另请参阅

playbackRate()

PySide2.QtMultimedia.QMediaPlayerControl. setPosition ( position )
参数

position qint64

Sets the playback position of the current media. This will initiate a seek and it may take some time for playback to reach the position set.

另请参阅

position()

PySide2.QtMultimedia.QMediaPlayerControl. setVolume ( volume )
参数

volume int

Sets the audio volume of a player control.

The volume is scaled linearly, ranging from 0 (silence) to 100 (full volume).

另请参阅

volume()

PySide2.QtMultimedia.QMediaPlayerControl. state ( )
返回类型

State

Returns the state of a player control.

PySide2.QtMultimedia.QMediaPlayerControl. stateChanged ( newState )
参数

newState State

PySide2.QtMultimedia.QMediaPlayerControl. stop ( )

Stops playback of the current media.

If successful the player control will immediately enter the stopped 状态。

PySide2.QtMultimedia.QMediaPlayerControl. videoAvailableChanged ( videoAvailable )
参数

videoAvailable bool

PySide2.QtMultimedia.QMediaPlayerControl. volume ( )
返回类型

int

Returns the audio volume of a player control.

另请参阅

setVolume()

PySide2.QtMultimedia.QMediaPlayerControl. volumeChanged ( volume )
参数

volume int