Skip to content
Snippets Groups Projects
Commit c30670ce authored by Ujjawal Kumar's avatar Ujjawal Kumar Committed by Steve Lhomme
Browse files

Qt: Prevent buffering display when seeking by adding timeout

parent 6c7ddb90
No related branches found
No related tags found
1 merge request!6977Qt: Prevent Immediate Buffering Display When Seeking by Adding Timeout
Pipeline #576767 passed with stages
in 34 minutes and 2 seconds
......@@ -394,12 +394,36 @@ T.ProgressBar {
property int bufferAnimPosition: 0
property int bufferFrames: 1000
property alias animateLoading: loadingAnim.running
property bool display: false
property bool buffering: Player.buffering > 0 && Player.buffering < 1
height: control.barHeight
opacity: 0.4
color: theme.fg.neutral //FIXME buffer color ?
radius: control.barHeight
Timer {
id: bufferingTimer
interval: VLCStyle.humanMoment
repeat: false
running: false
onTriggered: {
bufferRect.display = true
}
}
onBufferingChanged: {
if(buffering)
{
bufferingTimer.start()
}
else
{
bufferingTimer.stop()
bufferRect.display = false
}
}
states: [
State {
name: "hidden"
......@@ -425,7 +449,7 @@ T.ProgressBar {
},
State {
name: "time to start playing known"
when: control.visible && Player.buffering < 1
when: control.visible && bufferRect.display
PropertyChanges {
target: bufferRect
width: Player.buffering * parent.width
......@@ -436,7 +460,7 @@ T.ProgressBar {
},
State {
name: "playing from buffer"
when: control.visible && Player.buffering === 1
when: control.visible && !bufferRect.display
PropertyChanges {
target: bufferRect
width: Player.buffering * parent.width
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment