summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-12-19 15:04:54 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-12-20 01:28:46 +0000
commitcdfb8ce39e99616d84742c337213fc4bfebd1ad4 (patch)
tree75d245ea5ea8328c33f26fde2f06a8b09040979b
parent2fe094a59c4b6953c0462a4d5f69e164eb5f1d35 (diff)
libqtappfw: mediaplayer: set album art via qml contextguppy_6.99.3guppy/6.99.36.99.3
To avoid race conditions of album art not being displayed on startup Change-Id: Ic5776421cea408d4dbd06efc65b1f7561d45537a Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--mediaplayer/mediaplayer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/mediaplayer/mediaplayer.cpp b/mediaplayer/mediaplayer.cpp
index 186cebe..7efbb7d 100644
--- a/mediaplayer/mediaplayer.cpp
+++ b/mediaplayer/mediaplayer.cpp
@@ -203,7 +203,14 @@ void Mediaplayer::onMessageReceived(MessageType type, Message *message)
if (tmsg->isPlaylistEvent()) {
updatePlaylist(tmsg->eventData().toVariantMap());
} else if (tmsg->isMetadataEvent()) {
- emit metadataChanged(tmsg->eventData().toVariantMap());
+ QVariantMap map = tmsg->eventData().toVariantMap();
+
+ if (map.contains("track") && map.value("track").toMap().contains("image")) {
+ m_context->setContextProperty("AlbumArt",
+ QVariant::fromValue(map.value("track").toMap().value("image")));
+ }
+
+ emit metadataChanged(map);
}
}
}