-
Notifications
You must be signed in to change notification settings - Fork 0
/
KalturaAssetService.js
206 lines (193 loc) · 7.99 KB
/
KalturaAssetService.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/**
*Class definition for the Kaltura service: asset.
**/
var KalturaAssetService = {
/**
* Add a new asset.
* For metas of type bool-> use kalturaBoolValue, type number-> KalturaDoubleValue, type date -> KalturaLongValue, type string -> KalturaStringValue.
* @param asset KalturaAsset Asset object (optional)
**/
add: function(asset){
var kparams = new Object();
kparams.asset = asset;
return new KalturaRequestBuilder("asset", "add", kparams);
},
/**
* Add new bulk upload batch job Conversion profile id can be specified in the API..
* @param fileData HTMLElement fileData (optional)
* @param bulkUploadJobData KalturaBulkUploadJobData bulkUploadJobData (optional)
* @param bulkUploadAssetData KalturaBulkUploadAssetData bulkUploadAssetData (optional)
**/
addFromBulkUpload: function(fileData, bulkUploadJobData, bulkUploadAssetData){
var kparams = new Object();
var kfiles = new Object();
kfiles.fileData = fileData;
kparams.bulkUploadJobData = bulkUploadJobData;
kparams.bulkUploadAssetData = bulkUploadAssetData;
return new KalturaRequestBuilder("asset", "addFromBulkUpload", kparams, kfiles);
},
/**
* Returns a group-by result for media or EPG according to given filter. Lists values of each field and their respective count..
* @param filter KalturaSearchAssetFilter Filtering the assets request (optional, default: null)
**/
count: function(filter){
if(!filter)
filter = null;
var kparams = new Object();
if (filter != null)
kparams.filter = filter;
return new KalturaRequestBuilder("asset", "count", kparams);
},
/**
* Delete an existing asset.
* @param id int Asset Identifier (optional)
* @param assetReferenceType string Type of asset (optional, enum: KalturaAssetReferenceType)
**/
deleteAction: function(id, assetReferenceType){
var kparams = new Object();
kparams.id = id;
kparams.assetReferenceType = assetReferenceType;
return new KalturaRequestBuilder("asset", "delete", kparams);
},
/**
* Returns media or EPG asset by media / EPG internal or external identifier.
* Note: OPC accounts asset.get for internal identifier doesn't take under consideration personalized aspects neither shop limitations..
* @param id string Asset identifier (optional)
* @param assetReferenceType string Asset type (optional, enum: KalturaAssetReferenceType)
**/
get: function(id, assetReferenceType){
var kparams = new Object();
kparams.id = id;
kparams.assetReferenceType = assetReferenceType;
return new KalturaRequestBuilder("asset", "get", kparams);
},
/**
* Returns the data for ads control.
* @param assetId string Asset identifier (optional)
* @param assetType string Asset type (optional, enum: KalturaAssetType)
* @param contextDataParams KalturaPlaybackContextOptions Parameters for the request (optional)
**/
getAdsContext: function(assetId, assetType, contextDataParams){
var kparams = new Object();
kparams.assetId = assetId;
kparams.assetType = assetType;
kparams.contextDataParams = contextDataParams;
return new KalturaRequestBuilder("asset", "getAdsContext", kparams);
},
/**
* This action delivers all data relevant for player.
* @param assetId string Asset identifier (optional)
* @param assetType string Asset type (optional, enum: KalturaAssetType)
* @param contextDataParams KalturaPlaybackContextOptions Parameters for the request (optional)
* @param sourceType string Filter sources by type (optional, default: null)
**/
getPlaybackContext: function(assetId, assetType, contextDataParams, sourceType){
if(!sourceType)
sourceType = null;
var kparams = new Object();
kparams.assetId = assetId;
kparams.assetType = assetType;
kparams.contextDataParams = contextDataParams;
kparams.sourceType = sourceType;
return new KalturaRequestBuilder("asset", "getPlaybackContext", kparams);
},
/**
* This action delivers all data relevant for player.
* @param assetId string Asset identifier (optional)
* @param assetType string Asset type (optional, enum: KalturaAssetType)
* @param contextDataParams KalturaPlaybackContextOptions Parameters for the request (optional)
* @param sourceType string Filter sources by type (optional, default: null)
**/
getPlaybackManifest: function(assetId, assetType, contextDataParams, sourceType){
if(!sourceType)
sourceType = null;
var kparams = new Object();
kparams.assetId = assetId;
kparams.assetType = assetType;
kparams.contextDataParams = contextDataParams;
kparams.sourceType = sourceType;
return new KalturaRequestBuilder("asset", "getPlaybackManifest", kparams);
},
/**
* Returns assets deduplicated by asset metadata (or supported asset's property)..
* @param groupBy KalturaAssetGroupBy A metadata (or supported asset's property) to group by the assets (optional)
* @param unmatchedItemsPolicy string Defines the policy to handle assets that don't have groupBy property (optional, enum: KalturaUnmatchedItemsPolicy)
* @param orderBy KalturaBaseAssetOrder A metadata or supported asset's property to sort by (optional, default: null)
* @param filter KalturaListGroupsRepresentativesFilter Filtering the assets request (optional, default: null)
* @param selectionPolicy KalturaRepresentativeSelectionPolicy A policy that implements a well defined parametric process to select an asset out of group (optional, default: null)
* @param pager KalturaFilterPager Paging the request (optional, default: null)
**/
groupRepresentativeList: function(groupBy, unmatchedItemsPolicy, orderBy, filter, selectionPolicy, pager){
if(!orderBy)
orderBy = null;
if(!filter)
filter = null;
if(!selectionPolicy)
selectionPolicy = null;
if(!pager)
pager = null;
var kparams = new Object();
kparams.groupBy = groupBy;
kparams.unmatchedItemsPolicy = unmatchedItemsPolicy;
if (orderBy != null)
kparams.orderBy = orderBy;
if (filter != null)
kparams.filter = filter;
if (selectionPolicy != null)
kparams.selectionPolicy = selectionPolicy;
if (pager != null)
kparams.pager = pager;
return new KalturaRequestBuilder("asset", "groupRepresentativeList", kparams);
},
/**
* Returns media or EPG assets. Filters by media identifiers or by EPG internal or external identifier..
* @param filter KalturaAssetFilter Filtering the assets request (optional, default: null)
* @param pager KalturaFilterPager Paging the request (optional, default: null)
**/
listAction: function(filter, pager){
if(!filter)
filter = null;
if(!pager)
pager = null;
var kparams = new Object();
if (filter != null)
kparams.filter = filter;
if (pager != null)
kparams.pager = pager;
return new KalturaRequestBuilder("asset", "list", kparams);
},
/**
* Returns recent selected assets.
* @param filter KalturaPersonalAssetSelectionFilter Filtering the assets request (optional)
**/
listPersonalSelection: function(filter){
var kparams = new Object();
kparams.filter = filter;
return new KalturaRequestBuilder("asset", "listPersonalSelection", kparams);
},
/**
* remove metas and tags from asset.
* @param id int Asset Identifier (optional)
* @param assetReferenceType string Type of asset (optional, enum: KalturaAssetReferenceType)
* @param idIn string comma separated ids of metas and tags (optional)
**/
removeMetasAndTags: function(id, assetReferenceType, idIn){
var kparams = new Object();
kparams.id = id;
kparams.assetReferenceType = assetReferenceType;
kparams.idIn = idIn;
return new KalturaRequestBuilder("asset", "removeMetasAndTags", kparams);
},
/**
* update an existing asset.
* For metas of type bool-> use kalturaBoolValue, type number-> KalturaDoubleValue, type date -> KalturaLongValue, type string -> KalturaStringValue.
* @param id int Asset Identifier (optional)
* @param asset KalturaAsset Asset object (optional)
**/
update: function(id, asset){
var kparams = new Object();
kparams.id = id;
kparams.asset = asset;
return new KalturaRequestBuilder("asset", "update", kparams);
}
}