diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-12-19 15:04:54 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-12-19 15:04:54 -0800 |
commit | f2835952c4c1a47f8c8bc8dbb343d7980f49ef8f (patch) | |
tree | 95e86609ac3c7958216807ec83afbfea18d70a6e | |
parent | 2a7c5592575a490c986e51584c1613ce2189b2b1 (diff) |
libqtappfw: mediaplayer: set album art via qml context
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.cpp | 9 |
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); } } } |