QMediaObject

The QMediaObject class provides a common base for multimedia objects. More

Inheritance diagram of PySide2.QtMultimedia.QMediaObject

Inherited by: QAudioDecoder, QCamera, QMediaPlayer, QRadioTuner

Synopsis

Functions

Virtual functions

Signals

Detailed Description

It provides some basic functionality that is common to other high level classes like QMediaPlayer , QAudioDecoder and QCamera , including availability and meta-data functionality, as well as functionality to connect media objects with support classes like QMediaPlaylist .

The higher level QMediaObject derived classes provide the actual multimedia functionality, by internally using a QMediaService . Each media object hosts a QMediaService and uses the QMediaControl interfaces implemented by the service to implement its API. These controls can be accessed from the media object if necessary, but in general the useful functionality can be accessed from the higher level classes.

Most media objects when constructed will request a new QMediaService instance, but some like QMediaRecorder and QAudioRecorder will share a service with another object.

class QMediaObject(parent, service)
param parent

QObject

param service

QMediaService

Constructs a media object which uses the functionality provided by a media service .

The parent is passed to QObject .

This class is meant as a base class for multimedia objects so this constructor is protected.

PySide2.QtMultimedia.QMediaObject.addPropertyWatch(name)
Parameters

nameQByteArray

Watch the property name . The property’s notify signal will be emitted once every notifyInterval milliseconds.

See also

notifyInterval

PySide2.QtMultimedia.QMediaObject.availability()
Return type

AvailabilityStatus

Returns the availability of the functionality offered by this object.

In some cases the functionality may not be available (for example, if the current operating system or platform does not provide the required functionality), or it may be temporarily unavailable (for example, audio playback during a phone call or similar).

PySide2.QtMultimedia.QMediaObject.availabilityChanged(availability)
Parameters

availabilityAvailabilityStatus

PySide2.QtMultimedia.QMediaObject.availabilityChanged(available)
Parameters

availablebool

PySide2.QtMultimedia.QMediaObject.availableMetaData()
Return type

list of strings

Returns a list of keys there is meta-data available for.

PySide2.QtMultimedia.QMediaObject.bind(arg__1)
Parameters

arg__1QObject

Return type

bool

Bind object to this QMediaObject instance.

This method establishes a relationship between this media object and a helper object. The nature of the relationship depends on both parties. This methods returns true if the helper was successfully bound, false otherwise.

Most subclasses of QMediaObject provide more convenient functions that wrap this functionality, so this function rarely needs to be called directly.

The object passed must implement the QMediaBindableInterface interface.

PySide2.QtMultimedia.QMediaObject.isAvailable()
Return type

bool

Returns true if the service is available for use.

PySide2.QtMultimedia.QMediaObject.isMetaDataAvailable()
Return type

bool

Returns true if there is meta-data associated with this media object, else false.

PySide2.QtMultimedia.QMediaObject.metaData(key)
Parameters

key – unicode

Return type

object

Returns the value associated with a meta-data key .

See the list of predefined meta-data keys .

PySide2.QtMultimedia.QMediaObject.metaDataAvailableChanged(available)
Parameters

availablebool

PySide2.QtMultimedia.QMediaObject.metaDataChanged()
PySide2.QtMultimedia.QMediaObject.metaDataChanged(key, value)
Parameters
  • key – unicode

  • value – object

PySide2.QtMultimedia.QMediaObject.notifyInterval()
Return type

int

PySide2.QtMultimedia.QMediaObject.notifyIntervalChanged(milliSeconds)
Parameters

milliSecondsint

PySide2.QtMultimedia.QMediaObject.removePropertyWatch(name)
Parameters

nameQByteArray

Remove property name from the list of properties whose changes are regularly signaled.

See also

notifyInterval

PySide2.QtMultimedia.QMediaObject.service()
Return type

QMediaService

Returns the media service that provides the functionality of this multimedia object.

PySide2.QtMultimedia.QMediaObject.setNotifyInterval(milliSeconds)
Parameters

milliSecondsint

See also

notifyInterval()

PySide2.QtMultimedia.QMediaObject.unbind(arg__1)
Parameters

arg__1QObject

Detach object from the QMediaObject instance.

Unbind the helper object from this media object. A warning will be generated if the object was not previously bound to this object.