Qt 5.11 | Qt Multimedia | C++ Classes | QMediaPlayerControl

Qt 5.11.3 Reference Documentation

# QMediaPlayerControl Class

The QMediaPlayerControl class provides access to the media playing functionality of a QMediaService. More...

Header: | #include <QMediaPlayerControl>
qmake: | QT += multimedia
Inherits: | QMediaControl

- List of all members, including inherited members

## Public Functions

virtual | ~QMediaPlayerControl()
virtual QMediaTimeRange | availablePlaybackRanges() const = 0
virtual int | bufferStatus() const = 0
virtual qint64 | duration() const = 0
virtual bool | isAudioAvailable() const = 0
virtual bool | isMuted() const = 0
virtual bool | isSeekable() const = 0
virtual bool | isVideoAvailable() const = 0
virtual QMediaContent | media() const = 0
virtual QMediaPlayer::MediaStatus | mediaStatus() const = 0
virtual const QIODevice * | mediaStream() const = 0
virtual void | pause() = 0
virtual void | play() = 0
virtual qreal | playbackRate() const = 0
virtual qint64 | position() const = 0
virtual void | setMedia(const QMediaContent &media, QIODevice *stream) = 0
virtual void | setMuted(bool mute) = 0
virtual void | setPlaybackRate(qreal rate) = 0
virtual void | setPosition(qint64 position) = 0
virtual void | setVolume(int volume) = 0
virtual QMediaPlayer::State | state() const = 0
virtual void | stop() = 0
virtual int | volume() const = 0

## Signals

void | audioAvailableChanged(bool audioAvailable)
void | availablePlaybackRangesChanged(const QMediaTimeRange &ranges)
void | bufferStatusChanged(int percentFilled)
void | durationChanged(qint64 duration)
void | error(int error, const QString &errorString)
void | mediaChanged(const QMediaContent &content)
void | mediaStatusChanged(QMediaPlayer::MediaStatus status)
void | mutedChanged(bool mute)
void | playbackRateChanged(qreal rate)
void | positionChanged(qint64 position)
void | seekableChanged(bool seekable)
void | stateChanged(QMediaPlayer::State newState)
void | videoAvailableChanged(bool videoAvailable)
void | volumeChanged(int volume)

## Protected Functions

| QMediaPlayerControl(QObject *parent = nullptr)

## Macros

| QMediaPlayerControl_iid

## Detailed Description

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

If a 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, and buffering progress.

The functionality provided by this control is exposed to application code through the QMediaPlayer class.

The interface name of QMediaPlayerControl is `org.qt-project.qt.mediaplayercontrol/5.0` as defined in QMediaPlayerControl_iid.

See also QMediaService::requestControl() and QMediaPlayer.

## Member Function Documentation

### `[protected]` QMediaPlayerControl::QMediaPlayerControl(QObject *parent = nullptr)

Constructs a new media player control with the given parent.

### `[virtual]` QMediaPlayerControl::~QMediaPlayerControl()

Destroys a media player control.

### `[signal]` void QMediaPlayerControl::audioAvailableChanged(bool audioAvailable)

### `[pure virtual]` QMediaTimeRange QMediaPlayerControl::availablePlaybackRanges() const

### `[signal]` void QMediaPlayerControl::availablePlaybackRangesChanged(const QMediaTimeRange &ranges)

### `[pure virtual]` int QMediaPlayerControl::bufferStatus() const

### `[signal]` void QMediaPlayerControl::bufferStatusChanged(int percentFilled)

### `[pure virtual]` qint64 QMediaPlayerControl::duration() const

### `[signal]` void QMediaPlayerControl::durationChanged(qint64 duration)

### `[signal]` void QMediaPlayerControl::error(int error, const QString &errorString)

### `[pure virtual]` bool QMediaPlayerControl::isAudioAvailable() const

### `[pure virtual]` bool QMediaPlayerControl::isMuted() const

### `[pure virtual]` bool QMediaPlayerControl::isSeekable() const

### `[pure virtual]` bool QMediaPlayerControl::isVideoAvailable() const

### `[pure virtual]` QMediaContent QMediaPlayerControl::media() const

See also setMedia().

### `[signal]` void QMediaPlayerControl::mediaChanged(const QMediaContent &content)

### `[pure virtual]` QMediaPlayer::MediaStatus QMediaPlayerControl::mediaStatus() const

### `[signal]` void QMediaPlayerControl::mediaStatusChanged(QMediaPlayer::MediaStatus status)

### `[pure virtual]` const QIODevice *QMediaPlayerControl::mediaStream() const

### `[signal]` void QMediaPlayerControl::mutedChanged(bool mute)

### `[pure virtual]` void QMediaPlayerControl::pause()

### `[pure virtual]` void QMediaPlayerControl::play()

### `[pure virtual]` qreal QMediaPlayerControl::playbackRate() const

See also setPlaybackRate().

### `[signal]` void QMediaPlayerControl::playbackRateChanged(qreal rate)

### `[pure virtual]` qint64 QMediaPlayerControl::position() const

See also setPosition().

### `[signal]` void QMediaPlayerControl::positionChanged(qint64 position)

### `[signal]` void QMediaPlayerControl::seekableChanged(bool seekable)

### `[pure virtual]` void QMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream)

See also media().

### `[pure virtual]` void QMediaPlayerControl::setMuted(bool mute)

See also isMuted().

### `[pure virtual]` void QMediaPlayerControl::setPlaybackRate(qreal rate)

See also playbackRate().

### `[pure virtual]` void QMediaPlayerControl::setPosition(qint64 position)

See also position().

### `[pure virtual]` void QMediaPlayerControl::setVolume(int volume)

See also volume().

### `[pure virtual]` QMediaPlayer::State QMediaPlayerControl::state() const

### `[signal]` void QMediaPlayerControl::stateChanged(QMediaPlayer::State newState)

### `[pure virtual]` void QMediaPlayerControl::stop()

### `[signal]` void QMediaPlayerControl::videoAvailableChanged(bool videoAvailable)

### `[pure virtual]` int QMediaPlayerControl::volume() const

See also setVolume().

### `[signal]` void QMediaPlayerControl::volumeChanged(int volume)

## Macro Documentation

### QMediaPlayerControl_iid

`org.qt-project.qt.mediaplayercontrol/5.0`

Defines the interface name of the QMediaPlayerControl class.