diff options
Diffstat (limited to 'src/multimedia/playback/qmediacontent.cpp')
-rw-r--r-- | src/multimedia/playback/qmediacontent.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/multimedia/playback/qmediacontent.cpp b/src/multimedia/playback/qmediacontent.cpp index 95116d02f..6915ae7af 100644 --- a/src/multimedia/playback/qmediacontent.cpp +++ b/src/multimedia/playback/qmediacontent.cpp @@ -123,8 +123,7 @@ private: which provides the URL of the content. A non-null QMediaContent will always have a reference to - the content available through the canonicalUrl() or canonicalRequest() - methods. + the content available through the request() method. 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 @@ -259,24 +258,39 @@ bool QMediaContent::isNull() const } /*! + \since 5.14 + + Returns a QNetworkRequest that represents the resource for this media content. +*/ + +QNetworkRequest QMediaContent::request() const +{ + return (d && !d->requests.isEmpty()) ? d->requests.first() : QNetworkRequest(); +} + +#if QT_DEPRECATED_SINCE(6, 0) +/*! + \obsolete + Returns a QUrl that represents that canonical resource for this media content. */ QUrl QMediaContent::canonicalUrl() const { - return canonicalRequest().url(); + return request().url(); } /*! + \obsolete + Returns a QNetworkRequest that represents that canonical resource for this media content. */ QNetworkRequest QMediaContent::canonicalRequest() const { - return (d && !d->requests.isEmpty()) ? d->requests.first() : QNetworkRequest(); + return request(); } -#if QT_DEPRECATED_SINCE(6, 0) /*! \obsolete |