Reputation: 735
I have a video player make in qml. Slider value is binded to Mediaplayer's position as I need to show slider moving along with the video.
Also I need to move the video position to the slider position if slider is moved manually.
I wrote the below code, but i get warning and video is playing each small portion repeatedly when slide bar is moved.
warning is: qt-reserved-files/qml/QtQuick/Controls/Slider.qml:199:5: QML RangeModel: Binding loop detected for property ""
MediaPlayer {
id: idVideo
}
Slider {
id: idSlider
anchors.bottom: idrow.top
anchors.right: parent.right
anchors.rightMargin: 85
width: 400
value: idVideo.position // for slider to move along with movie
minimumValue: 0
maximumValue: idVideo.duration
// for movie to move as slider is moved to manually.
onValueChanged: {
idVideo.seek(idSlider.value)
}
}
If I do not set onValueChanged movie will not seek as slider bar is moved. Is there a solution to this?
Upvotes: 1
Views: 682
Reputation: 735
The issue is on android platform and I solved by below code:
onPressedChanged: {
idVideo.seek(idSlider.value)
}
Upvotes: 0