×
Namespaces

Variants
Actions
Revision as of 12:01, 24 June 2011 by hamishwillee (Talk | contribs)

Archived:How to record and play video in m

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition, S60 5th Edition
Symbian
S60 5th Edition
Platform Security
Capabilities: )
Article
Keywords: video, cam
Created: bogdan.galiceanu (06 May 2009)
Last edited: hamishwillee (24 Jun 2011)

Contents

Overview

This article shows how to record and play video in m.

Preconditions

Note: The create function of the video module requires the Write permission.

Note: The open function of the video module requires the Read permission.

Source code

Retrieving supported settings

use video, cam
 
 
for i in video.recorders do
print i["name"] + "supplied by" + i["supplier"];
print "Formats:";
for j in i["formats"] do
print " " + j["name"] + "by" + j["supplier"];
print " " + "MIME types:";
for k in j["types"] do
print " " + k;
end
end
end
 
print "Available video resolutions:"
for i in cam.sizes(true) do
print i[0] + "x" + i[1];
end

Recording

use video, cam, graph, ui
 
 
//Turn on the camera in video mode
cam.on(-1, true)
//Create a new video file
video.create("C:\\video.mp4")
//Start the viewfinder
cam.view(0, 0, graph.full()[0], graph.full()[1])
 
//Set up the menu with the option to start recording
ui.menu("Options", ["Start"], false)
if ui.cmd() = "Start" then
//Prepare for recording
video.setup();
//Start
video.record();
end
 
//Set up the menu with the option to stop recording
ui.menu("Options", ["Stop"], false)
if ui.cmd() = "Stop" then
//Stop
video.stop();
//Close the video file
video.close();
//Turn off the camera
cam.off();
end

Playing

use video
 
 
//Open the video file
video.open("C:\\video.mp4")
//Set the volume to 80% of the maximum
video.volume(80)
//Start playing it
video.play()
//Wait until playing finishes
video.wait()
//Close the file
video.close()

Postconditions

The first snippet displays information about various settings, the second snippet records video and the third snippet plays video.

40 page views in the last 30 days.
×