Banuba WebAR JavaScript API Reference
    Preparing search index...

    Type Alias InputOptions

    Customizes production of Input frames

    type InputOptions = {
        crop?: (
            frameWidth: number,
            frameHeight: number,
        ) => [cropX: number, cropY: number, cropWidth: number, cropHeight: number];
        horizontalFlip?: boolean;
        orientation?: Orientation;
        textureOrientation?: Orientation;
    }
    Index

    Properties

    crop?: (
        frameWidth: number,
        frameHeight: number,
    ) => [cropX: number, cropY: number, cropWidth: number, cropHeight: number]

    Crops the source frame

    player.use(
    new Webcam(),
    {
    // renders square frames
    crop: (width, height) => [(width - height) / 2, 0, height, height],
    },
    )
    horizontalFlip?: boolean

    Mirrors the source frames by X axis

    player.use(
    new MediaStream(
    await navigator.mediaDevices.getUserMedia({ video: true }),
    ),
    {
    horizontalFlip: true,
    },
    )
    orientation?: Orientation

    Source orientation counterclockwise (default: 0)

    textureOrientation?: Orientation

    Source texture orientation (default: same as orientation)