简体   繁体   中英

Kaltura listAction to return contextData as well

Is there a way when using listAction to get all media entries to also retrieve flavorAssets of those media items? Currently what I am doing is retrieving all media items first, then iterating over each one and using getContextData action on to get flavorAssets for each media entry, which is not very effective and can take a long time. My question is, is there a way to do a Kaltura.services.media.listAction(mediaFilter, pager) while also returning flavorAssets or contextData in this case for each item without the need to call for getContextData action on each media entry?

You can use response profiles to return both the entries and the flavor assets in a single request.

Here's a raw request that will provide you with want you need, just append a KS:

http://www.kaltura.com/api_v3/index.php?service=baseEntry&action=list&filter:objectType=KalturaBaseEntryFilter&filter:orderBy=-createdAt&format=1&responseProfile:objectType=KalturaDetachedResponseProfile&responseProfile:fields=id,name&responseProfile:type=1&responseProfile:relatedProfiles:0:objectType=KalturaDetachedResponseProfileArray&responseProfile:relatedProfiles:0:mappings:0:objectType=ResponseProfileMapping&responseProfile:relatedProfiles:0:mappings:0:parentProperty=id&responseProfile:relatedProfiles:0:mappings:0:filterProperty=entryIdEqual&responseProfile:relatedProfiles:0:name=flavorAsset&&responseProfile:relatedProfiles:0:filter:objectType=KalturaFlavorAssetFilter&ks=

In a more human friendly format:

service=baseEntry
action=list
format=1
filter:objectType=KalturaBaseEntryFilter
filter:orderBy=-createdAt
responseProfile:objectType=KalturaDetachedResponseProfile
responseProfile:fields=id,name
responseProfile:type=1
responseProfile:relatedProfiles:0:objectType=KalturaDetachedResponseProfileArray
responseProfile:relatedProfiles:0:name=flavorAsset
responseProfile:relatedProfiles:0:mappings:0:objectType=ResponseProfileMapping
responseProfile:relatedProfiles:0:mappings:0:parentProperty=id
responseProfile:relatedProfiles:0:mappings:0:filterProperty=entryIdEqual
responseProfile:relatedProfiles:0:filter:objectType=KalturaFlavorAssetFilter

I'm not sure if the JavaScript client library support response profiles, the TypeScript client library does support it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM