Record videos
Tagged: video
-
digitalysatorHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)4 years ago #17820
What is the easiest way to record videos (see Mobile Action “Capture Image”)? I am looking for a Mobile Action “Record Video”.
Mathieu RollHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)4 years ago #17825::Hello,
in Simplifier 5.0 there will be a new Mobile Action for Recording Videos.
But the way to do this with 4.5 is by script or client side business object.
var captureVideo = function(oParameters, fnSucceed, fnFail) { if (typeof navigator === "undefined" || !navigator.device || !navigator.device.capture || !navigator.device.capture.captureVideo) { fnFail("Capture video is not defined!"); return; } if (typeof window.resolveLocalFileSystemURL !== "function") { fnFail("Function resolveLocalFileSystemURL is not defined!"); return; } var oConfig = $.extend({ "limit": 1, "duration" : 60 }, oParameters); if (typeof oConfig.limit !== "number") { oConfig.limit = parseInt(oConfig.limit, 10); } if (typeof oConfig.duration !== "number") { oConfig.duration = parseInt(oConfig.duration, 10); } var fnCaptureVideoCallback = function(aMediaFiles) { var oResponseData = {}; if (aMediaFiles.length > 0) { var oVideo = aMediaFiles[0]; oResponseData.name = oVideo.name; oResponseData.fullPath = oVideo.fullPath; oResponseData.lastModifiedDate = oVideo.lastModifiedDate; oResponseData.size = oVideo.size; oResponseData.type = oVideo.type; resolveLocalFileSystemURL(oVideo.localURL, function(oEntry) { oResponseData.fileUrl = oEntry.toURL(); fnSucceed(oResponseData); }); } }; navigator.device.capture.captureVideo(fnCaptureVideoCallback, fnFail, oConfig); }; var oParameters = {limit: 1, duration: 60}; captureVideo(oParameters, function(data) { console.log("onSuccess"); }, function(msg) { console.log("onError", msg); });
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.