I want to repeat only one song. But it doesn't work as I expected.
Item {
id: repeat
height: parent.height *0.2
width: parent.height *0.2
x: parent.width * 0.015
y: parent.height * 0.15
anchors.horizontalCenter: parent.left
Image {
anchors.rightMargin: -220
anchors.bottomMargin: -23
anchors.leftMargin: 188
anchors.topMargin: 0
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: mediaplayer.isPlaying == false?"Images/IconRepeat_On.png":"Images/IconRepeat_Off.png"
}
ColorOverlay {
anchors.fill: parent
source: parent
color: "white"
anchors.rightMargin: -220
anchors.bottomMargin: -23
anchors.leftMargin: 188
anchors.topMargin: 0
}
SoundEffect {
id: playSound
loops: SoundEffect.Infinite
source: "file:///var/media_player/FSoftADS.mp4"
}
MouseArea {
anchors.rightMargin: -220
anchors.bottomMargin: -23
anchors.leftMargin: 188
anchors.topMargin: 0
anchors.fill: parent
onPressed: {playMusic.play()}
}
}
}
error display is ReferenceError: playMusic is not defined