Hey Everyone! Felt like I should give back to this community and seeing how there is little to no support on how to actually save a video, here is a successful working sample… Enjoy!
(also attached)
local function copyVideoFile(videoPath,dstName,dstPath) local rfilePath=videoPath local wfilePath=system.pathForFile(dstName,dstPath) local rfh=io.open(rfilePath,"rb") local wfh=io.open(wfilePath,"wb") if not(wfh) then return false else local data=rfh:read("\*a") if not(data) then return false else if not(wfh:write(data)) then return false end end end rfh:close() wfh:close() return true end local function onVideoComplete(event) if (event.completed) then local videoFileExtension=".mov" if (system.getInfo("platformName")=="Android") then videoFileExtension=".mp4" end local videoFilePath=string.sub(event.url,8,-1) local savedVideoFileName="video"..videoFileExtension local savedVideoDirectory=system.TemporaryDirectory if (copyVideoFile(videoFilePath,savedVideoFileName,savedVideoDirectory)) then --your video is now saved under (savedVideoDirectory) directory --and the filename of the video is (savedVideoFileName) --do whatever you need to do :) local function mediaPlayListener(event) print("video ended") end media.playVideo(savedVideoFileName,savedVideoDirectory,true,mediaPlayListener) end end end media.captureVideo({listener=onVideoComplete,preferredQuality="high",preferredMaxDuration=20})