QMediaContent 類

The QMediaContent class provides access to the resources relating to a media content. 更多...

頭: #include <QMediaContent>
qmake: QT += multimedia

公共函數

QMediaContent ()
QMediaContent (const QUrl & url )
QMediaContent (const QNetworkRequest & request )
QMediaContent (const QMediaResource & resource )
QMediaContent (const QMediaResourceList & resources )
QMediaContent (const QMediaContent & other )
QMediaContent (QMediaPlaylist * playlist , const QUrl & contentUrl = QUrl(), bool takeOwnership = false)
~QMediaContent ()
QNetworkRequest canonicalRequest () const
QMediaResource canonicalResource () const
QUrl canonicalUrl () const
bool isNull () const
QMediaPlaylist * playlist () const
QMediaResourceList resources () const
bool operator!= (const QMediaContent & other ) const
QMediaContent & operator= (const QMediaContent & other )
bool operator== (const QMediaContent & other ) const

詳細描述

The QMediaContent class provides access to the resources relating to a media content.

QMediaContent is used within the multimedia framework as the logical handle to media content. A QMediaContent object is composed of one or more QMediaResource s 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 () 或 canonicalResource () methods, any additional resources are optional.

Alternatively QMediaContent can represent a playlist and contain a pointer to a valid QMediaPlaylist 對象。在此情況下,URL (統一資源定位符) 是可選的且可以為空,或指嚮播放列錶 URL。

成員函數文檔編製

QMediaContent:: QMediaContent ()

Constructs a null QMediaContent .

QMediaContent:: QMediaContent (const QUrl & url )

構造媒體內容采用 url 提供內容引用。

QMediaContent:: QMediaContent (const QNetworkRequest & request )

構造媒體內容采用 request 提供內容引用。

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 & resource )

構造媒體內容采用 resource 提供內容引用。

QMediaContent:: QMediaContent (const QMediaResourceList & resources )

構造媒體內容采用 resources 提供內容引用。

QMediaContent:: QMediaContent (const QMediaContent & other )

構造副本為媒體內容 other .

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

構造媒體內容采用 playlist .

contentUrl 對於播放列錶是可選參數且可以為空。

Set takeOwnership to true if you want QMediaContent to take ownership of the playlist. takeOwnership 被設為 false,在默認情況下。

QMediaContent:: ~QMediaContent ()

銷毀媒體內容對象。

QNetworkRequest QMediaContent:: canonicalRequest () const

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

QMediaResource QMediaContent:: canonicalResource () const

返迴 QMediaResource that represents that canonical resource for this media content.

QUrl QMediaContent:: canonicalUrl () const

返迴 QUrl that represents that canonical resource for this media content.

bool QMediaContent:: isNull () const

返迴 true 若此媒體內容為 null (未被初始化);否則 false。

QMediaPlaylist *QMediaContent:: playlist () const

返迴用於此媒體內容的播放列錶,或 0 若此 QMediaContent 不是播放列錶。

QMediaResourceList QMediaContent:: resources () const

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

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

返迴 true 若 other 不等價於此媒體內容;否則 false。

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

賦值值 other 到此媒體內容。

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

返迴 true 若 other 等價於此媒體內容;否則 false。