Advertisement
Guest User

Untitled

a guest
May 16th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. [vince@dozer harbour-advanced-camera]$ git --no-pager diff @~
  2. diff --git a/qml/pages/CameraUI.qml b/qml/pages/CameraUI.qml
  3. index 7d0381a..a0320bb 100644
  4. --- a/qml/pages/CameraUI.qml
  5. +++ b/qml/pages/CameraUI.qml
  6. @@ -120,6 +120,15 @@ Page {
  7. }
  8. }
  9.  
  10. + onRecorderStatusChanged: {
  11. + if (camera.videoRecorder.recorderStatus == CameraRecorder.FinalizingStatus) {
  12. + var path = camera.videoRecorder.outputLocation.toString()
  13. + path = path.replace(/^(file:\/{2})/,"")
  14. + console.log("finalizing: " + path)
  15. + galleryModel.append({ filePath: path })
  16. + }
  17. + }
  18. +
  19. onResolutionChanged: {
  20. console.log("Video resolution changed:", settings.resolution("video"));
  21. camera.viewfinder.resolution = getNearestViewFinderResolution();
  22. diff --git a/qml/pages/GalleryUI.qml b/qml/pages/GalleryUI.qml
  23. index 3764980..d6e8dd3 100644
  24. --- a/qml/pages/GalleryUI.qml
  25. +++ b/qml/pages/GalleryUI.qml
  26. @@ -1,5 +1,7 @@
  27. import QtQuick 2.0
  28. import Sailfish.Silica 1.0
  29. +import QtMultimedia 5.6
  30. +import Nemo.Thumbnailer 1.0
  31. import uk.co.piggz.harbour_advanced_camera 1.0
  32. import "../components/"
  33.  
  34. @@ -27,6 +29,13 @@ Page {
  35. }
  36. }
  37.  
  38. + function isVideo(idx) {
  39. + var fileName = fileList.get(idx).filePath;
  40. + var fileExt = fileName.substr(fileName.lastIndexOf(".") + 1, 3);
  41. + console.log("Detected", fileExt, "extension...");
  42. + return (fileExt === "mp4");
  43. + }
  44. +
  45. RoundButton {
  46. id: btnClose
  47.  
  48. @@ -94,14 +103,20 @@ Page {
  49. height: parent.height
  50. color: 'black'
  51.  
  52. + property bool isMovie: isVideo(gallery.currentIndex)
  53. +
  54. Image {
  55. id: thumbnail
  56.  
  57. + //visible: isVideo(gallery.currentIndex) ? false : true
  58. + //visible: !isMovie
  59. asynchronous: true
  60. sourceSize.width: parent.width
  61. anchors.fill: parent
  62. fillMode: Image.PreserveAspectFit
  63. - source: "file://" + filePath
  64. + //source: isVideo(gallery.currentIndex) ? "image://theme/icon-l-play" : "file://" + filePath
  65. + //source: isMovie ? "image://theme/icon-l-play" : "file://" + filePath
  66. + source: isMovie ? "image://nemoThumbnail/" + filePath : "file://" + filePath
  67.  
  68. MouseArea {
  69. anchors.fill: parent
  70. @@ -111,6 +126,24 @@ Page {
  71. }
  72. }
  73. }
  74. +/*
  75. + Video {
  76. + id: video
  77. + //visible: isVideo(gallery.currentIndex) ? true : false
  78. + visible: isMovie
  79. +
  80. + //source: isVideo(gallery.currentIndex) ? "file://" + filePath : "image://theme/icon-l-image"
  81. + source: isMovie ? "file://" + filePath : "image://theme/icon-l-image"
  82. + MouseArea {
  83. + anchors.fill: parent
  84. + onClicked: {
  85. + console.log("Clicked video...");
  86. + btnClose.visible = btnClose.visible ? false : true;
  87. + video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play()
  88. + }
  89. + }
  90. + }
  91. +*/
  92. }
  93. }
  94.  
  95. [vince@dozer harbour-advanced-camera]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement