Tutorial: Create a video app
The ability to record video directly from your app can create an enhanced user experience. Rather than exiting or suspending your app to open another app to record video, you can add this video functionality to your app so your users can record video without ever having to leave your app. For example, if you created a video app that submits videos to a video archive web site, your users could record a video and submit it directly from within your app.
This tutorial will show you how to create a video app that lets you record video and save it on the device.
You will learn to:
- Set up a project
- Trigger video capture
- Set camera properties
- Record video
Set up your app
Setting up an app is pretty similar whether we're using QML or C++ to do it. For more information on how to set up your app in both ways, see Set up your project.
Before you begin
Recording video with your camera app starts by opening a camera and starting the viewfinder. Before your app can open a camera unit, you must define a Camera control in your app's main.qml file. Within your Camera control definition, you must also define a SystemSound object, and a CameraSettings object. If you're not using C++ to define these objects, then they're put within the QML camera control definition as attached objects.
Creating a Camera control, attaching objects to it, and then adding the Camera control to your root Container can all be done programmatically using only C++ code. However, developers typically choose to build their UI using QML as shown here.
The SystemSound object is needed to play the required video recording start and stop event sounds when your app starts or stops recording video.
For more information on how to set Camera properties, see Set video properties.
For more information about the Camera properties available, see CameraSettings.
Last modified: 2014-01-07