minigame-std
    Preparing search index...

    Interface CreateVideoFrameSourceOptions

    视频帧源创建选项。

    2.2.0

    import { video } from 'minigame-std';

    const source = video.createVideoFrameSource({
    source: 'https://example.com/video.mp4',
    muted: true,
    loop: true,
    });
    interface CreateVideoFrameSourceOptions {
        autoplay?: boolean;
        crossOrigin?: "" | "anonymous" | "use-credentials";
        height?: number;
        loop?: boolean;
        muted?: boolean;
        source: string;
        width?: number;
    }
    Index

    Properties

    autoplay?: boolean

    是否自动开始播放/解码。

    false

    crossOrigin?: "" | "anonymous" | "use-credentials"

    Web 平台跨域配置。 跨域视频上传 WebGL texture 时通常需要设置为 anonymous,且服务端返回 CORS header。

    height?: number

    期望高度,仅作为平台创建 hint。

    loop?: boolean

    是否循环播放。

    false

    muted?: boolean

    是否静音。 Web 平台通常需要静音才能自动播放。

    false

    source: string

    视频资源。

    小游戏平台支持本地文件路径和 URL;Web 平台只支持 URL,包括通过 URL.createObjectURL 创建的 Blob URL。

    width?: number

    期望宽度,仅作为平台创建 hint。