LensStudio:AssetLibrary.MusicListService
ClassService interface for submitting and managing music list requests.
Index
Example
// Resolve IAssetLibraryProvider to access the MusicListService.
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as IAssetLibraryProvider;
if (Editor.isNull(provider)) {
console.log('IAssetLibraryProvider not available');
return;
}
const musicService = provider.musicService;
console.log('MusicListService obtained from provider');
// Build a request with environment settings and a search filter
const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;
const filter = new AssetFilter();
filter.searchText = 'chill';
const request = new AssetListRequest(envSetting, filter);
const response = await musicService.fetchAsync(request);
if (response.ok) {
console.log('Music fetch succeeded');
} else {
console.log('Music fetch failed or cancelled:', response.cancelled);
}
Extends
Methods
fetchAsync()
fetchAsync(
request):Promise<MusicListResponse>
Fetches a list of music assets matching the given request and returns a promise resolving to a MusicListResponse.
Parameters
| Parameter | Type |
|---|---|
request | AssetListRequest |
Returns
Promise<MusicListResponse>
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean