/** Encapsulates properties of a media capture file. */ interface MediaFile { /** The name of the file, without path information. */ name: string; /** The full path of the file, including the name. */ fullPath: string; /** The file's mime type */ type: string; /** The date and time when the file was last modified. */ lastModifiedDate: Date; /** The size of the file, in bytes. */ size: number; /** * Retrieves format information about the media capture file. * @param successCallback Invoked with a MediaFileData object when successful. * @param errorCallback Invoked if the attempt fails, this function. */ getFormatData( successCallback: (data: MediaFileData) =>void, errorCallback?: () =>void): void; }
---------------------------
/** Encapsulates video capture configuration options. */ interface VideoOptions { /** * The maximum number of video clips the device's user can capture in a single * capture operation. The value must be greater than or equal to 1. */ limit?: number; /** The maximum duration of a video clip, in seconds. */ duration?: number; }
functionvideoCaptureSuccess(mediaFiles) { // Wrap this below in a ~100 ms timeout on Android if // you just recorded the video using the capture plugin. // For some reason it is not available immediately in the file system.
var file = mediaFiles[0]; var videoFileName = 'video-name-here'; // I suggest a uuid
functionvideoTranscodeSuccess(result) { // result is the path to the transcoded video on the device console.log('videoTranscodeSuccess, result: ' + result); }