Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [vince@dozer harbour-advanced-camera]$ git --no-pager diff @~
- diff --git a/qml/pages/CameraUI.qml b/qml/pages/CameraUI.qml
- index 7d0381a..a0320bb 100644
- --- a/qml/pages/CameraUI.qml
- +++ b/qml/pages/CameraUI.qml
- @@ -120,6 +120,15 @@ Page {
- }
- }
- + onRecorderStatusChanged: {
- + if (camera.videoRecorder.recorderStatus == CameraRecorder.FinalizingStatus) {
- + var path = camera.videoRecorder.outputLocation.toString()
- + path = path.replace(/^(file:\/{2})/,"")
- + console.log("finalizing: " + path)
- + galleryModel.append({ filePath: path })
- + }
- + }
- +
- onResolutionChanged: {
- console.log("Video resolution changed:", settings.resolution("video"));
- camera.viewfinder.resolution = getNearestViewFinderResolution();
- diff --git a/qml/pages/GalleryUI.qml b/qml/pages/GalleryUI.qml
- index 3764980..d6e8dd3 100644
- --- a/qml/pages/GalleryUI.qml
- +++ b/qml/pages/GalleryUI.qml
- @@ -1,5 +1,7 @@
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- +import QtMultimedia 5.6
- +import Nemo.Thumbnailer 1.0
- import uk.co.piggz.harbour_advanced_camera 1.0
- import "../components/"
- @@ -27,6 +29,13 @@ Page {
- }
- }
- + function isVideo(idx) {
- + var fileName = fileList.get(idx).filePath;
- + var fileExt = fileName.substr(fileName.lastIndexOf(".") + 1, 3);
- + console.log("Detected", fileExt, "extension...");
- + return (fileExt === "mp4");
- + }
- +
- RoundButton {
- id: btnClose
- @@ -94,14 +103,20 @@ Page {
- height: parent.height
- color: 'black'
- + property bool isMovie: isVideo(gallery.currentIndex)
- +
- Image {
- id: thumbnail
- + //visible: isVideo(gallery.currentIndex) ? false : true
- + //visible: !isMovie
- asynchronous: true
- sourceSize.width: parent.width
- anchors.fill: parent
- fillMode: Image.PreserveAspectFit
- - source: "file://" + filePath
- + //source: isVideo(gallery.currentIndex) ? "image://theme/icon-l-play" : "file://" + filePath
- + //source: isMovie ? "image://theme/icon-l-play" : "file://" + filePath
- + source: isMovie ? "image://nemoThumbnail/" + filePath : "file://" + filePath
- MouseArea {
- anchors.fill: parent
- @@ -111,6 +126,24 @@ Page {
- }
- }
- }
- +/*
- + Video {
- + id: video
- + //visible: isVideo(gallery.currentIndex) ? true : false
- + visible: isMovie
- +
- + //source: isVideo(gallery.currentIndex) ? "file://" + filePath : "image://theme/icon-l-image"
- + source: isMovie ? "file://" + filePath : "image://theme/icon-l-image"
- + MouseArea {
- + anchors.fill: parent
- + onClicked: {
- + console.log("Clicked video...");
- + btnClose.visible = btnClose.visible ? false : true;
- + video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play()
- + }
- + }
- + }
- +*/
- }
- }
- [vince@dozer harbour-advanced-camera]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement