CopperSpice API  1.9.2
QMediaContent Class Reference

Provides access to the resources relating to a media content. More...

Public Methods

 QMediaContent ()
 
 QMediaContent (const QList< QMediaResource > &resources)
 
 QMediaContent (const QMediaContent &other)
 
 QMediaContent (const QMediaResource &contentResource)
 
 QMediaContent (const QNetworkRequest &contentRequest)
 
 QMediaContent (const QUrl &contentUrl)
 
 QMediaContent (QMediaPlaylist *playlist, const QUrl &contentUrl=QUrl (), bool takeOwnership=false)
 
 ~QMediaContent ()
 
QNetworkRequest canonicalRequest () const
 
QMediaResource canonicalResource () const
 
QUrl canonicalUrl () const
 
bool isNull () const
 
bool operator!= (const QMediaContent &other) const
 
QMediaContent & operator= (const QMediaContent &other)
 
bool operator== (const QMediaContent &other) const
 
QMediaPlaylistplaylist () const
 
QList< QMediaResourceresources () const
 

Detailed Description

QMediaContent is used within the multimedia system as the logical handle to media content. A QMediaContent object is composed of one or more QMediaResource where each resource provides the URL and format information of a different encoding of the content.

A non-null QMediaContent will always have a primary or canonical reference to the content available through the canonicalUrl() or canonicalResource()methods, any additional resources are optional.

Alternatively QMediaContent can represent a playlist and contain a pointer to a valid QMediaPlaylist object. In this case URL is optional and can either be empty or point to the playlist URL.

Constructor & Destructor Documentation

QMediaContent::QMediaContent ( )

Constructs a null QMediaContent.

QMediaContent::QMediaContent ( const QUrl contentUrl)

Constructs a media content with contentUrl, providing a reference to the content.

QMediaContent::QMediaContent ( const QNetworkRequest contentRequest)

Constructs a media content with contentRequest, providing a reference to the content.

This constructor can be used to reference media content via network protocols such as HTTP. This may include additional information required to obtain the resource, such as Cookies or HTTP headers.

QMediaContent::QMediaContent ( const QMediaResource contentResource)

Constructs a media content with contentResource, providing a reference to the content.

QMediaContent::QMediaContent ( const QList< QMediaResource > &  resources)

Constructs a media content with resources providing a reference to the content.

QMediaContent::QMediaContent ( const QMediaContent &  other)

Constructs a copy of the media content other.

QMediaContent::QMediaContent ( QMediaPlaylist playlist,
const QUrl contentUrl = QUrl(),
bool  takeOwnership = false 
)

Constructs a media content with playlist. The contentUrl of a playlist is an optional parameter and can be empty. Set takeOwnership to true if you want QMediaContent to take ownership of the playlist. The takeOwnership is set to false by default.

QMediaContent::~QMediaContent ( )

Destroys the media content object.

Method Documentation

QNetworkRequest QMediaContent::canonicalRequest ( ) const

Returns a QNetworkRequest that represents that canonical resource for this media content.

QMediaResource QMediaContent::canonicalResource ( ) const

Returns a QMediaResource that represents that canonical resource for this media content.

QUrl QMediaContent::canonicalUrl ( ) const

Returns a QUrl that represents that canonical resource for this media content.

bool QMediaContent::isNull ( ) const

Returns true if this media content is null (uninitialized); false otherwise.

bool QMediaContent::operator!= ( const QMediaContent &  other) const

Returns true if other is not equivalent to this media content; false otherwise.

QMediaContent & QMediaContent::operator= ( const QMediaContent &  other)

Assigns the value of other to this media content.

bool QMediaContent::operator== ( const QMediaContent &  other) const

Returns true if other is equivalent to this media content; false otherwise.

QMediaPlaylist * QMediaContent::playlist ( ) const

Returns a playlist for this media content or a nullptr if this QMediaContent is not a playlist.

QList< QMediaResource > QMediaContent::resources ( ) const

Returns a list of alternative resources for this media content. The first item in this list is always the canonical resource.