Stop video playback when we lose policy resources
authorMohammed Sameer <msameer@foolab.org>
Sun, 21 Jul 2013 20:04:50 +0000 (23:04 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 21 Jul 2013 20:04:50 +0000 (23:04 +0300)
qml/PostCaptureItem.qml
qml/PostCaptureView.qml
qml/VideoPlayerPage.qml

index 0cd065f..5e5b79e 100644 (file)
@@ -41,6 +41,12 @@ Item {
         }
     }
 
+    function stopPlayback() {
+        if (loader.item) {
+            loader.item.stop()
+        }
+    }
+
     Loader {
         id: loader
         anchors.fill: parent
index 2d304b7..6810c40 100644 (file)
@@ -274,4 +274,10 @@ Item {
     function restartTimer() {
         hideTimer.restart()
     }
+
+    function policyLost() {
+        if (view.currentItem && view.currentItem.playing) {
+            view.currentItem.stopPlayback()
+        }
+    }
 }
index c87e507..6820030 100644 (file)
@@ -36,6 +36,10 @@ Item {
         return video.play()
     }
 
+    function stop() {
+        return video.stop()
+    }
+
     MouseArea {
         anchors.top: parent.top
         anchors.bottom: toolBar.top