| ID | Creation date | May 6, 2009 | |
| Platform | S60 2nd Edition, S60 3rd Edition, S60 5th Edition | Tested on devices | Nokia N95, Nokia E90 |
| Category | M | Subcategory | Video |
| Keywords (APIs, classes, methods, functions): video, cam |
This article shows how to record and play video in m.
Note: The create function of the video module requires the Write permission.
Note: The open function of the video module requires the Read permission.
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
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
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()
The first snippet displays information about various settings, the second snippet records video and the third snippet plays video.
No related wiki articles found