event.fileSize

类型 字符串
事件 completion
修订版本 2024.3703 版
关键词 completion,fileSize

概述

当用户使用 media.captureVideo()media.selectVideo() 选择或录制视频后触发 completion 事件时,此属性会指示视频的文件大小(以字节为单位)。

示例

-- Video completion listener
local onVideoComplete = function( event )
    print( "video session ended" )
end

-- Capture completion listener
local function onComplete( event )
    if event.completed then
        media.playVideo( event.url, media.RemoteSource, true, onVideoComplete )
        print( event.duration )
        print( event.fileSize )
    end
end

if media.hasSource( media.Camera ) then
    media.captureVideo( { listener=onComplete } )
else
    native.showAlert( "Corona", "This device does not have a camera.", { "OK" } )
end