@@ -42,7 +42,8 @@ MessageDelegate {
|
|||||||
bubbleContent: ColumnLayout {
|
bubbleContent: ColumnLayout {
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: audio
|
id: audio
|
||||||
source: root.progressInfo.localPath
|
onErrorOccurred: (error, errorString) => console.warn("Audio playback error:" + error + errorString)
|
||||||
|
audioOutput: AudioOutput {}
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
@@ -73,18 +74,19 @@ MessageDelegate {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "paused"
|
name: "paused"
|
||||||
when: root.progressInfo.completed && (audio.playbackState === Audio.StoppedState || audio.playbackState === Audio.PausedState)
|
when: root.progressInfo.completed && (audio.playbackState === MediaPlayer.StoppedState || audio.playbackState === MediaPlayer.PausedState)
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: playButton
|
target: playButton
|
||||||
icon.name: "media-playback-start"
|
icon.name: "media-playback-start"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
audio.play()
|
audio.source = root.progressInfo.localPath;
|
||||||
|
audio.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "playing"
|
name: "playing"
|
||||||
when: root.progressInfo.completed && audio.playbackState === Audio.PlayingState
|
when: root.progressInfo.completed && audio.playbackState === MediaPlayer.PlayingState
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: playButton
|
target: playButton
|
||||||
|
|||||||
Reference in New Issue
Block a user