Preparing search index...

    Response returned from a music list query, containing either a success result or a service error.

        // MusicListResponse is returned by provider.musicService.fetchAsync().
    // It has a protected constructor — inspect ok/data/error/cancelled after the call.
    const provider = this.pluginSystem.findInterface(
    IAssetLibraryProvider.interfaceId
    ) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;

    const envSetting = new EnvironmentSetting();
    envSetting.environment = Environment.Production;
    envSetting.space = Space.Public;

    const filter = new AssetFilter();
    filter.searchText = 'chill';

    const response = await provider.musicService.fetchAsync(
    new AssetListRequest(envSetting, filter)
    );

    if (response.ok && response.data) {
    console.log('Got', response.data.musicAssets.length, 'music tracks');
    } else if (response.cancelled) {
    console.log('Music fetch was cancelled');
    } else if (response.error) {
    console.log('Music fetch failed:', response.error.description);
    }
    Index

    Constructors

    Properties

    Constructors

    Properties

    cancelled: boolean

    Indicates whether the request was cancelled before completion.

    Holds the successful result of the music list request, if available.

    error?: ServiceError

    Contains the service error if the request failed.

    ok: boolean

    Indicates whether the request completed successfully without errors.