X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2FMediaPlayer.qml;h=9562f14c82ce2864ed2d7a499e349ae2b3f3e5c3;hb=refs%2Fchanges%2F37%2F18937%2F2;hp=c338af980d3894220db35e75791b14b72ad2a581;hpb=6910d9325af0edb8bcbb88b918603e3a2cd8a446;p=apps%2Fmediaplayer.git diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml index c338af9..9562f14 100644 --- a/app/MediaPlayer.qml +++ b/app/MediaPlayer.qml @@ -59,10 +59,6 @@ ApplicationWindow { player.av_connected = metadata.connected } - if ('position' in metadata) { - player.position = metadata.position - } - if (track) { if ('image' in track) { player.cover_art = track.image @@ -77,6 +73,10 @@ ApplicationWindow { playlistview.currentIndex = track.index } } + + if ('position' in metadata) { + player.position = metadata.position + } } } @@ -213,7 +213,6 @@ ApplicationWindow { target: play offImage: './images/AGL_MediaPlayer_Player_Pause.svg' onClicked: { - player.status = "stopped" mediaplayer.pause() } } @@ -240,10 +239,16 @@ ApplicationWindow { ToggleButton { visible: true - enabled: false checked: player.av_connected - offImage: './images/AGL_MediaPlayer_Bluetooth_Inactive.svg' - onImage: './images/AGL_MediaPlayer_Bluetooth_Active.svg' + onClicked: { + if (checked) + mediaplayer.connect() + else + mediaplayer.disconnect() + } + contentItem: Image { + source: player.av_connected ? './images/AGL_MediaPlayer_Bluetooth_Active.svg' : './images/AGL_MediaPlayer_Bluetooth_Inactive.svg' + } } } }