Update background audio element to use new service name
Change-Id: I8f0480e4fb40b034f75dcd900f2d440fd0e7610d Reviewed-on: http://codereview.qt-project.org/4493 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: derick hawcroft <derick.hawcroft@nokia.com>
This commit is contained in:
@@ -48,7 +48,7 @@ void QDeclarativeBackgroundAudio::classBegin()
|
||||
|
||||
void QDeclarativeBackgroundAudio::componentComplete()
|
||||
{
|
||||
setObject(this, QMediaServiceProviderHint(QMediaServiceProviderHint::BackgroundPlayback));
|
||||
setObject(this, Q_MEDIASERVICE_BACKGROUNDMEDIAPLAYER);
|
||||
if (m_mediaService) {
|
||||
m_backgroundPlaybackControl =
|
||||
static_cast<QMediaBackgroundPlaybackControl*>(
|
||||
@@ -61,6 +61,8 @@ void QDeclarativeBackgroundAudio::componentComplete()
|
||||
} else {
|
||||
qWarning("can not get QMediaBackgroundPlaybackControl!");
|
||||
}
|
||||
} else {
|
||||
qWarning("Unable to get any background mediaplayer!");
|
||||
}
|
||||
QDeclarativeMediaBase::componentComplete();
|
||||
}
|
||||
|
||||
@@ -260,12 +260,12 @@ void QDeclarativeMediaBase::shutdown()
|
||||
|
||||
}
|
||||
|
||||
void QDeclarativeMediaBase::setObject(QObject *object, const QMediaServiceProviderHint& hint)
|
||||
void QDeclarativeMediaBase::setObject(QObject *object, const QByteArray &type)
|
||||
{
|
||||
m_qmlObject = object;
|
||||
|
||||
if ((m_mediaProvider = QMediaServiceProvider::defaultServiceProvider()) != 0) {
|
||||
m_mediaService = m_mediaProvider->requestService(Q_MEDIASERVICE_MEDIAPLAYER, hint);
|
||||
m_mediaService = m_mediaProvider->requestService(type);
|
||||
if (m_mediaService != 0) {
|
||||
m_playerControl = qobject_cast<QMediaPlayerControl *>(
|
||||
m_mediaService->requestControl(QMediaPlayerControl_iid));
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
protected:
|
||||
void shutdown();
|
||||
|
||||
void setObject(QObject *object, const QMediaServiceProviderHint& hint = QMediaServiceProviderHint());
|
||||
void setObject(QObject *object, const QByteArray &type = Q_MEDIASERVICE_MEDIAPLAYER);
|
||||
|
||||
virtual void sourceChanged() = 0;
|
||||
virtual void autoLoadChanged() = 0;
|
||||
|
||||
Reference in New Issue
Block a user