If media from storage is played and a bluetooth stream starts the play/pause
button will enter an always playing state from the UI when the bluetooth
connection ends.
This patchset fixes this within the MediaPlayer.qml to show the expected
UI results.
Bug-AGL: SPEC-1496
Change-Id: I6ee0dfa2a46d7cf294b2dbf23d2aa54857fb8ffc
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
property int position: 0
property string cover_art: ""
property int position: 0
property string cover_art: ""
- property string status: ""
+ property string status: "stopped"
function time2str(value) {
return Qt.formatTime(new Date(value), 'mm:ss')
function time2str(value) {
return Qt.formatTime(new Date(value), 'mm:ss')
if (data.Connected == "False")
return
if (data.Connected == "False")
return
- if (!bluetooth.av_connected && data.AVPConnected == "True")
+ if (!bluetooth.av_connected && data.AVPConnected == "True") {
+ player.status = "stopped"
+ }
bluetooth.connected = data.Connected == "True"
bluetooth.av_connected = data.AVPConnected == "True"
bluetooth.connected = data.Connected == "True"
bluetooth.av_connected = data.AVPConnected == "True"
- offImage: './images/AGL_MediaPlayer_Player_Play.svg'
- onClicked: {
- if (bluetooth.av_connected) {
- bluetooth.set_avrcp_controls("Play")
- } else {
- mediaplayer.play()
- }
- }
- when: player.status == "playing"
+ when: !bluetooth.av_connected && player.status == "playing"
PropertyChanges {
target: play
offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
onClicked: {
PropertyChanges {
target: play
offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
onClicked: {
+ player.status = "stopped"
offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
onClicked: bluetooth.set_avrcp_controls("Pause")
}
offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
onClicked: bluetooth.set_avrcp_controls("Pause")
}
+ },
+ State {
+ when: !bluetooth.av_connected && player.status != "playing"
+ PropertyChanges {
+ target: play
+ offImage: './images/AGL_MediaPlayer_Player_Play.svg'
+ onClicked: mediaplayer.play()
+ }
+ },
+ State {
+ when: bluetooth.av_connected && bluetooth.state != "playing"
+ PropertyChanges {
+ target: play
+ offImage: './images/AGL_MediaPlayer_Player_Play.svg'
+ onClicked: bluetooth.set_avrcp_controls("Play")
+ }