Description

Provides access to a remote media.

Example

// @input Asset.BitmojiModule bitmojiModule
// @input Asset.RemoteMediaModule remoteMediaModule
// @input Asset.Material pbrMaterialHolder

script.bitmojiModule.requestBitmoji3DResource(
function (bitmoji3DResource) {
script.remoteMediaModule.loadResourceAsGltfAsset(
bitmoji3DResource,
onDownloaded,
onFail
)
}
)

function onDownloaded (gltfAsset){
var root = scene.createSceneObject("BitmojiAvatar");
var avatar = gltfAsset.tryInstantiate(root, script.pbrMaterialHolder);
}

function onFail (e){
print(e);
}
interface RemoteMediaModule {
    name: string;
    uniqueIdentifier: string;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
    loadResourceAsAudioTrackAsset(resource, onSuccess, onFailure): void;
    loadResourceAsGltfAsset(resource, onSuccess, onFailure): void;
    loadResourceAsImageTexture(resource, onSuccess, onFailure): void;
    loadResourceAsVideoTexture(resource, onSuccess, onFailure): void;
}

Hierarchy (view full)

Properties

name: string

Description

The name of the Asset in Lens Studio.

uniqueIdentifier: string

Methods

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

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

  • Parameters

    • resource: DynamicResource
    • onSuccess: ((glTFAsset) => void)
    • onFailure: ((errorMessage) => void)
        • (errorMessage): void
        • Parameters

          • errorMessage: string

          Returns void

    Returns void

    Description

    Downloads the remote image resource from the DynamicResource object and loads the resource as AudioTrackAsset.

  • Parameters

    • resource: DynamicResource
    • onSuccess: ((glTFAsset) => void)
        • (glTFAsset): void
        • Parameters

          Returns void

    • onFailure: ((errorMessage) => void)
        • (errorMessage): void
        • Parameters

          • errorMessage: string

          Returns void

    Returns void

    Description

    Downloads a remote 3D GLTF file given a DynamicResource.

  • Parameters

    • resource: DynamicResource
    • onSuccess: ((texture) => void)
        • (texture): void
        • Parameters

          Returns void

    • onFailure: ((errorMessage) => void)
        • (errorMessage): void
        • Parameters

          • errorMessage: string

          Returns void

    Returns void

    Description

    Downloads the remote image resource from the DynamicResource object and loads the resource as an Image Texture.

  • Parameters

    • resource: DynamicResource
    • onSuccess: ((texture) => void)
        • (texture): void
        • Parameters

          Returns void

    • onFailure: ((errorMessage) => void)
        • (errorMessage): void
        • Parameters

          • errorMessage: string

          Returns void

    Returns void

    Description

    Downloads the remote image resource from the DynamicResource object and loads the resource as a VideoTextureProvider.

Generated using TypeDoc