tav-media
Version:
Cross platform media editing framework
85 lines (84 loc) • 2.41 kB
TypeScript
import { Asset } from './tav-asset';
import { Clip } from '../clips/tav-clip';
/**
* Object has videoWidth, videoHeight and duration properties.
* @category Assets
*/
export interface VideoLike {
videoWidth: number;
videoHeight: number;
duration: number;
}
/**
* Defined options used to create a video asset.
* @category Assets
*/
export interface MovieOptions {
/**
* The width of the video.
* * The MovieAsset will skip metadata loading if you
* set the width, height, duration at the same time.
* @optional
*/
width?: number;
/**
* The height of the video.
* * The MovieAsset will skip metadata loading if you
* set the width, height, duration at the same time.
* @optional
*/
height?: number;
/**
* The duration of the video.
* * The MovieAsset will skip metadata loading if you
* set the width, height, duration at the same time.
* @optional
*/
duration?: number;
/**
* Set Chacha data for HLS video.
* @optional
*/
hlsChachaParam?: any;
}
/**
* MovieAsset is an asset that can be used to play video file.
* @hideconstructor
* @category Assets
*/
export declare class MovieAsset extends Asset {
static MovieOptions: {
[url: string]: MovieOptions;
};
/**
* Creates a TAVMedia Movie object from a specified range of a video file, return null if the file does
* not exist or it's not a valid video file.
* @param path The path of the video file.
* @param options The options of the video file.
* * The MovieAsset will skip metadata loading if you
* set the width, height, duration at the same time.
*/
static MakeFromPath(path: string, options?: MovieOptions): Promise<MovieAsset>;
/**
* Preload videos
* @param urls The urls of the video files you want to preload.
*/
static preload(urls: string[]): Promise<VideoLike[]>;
/**
* Returns `'MovieAsset'`
*/
readonly type: string;
protected rawVideo?: VideoLike;
protected options?: MovieOptions;
private clipId;
/**
* @ignore
*/
$getCopyOrSelfWillBeUsedByClip(clip: Clip): Promise<MovieAsset>;
protected doPrepare(): Promise<void>;
protected createAsset(): Promise<any>;
/**
* Returns the frameRate of this asset.
*/
get frameRate(): number;
}