From 355c4f0f70af36eabfb78d49adec52e91e766865 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 6 Nov 2017 18:29:39 -0800 Subject: mediaplayer: qml: get initial metadata from playlist on startup Get initial metadata from first item on playlist on application startup Bug-AGL: SPEC-1052 Change-Id: I4bc32da682005808955dc3fad5568dd03bd84331 Signed-off-by: Matt Ranostay --- app/api/MediaPlayer.qml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/api/MediaPlayer.qml b/app/api/MediaPlayer.qml index ffdb870..c7f4ff2 100644 --- a/app/api/MediaPlayer.qml +++ b/app/api/MediaPlayer.qml @@ -72,6 +72,9 @@ WebSocket { root.running = response.playing } } else if (verb == "metadata") { + root.title = response.title ? response.title : '' + root.artist = response.artist ? response.artist : '' + root.cover_art = response.image ? response.image : '' } break @@ -135,6 +138,7 @@ WebSocket { sendSocketMessage("subscribe", { value: "metadata" }) sendSocketMessage("playlist", 'None') sendSocketMessage("subscribe", { value: "playlist" }) + sendSocketMessage("metadata", 'None') break case WebSocket.Error: root.statusString = "WebSocket error: " + root.errorString -- cgit 1.2.3-korg