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 PySide2.QtMultimedia.QMediaObject(parent, service)

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:

namePySide2.QtCore.QByteArray

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:

available – bool

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__1PySide2.QtCore.QObject

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 – str

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:

available – bool

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

  • value – object

PySide2.QtMultimedia.QMediaObject.notifyInterval()
Return type:

int

The interval at which notifiable properties will update.

The interval is expressed in milliseconds, the default value is 1000.

PySide2.QtMultimedia.QMediaObject.notifyIntervalChanged(milliSeconds)
Parameters:

milliSeconds – int

PySide2.QtMultimedia.QMediaObject.removePropertyWatch(name)
Parameters:

namePySide2.QtCore.QByteArray

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

See also

notifyInterval

PySide2.QtMultimedia.QMediaObject.service()
Return type:

PySide2.QtMultimedia.QMediaService

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

PySide2.QtMultimedia.QMediaObject.setNotifyInterval(milliSeconds)
Parameters:

milliSeconds – int

The interval at which notifiable properties will update.

The interval is expressed in milliseconds, the default value is 1000.

PySide2.QtMultimedia.QMediaObject.unbind(arg__1)
Parameters:

arg__1PySide2.QtCore.QObject

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.