跳到主要内容

保存视频至相册(mobile.saveVideoFileToAlbum)

函数

结果,错误 = mobile.saveVideoFileToAlbum(视频路径)

参数

  • 视频路径 文本型

返回值

  • 结果 布尔型

  • 错误 文本型

说明

用于将视频文件 添加到相册

示例

--下载一个视频文件 然后保存到相册

local savePath = "/var/mobile/Media/svip/res/55.mp4"
local status = http.download("http://tk.taobao6.vip/EC/video/5.mp4", savePath ,10 , function (totalLength, currentLength, downloadSpeed)
print(string.format("文件总大小为:%.2f.mb 当前已完成下载:%.2f.mb 当前下载速度: %.2f.mb" , totalLength / 1024 / 1024 ,currentLength / 1024 / 1024 , downloadSpeed / 1024 / 1024))
end)
if status then
local s ,e = mobile.saveVideoFileToAlbum(savePath)
print(s and "保存到相册成功" or "保存到相册失败 error:= " ..e)
end