Kaltura listAction也要返回contextData

时间:2018-12-14 13:49:39

标签: javascript node.js kaltura

使用listAction获取所有媒体条目以同时检索这些媒体项目的flavorAssets时是否有办法?目前,我正在做的是先检索所有媒体项目,然后遍历每个媒体项目,然后对每个媒体条目使用getContextData动作来获取flavorAssets,这不是很有效,可能需要很长时间。我的问题是,在这种情况下,是否可以对每个项目返回Kaltura.services.media.listAction(mediaFilter, pager)flavorAssets,而无需对每个项目都执行contextData操作媒体进入?

1 个答案:

答案 0 :(得分:0)

您可以使用响应配置文件在单个请求中返回条目和风味资产。

这是一个原始请求,可以通过添加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=

以更人性化的格式:

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

我不确定JavaScript客户端库是否支持响应配置文件,TypeScript客户端库是否支持它。