Lens Scripting API
    Preparing search index...

    Class BlobWearable Only Camera Kit

    Represents a blob, which is a file-like object of immutable, raw data. Can be read as text or binary data. Currently the binary data is only supported as Uint8Array.

    socket.onmessage = async (event) => {
    if (event.data instanceof Blob) {
    // Binary frame, can be retrieved as either Uint8Array or string
    let bytes = await event.data.bytes();
    let text = await event.data.text();

    print("Received binary message, printing as text: " + text);
    }
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Wearable Only Camera Kit

      Construct a new Blob from blob parts and optional options.

      Parameters

      • OptionalblobParts: string[] | Uint8Array | Blob

        Optional array of strings, Uint8Arrays, or other Blobs to be combined into the blob

      • Optionaloptions: any

        Optional object containing properties like 'type' for MIME type

      Returns Blob

    Properties

    size: number

    The size of the blob's data in bytes.

    type: string

    The MIME type of the blob.

    Methods

    • Wearable Only Camera Kit

      Returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.

      Returns Promise<Uint8Array>

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    • Wearable Only Camera Kit

      Returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.

      Returns Promise<string>