xverse-components-tv
Version:
xverse components tv
61 lines (60 loc) • 1.82 kB
TypeScript
import { RichSurface, Room as XverseRoom, Video, EMediaSourceType } from '@xverse/core';
/**
* 图片
*/
interface IImageMediaOptions {
textureHasAlpha?: boolean;
withMipmap?: boolean;
}
export interface IChangeOptions {
url: string;
type?: EMediaSourceType;
videoInstance?: Video;
}
export interface IChangeBaseTVOptions {
url: string;
videoInstance?: Video;
}
interface IBaseMediaOptions {
bomId: string;
room: XverseRoom;
url: string;
type?: EMediaSourceType;
maxVisibleDistance?: number;
videoInstance?: Video;
mediaOptions?: IImageMediaOptions;
}
export interface IBaseImageOptions extends IBaseMediaOptions {
mediaOptions?: IImageMediaOptions;
}
export declare class BaseMediaRichSurface extends RichSurface {
bomId: string;
maxVisibleDistance: number;
textureHasAlpha: boolean;
withMipmap: boolean;
initd: boolean;
url: string;
private _getUrlPathName;
private _isVideo;
private _isImage;
private _getUrlPathFinalType;
private _getVideoImageUrl;
/** 获取最终的url 并明确类型*/
getFinalUrlAndType(room: XverseRoom, url: string, isOnlyShowFirstFrame?: boolean, posterUrl?: string): {
url: string;
type: EMediaSourceType;
};
/***
* 初始化
* 将options里面的值赋值到BaseMedia中
* 并添加模型
* @param options IBaseMediaOptions
* type 可选 不传默认是 EMediaSourceType.XStaticTextureSource
*/
init(options: IBaseMediaOptions): Promise<void>;
generateUuid(): string;
createGreenScreen: (videoInstance: Video, room: XverseRoom, bomId: string, isNormalGreenScreen: boolean, isIgnoreDepthTest: boolean) => Promise<void>;
changeOptions(options: IChangeOptions): Promise<void>;
dispose(): void;
}
export {};