Advertisement
Guest User

Untitled

a guest
Nov 1st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.81 KB | None | 0 0
  1. import QtQuick 2.2
  2. import Sailfish.Silica 1.0
  3. // .pro: QT += multimedia
  4. // .yaml: Requires: - qt5-qtmultimedia
  5. import QtMultimedia 5.5
  6.  
  7. Page {
  8.     id: page
  9.  
  10.     allowedOrientations: Orientation.Portrait
  11.  
  12.     Camera {
  13.         id: camera
  14.         captureMode: Camera.CaptureVideo
  15.     }
  16.     VideoOutput {
  17.         anchors.fill: parent
  18.         source: camera
  19.  
  20.         MouseArea {
  21.             anchors.fill: parent
  22.             onClicked: {
  23.                 switch (camera.videoRecorder.recorderState) {
  24.                 case CameraRecorder.StoppedState:
  25.                     camera.videoRecorder.record();
  26.                     break;
  27.                 case CameraRecorder.RecordingState:
  28.                     camera.videoRecorder.stop();
  29.                     break;
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement