QMediaControl¶
The
QMediaControl
class provides a base interface for media service controls. More…

Inherited by: QAudioDecoderControl, QAudioEncoderSettingsControl, QAudioInputSelectorControl, QAudioOutputSelectorControl, QAudioRoleControl, QCameraCaptureBufferFormatControl, QCameraCaptureDestinationControl, QCameraControl, QCameraExposureControl, QCameraFeedbackControl, QCameraImageCaptureControl, QCameraImageProcessingControl, QCameraInfoControl, QCameraLocksControl, QCameraViewfinderSettingsControl, QCameraViewfinderSettingsControl2, QCameraZoomControl, QCustomAudioRoleControl, QImageEncoderControl, QMediaAudioProbeControl, QMediaAvailabilityControl, QMediaContainerControl, QMediaGaplessPlaybackControl, QMediaNetworkAccessControl, QMediaPlayerControl, QMediaRecorderControl, QMediaStreamsControl, QMediaVideoProbeControl, QMetaDataReaderControl, QMetaDataWriterControl, QRadioDataControl, QRadioTunerControl, QVideoDeviceSelectorControl, QVideoEncoderSettingsControl, QVideoRendererControl, QVideoWindowControl, QVideoWidgetControl
Detailed Description¶
Media controls provide an interface to individual features provided by a media service. Most services implement a principal control which exposes the core functionality of the service and a number of optional controls which expose any additional functionality.
A pointer to a control implemented by a media service can be obtained using the
requestControl()
member ofQMediaService
. If the service doesn’t implement a control it will instead return a null pointer.self.control = QMediaPlayerControl() self.qobject_cast = QMediaPlayerControl() self.qobject_cast.requestControl("org.qt-project.qt.mediaplayercontrol/5.0")Alternatively if the IId of the control has been declared using
Q_MEDIA_DECLARE_CONTROL
the template version ofrequestControl()
can be used to request the service without explicitly passing the IId or usingqobject_cast()
.self.control = QMediaPlayerControl() self.mediaService.requestControl()Most application code will not interface directly with a media service’s controls, instead the
QMediaObject
which owns the service acts as an intermediary between one or more controls and the application.See also
-
class
QMediaControl
([parent=None])¶ - param parent
QObject
Constructs a media control with the given
parent
.