]> git.tdb.fi Git - xinema.git/blobdiff - remote/qml/pages/PlaybackPage.qml
Implement seeking and play/pause controls in the remote
[xinema.git] / remote / qml / pages / PlaybackPage.qml
index 4a487a4f8cd9b80add977b1ad9b3e52931ef7fce..345960a6c80de994d15c06dc017a865a895804fe 100644 (file)
@@ -49,6 +49,27 @@ Page
 
                                return str+secs;
                        }
+
+                       onDownChanged:
+                       {
+                               if(!down)
+                                       streamControl.position = value;
+                       }
+               }
+
+               IconButton
+               {
+                       id: playPauseButton
+                       anchors.horizontalCenter: parent.horizontalCenter
+                       property string action: (streamControl.playbackState==StreamControl.Playing ? "pause" : "play")
+                       icon.source: "image://theme/icon-l-"+action
+                       onPressed:
+                       {
+                               if(action=="play")
+                                       streamControl.playbackState = StreamControl.Playing;
+                               else if(action=="pause")
+                                       streamControl.playbackState = StreamControl.Paused;
+                       }
                }
        }
 
@@ -59,7 +80,7 @@ Page
                onPositionChanged:
                {
                        if(!slider.down)
-                               slider.value = streamControl.position
+                               slider.value = position;
                }
        }
 }