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

返回 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。