velir_kaltura-ruby 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/kaltura/constants/access_control_order_by.rb +8 -2
  3. data/lib/kaltura/constants/audio_codec.rb +10 -5
  4. data/lib/kaltura/constants/base.rb +47 -20
  5. data/lib/kaltura/constants/batch_job.rb +74 -49
  6. data/lib/kaltura/constants/bit_rate_mode.rb +8 -2
  7. data/lib/kaltura/constants/category_order_by.rb +12 -6
  8. data/lib/kaltura/constants/commercial_use_type.rb +8 -2
  9. data/lib/kaltura/constants/container_format.rb +15 -9
  10. data/lib/kaltura/constants/control_panel_command.rb +19 -4
  11. data/lib/kaltura/constants/conversion_profile_order_by.rb +8 -2
  12. data/lib/kaltura/constants/country_restriction_type.rb +10 -2
  13. data/lib/kaltura/constants/data_entry_order_by.rb +14 -8
  14. data/lib/kaltura/constants/directory_restriction_type.rb +8 -2
  15. data/lib/kaltura/constants/document.rb +29 -11
  16. data/lib/kaltura/constants/duration_type.rb +10 -4
  17. data/lib/kaltura/constants/editor_type.rb +8 -2
  18. data/lib/kaltura/constants/email_ingestion_profile_status.rb +8 -2
  19. data/lib/kaltura/constants/entry.rb +45 -21
  20. data/lib/kaltura/constants/file_sync.rb +53 -25
  21. data/lib/kaltura/constants/flavor_asset_status.rb +12 -6
  22. data/lib/kaltura/constants/gender.rb +9 -3
  23. data/lib/kaltura/constants/google_syndication_feed.rb +29 -11
  24. data/lib/kaltura/constants/i_tunes_syndication_feed/categories.rb +74 -67
  25. data/lib/kaltura/constants/i_tunes_syndication_feed.rb +30 -12
  26. data/lib/kaltura/constants/license_type.rb +23 -17
  27. data/lib/kaltura/constants/live_stream_admin_entry_order_by.rb +25 -18
  28. data/lib/kaltura/constants/mail_job_order_by.rb +10 -4
  29. data/lib/kaltura/constants/media.rb +44 -25
  30. data/lib/kaltura/constants/mix_entry_order_by.rb +22 -16
  31. data/lib/kaltura/constants/moderation.rb +20 -8
  32. data/lib/kaltura/constants/notification.rb +32 -13
  33. data/lib/kaltura/constants/nullable_boolean.rb +8 -3
  34. data/lib/kaltura/constants/partner.rb +51 -26
  35. data/lib/kaltura/constants/playable_entry_order_by.rb +22 -16
  36. data/lib/kaltura/constants/playlist.rb +24 -11
  37. data/lib/kaltura/constants/report_type.rb +18 -8
  38. data/lib/kaltura/constants/search_provider_type.rb +23 -16
  39. data/lib/kaltura/constants/session_type.rb +8 -2
  40. data/lib/kaltura/constants/site_restriction_type.rb +8 -2
  41. data/lib/kaltura/constants/source_type.rb +11 -5
  42. data/lib/kaltura/constants/stats/kmc_event_type.rb +69 -63
  43. data/lib/kaltura/constants/stats.rb +39 -26
  44. data/lib/kaltura/constants/syndication_feed.rb +26 -6
  45. data/lib/kaltura/constants.rb +15 -2
  46. data/lib/kaltura/kaltura_client_base.rb +3 -1
  47. data/lib/kaltura/service/base_entry_service.rb +1 -1
  48. data/lib/kaltura/service/live_stream_service.rb +49 -3
  49. data/lib/kaltura/service/media_service.rb +401 -4
  50. data/velir_kaltura-ruby.gemspec +2 -2
  51. metadata +4 -4
@@ -1,7 +1,65 @@
1
1
  module Kaltura
2
2
  module Service
3
+ ##
4
+ # The media service allows you to interact with video, image and audio files on the Kaltura system.
5
+ # This is the service you'll be performing the bulk of your actions on and becoming familiar with
6
+ # it would be beneficial for any application development you perform. The KMC and the two upload
7
+ # widgets (KCW and KSU) both use this API to upload content to the Kaltura database as well.
8
+ #
9
+ # @example Retrieve a media entry:
10
+ # client.media_service.get('1_qua324a')
11
+ #
12
+ # @example Upload a new entry:
13
+ # media_entry = Kaltura::MediaEntry.new
14
+ # media_entry.media_type = Kaltura::Constants::Media::Type::VIDEO
15
+ # video_file = File.open "/home/prob/video.mp4"
16
+ # begin
17
+ # video_token = client.media_service.upload(video_file)
18
+ # created_entry = client.media_service.add_from_uploaded_file(media_entry,video_token)
19
+ # rescue Kaltura::APIError => e
20
+ # end
21
+ #
22
+ # @example Update an existing entry:
23
+ # update_entry = Kaltura::MediaEntry.new
24
+ # update_entry.description = "Pancakes are lame yo."
25
+ # client.media_service.update('1_qua324a',update_entry)
26
+ #
27
+ # @example Delete an existing entry:
28
+ # client.media_service.delete('1_qua324a')
29
+ #
30
+ # @example Update an Entry thumbnail via file upload:
31
+ # thumbnail_file = File.open('/path/to/thumbnail_file')
32
+ # client.media_service.update_thumbnail_from_jpeg('1_qua324a',thumbnail_file)
33
+ #
34
+ # @example Update an entry thumbnail from a url:
35
+ # client.media_service.update_thumbnail_from_url('1_qua324a','http://twitter.com/waffles/waffletastic.jpg')
36
+ #
37
+ # @example Update an entry thumbnail from another entry:
38
+ # client.media_service.update_thumbnail_from_source_entry('1_qua324a','0_k24aj1b',5)
39
+ ##
3
40
  class MediaService < BaseService
4
41
 
42
+ ##
43
+ # This method creates a new media entry from either a HTTP or FTP URL given a batch ID.
44
+ # The intention of this action is to import videos in large quantities from another
45
+ # service without overloading either the former service nor Kaltura. This is probably
46
+ # best handled from within the KMC with their batch importing wizard, even though this is
47
+ # exposed to anyone on API wrappers.
48
+ #
49
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
50
+ # filled out that will be later returned with the ID field as stored on the database.
51
+ # @param [String] url A HTTP or FTP URL. I would imagine the FTP cannot be password protected.
52
+ # @param [Integer] bulk_upload_id The ID of the bulk upload job.
53
+ #
54
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
55
+ # out with the additional database fields the Kaltura service set. It would be a good idea
56
+ # to store the ID somewhere.
57
+ #
58
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors plus 'PROPERTY_VALIDATION_MIN_LENGTH'
59
+ # when a specific attribute of the media entry doesn't have a long enough length and
60
+ # 'PROPERTY_VALIDATION_CANNOT_BE_NULL' when a specific attribute is not allowed to be null.
61
+ #
62
+ ##
5
63
  def add_from_bulk(media_entry, url, bulk_upload_id)
6
64
  kparams = {}
7
65
  client.add_param(kparams, 'mediaEntry', media_entry)
@@ -10,6 +68,28 @@ module Kaltura
10
68
  perform_request('media','addFromBulk',kparams,false)
11
69
  end
12
70
 
71
+ ##
72
+ # Adds a new media entry for importing from a HTTP or FTP URL.
73
+ # The entry is first queued for uploading, then once that is complete it is queued for
74
+ # encoding. This gives you a long period between uploading and determining if the media entry
75
+ # is in a valid conversion format. A Kaltura player wil first raise the error 'Media clip not found' and
76
+ # eventually 'Media is currently converting, try again in a few minutes' if you expose the media entry
77
+ # to new users immediately.
78
+ #
79
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
80
+ # filled out that will be later returned with the ID field as stored on the database.
81
+ # @param [String] url A HTTP or FTP URL. I would imagine the FTP cannot be password protected.
82
+ # @param [Integer] bulk_upload_id The ID of the bulk upload job.
83
+ #
84
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
85
+ # out with the additional database fields the Kaltura service set. It would be a good idea
86
+ # to store the ID somewhere.
87
+ #
88
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors plus 'PROPERTY_VALIDATION_MIN_LENGTH'
89
+ # when a specific attribute of the media entry doesn't have a long enough length and
90
+ # 'PROPERTY_VALIDATION_CANNOT_BE_NULL' when a specific attribute is not allowed to be null.
91
+ #
92
+ ##
13
93
  def add_from_url(media_entry, url)
14
94
  kparams = {}
15
95
  client.add_param(kparams, 'mediaEntry', media_entry)
@@ -17,13 +97,62 @@ module Kaltura
17
97
  perform_request('media','addFromUrl',kparams,false)
18
98
  end
19
99
 
100
+ ##
101
+ # Adds a new media entry from the results of a search.
102
+ # This action is used by the KCW on the third tab, finding videos from external sources.
103
+ # I wouldn't typically consider using this method as an external user of the Kaltura API.
104
+ #
105
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
106
+ # filled out that will be later returned with the ID field as stored on the database.
107
+ # @param [Kaltura::SearchResult] search_result A specific Kaltura entry provided from a search provided
108
+ # by Kaltura.
109
+ #
110
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
111
+ # out with the additional database fields the Kaltura service set. It would be a good idea
112
+ # to store the ID somewhere.
113
+ #
114
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors plus 'PROPERTY_VALIDATION_MIN_LENGTH'
115
+ # when a specific attribute of the media entry doesn't have a long enough length and
116
+ # 'PROPERTY_VALIDATION_CANNOT_BE_NULL' when a specific attribute is not allowed to be null.
117
+ #
118
+ ##
20
119
  def add_from_search_result(media_entry=nil, search_result=nil)
21
120
  kparams = {}
22
121
  client.add_param(kparams, 'mediaEntry', media_entry)
23
122
  client.add_param(kparams, 'searchResult', search_result)
24
123
  perform_request('media','addFromSearchResult',kparams,false)
25
124
  end
26
-
125
+
126
+ ##
127
+ # Adds a new media entry given a valid upload token.
128
+ # This method is the second step of the uploading process if you wish to upload local content
129
+ # into Kaltura. This skips the importing queue step, allowing you to have a better idea as to when
130
+ # you can expose the media entry to the end-user.
131
+ #
132
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
133
+ # filled out that will be later returned with the ID field as stored on the database.
134
+ # @param [String] upload_token_id An upload token returned from Kaltura::Service::MediaService#upload
135
+ #
136
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
137
+ # out with the additional database fields the Kaltura service set. It would be a good idea
138
+ # to store the ID somewhere.
139
+ #
140
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors plus 'PROPERTY_VALIDATION_MIN_LENGTH'
141
+ # when a specific attribute of the media entry doesn't have a long enough length and
142
+ # 'PROPERTY_VALIDATION_CANNOT_BE_NULL' when a specific attribute is not allowed to be null.
143
+ # Also raises 'UPLOADED_FILE_NOT_FOUND_BY_TOKEN' if the upload_token_id is invalid.
144
+ #
145
+ # @example This is how a full upload process looks like:
146
+ # media_entry = Kaltura::MediaEntry.new
147
+ # media_entry.media_type = Kaltura::Constants::Media::Type::VIDEO
148
+ # video_file = File.open "/home/prob/video.mp4"
149
+ # begin
150
+ # video_token = client.media_service.upload(video_file)
151
+ # created_entry = client.media_service.add_from_uploaded_file(media_entry,video_token)
152
+ # rescue Kaltura::APIError => e
153
+ # end
154
+ #
155
+ ##
27
156
  def add_from_uploaded_file(media_entry, upload_token_id)
28
157
  kparams = {}
29
158
  client.add_param(kparams, 'mediaEntry', media_entry)
@@ -31,13 +160,123 @@ module Kaltura
31
160
  perform_request('media','addFromUploadedFile',kparams,false)
32
161
  end
33
162
 
163
+ ##
164
+ # Adds a new media entry after the file was recorded on the server and the token ID exists.
165
+ # This is a method that the KCW uses to add recorded webcam files into the database. You can
166
+ # mimic this by using the exact same steps as Kaltura::Service::MediaService#add_from_uploaded_file
167
+ # but you then really wouldn't need to use this action at all.
168
+ #
169
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
170
+ # filled out that will be later returned with the ID field as stored on the database.
171
+ # @param [String] webcam_token_id An upload token returned from somewhere not documented by Kaltura.
172
+ #
173
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
174
+ # out with the additional database fields the Kaltura service set. It would be a good idea
175
+ # to store the ID somewhere.
176
+ #
177
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors plus 'PROPERTY_VALIDATION_MIN_LENGTH'
178
+ # when a specific attribute of the media entry doesn't have a long enough length and
179
+ # 'PROPERTY_VALIDATION_CANNOT_BE_NULL' when a specific attribute is not allowed to be null.
180
+ # Also raises 'RECORDED_WEBCAM_FILE_NOT_FOUND_BY_TOKEN' if the upload_token_id is invalid.
181
+ #
182
+ #
183
+ ##
34
184
  def add_from_recorded_webcam(media_entry, webcam_token_id)
35
185
  kparams = {}
36
186
  client.add_param(kparams, 'mediaEntry', media_entry)
37
187
  client.add_param(kparams, 'webcamTokenId', webcam_token_id)
38
188
  perform_request('media','addFromRecordedWebcam',kparams,false)
39
189
  end
40
-
190
+
191
+
192
+ ##
193
+ # Copies one entry into a new entry.
194
+ # If a specific encoding type is not specified for the new entries source, it will
195
+ # default to the old entries original flavor.
196
+ # This method was not in the original kaltura-ruby and was discovered from the
197
+ # API docs.
198
+ #
199
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
200
+ # filled out that will be later returned with the ID field as stored on the database.
201
+ # @param [String] source_entry_id The media entry to copy from.
202
+ # @param [Integer] source_flavor_params_id The encoding type to use as the original flavor for
203
+ # the new entry.
204
+ #
205
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
206
+ # out with the additional database fields the Kaltura service set. It would be a good idea
207
+ # to store the ID somewhere.
208
+ #
209
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
210
+ # @since 0.4.7
211
+ #
212
+ ##
213
+ def add_from_entry(media_entry, source_entry_id,source_flavor_params_id=nil)
214
+ kparams = {}
215
+ client.add_params(kparams,'mediaEntry',media_entry)
216
+ client.add_params(kparams,'sourceEntryId',source_entry_id)
217
+ client.add_params(kparams,'sourceFlavorParamsId',source_flavor_params_id)
218
+ perform_request('media','addFromEntry',kparams,false)
219
+ end
220
+
221
+ ##
222
+ # Copies a specific flavor into a new Media Entry.
223
+ #
224
+ # @param [Kaltura::MediaEntry] media_entry A newly insantiated media entry with metadata
225
+ # filled out that will be later returned with the ID field as stored on the database.
226
+ # @param [String] source_flavor_asset_id A specific flavor to use as the source of the copy.
227
+ #
228
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
229
+ # out with the additional database fields the Kaltura service set. It would be a good idea
230
+ # to store the ID somewhere.
231
+ #
232
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
233
+ # @since 0.4.7
234
+ #
235
+ ##
236
+ def add_from_flavor_asset(media_entry, source_flavor_asset_id)
237
+ kparams = {}
238
+ client.add_params(kparams,'mediaEntry',media_entry)
239
+ client.add_params(kparams,'sourceFlavorAssetId',source_flavor_asset_id)
240
+ perform_request('media','addFromFlavorAsset',kparams,false)
241
+ end
242
+
243
+ ##
244
+ # Converts a media entry.
245
+ # This method was not originallly in kaltura-ruby and was added after peruising the API
246
+ # docs. I wouldn't suggest using this method. Any upload action will already trigger a
247
+ # conversion, so instead use request conversion.
248
+ #
249
+ # @param [String] entry_id The media entry to convert.
250
+ # @param [Integer] conversion_profile_id The conversion profile to convert the entry with.
251
+ # @param [Array] dynamic_conversion_attributes An Array of Kaltura::ConversionAttribute .
252
+ # It would be helpful if that object type existed.
253
+ #
254
+ # @return [Integer] Returns the conversion profile that was converted on the entry_id.
255
+ #
256
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
257
+ # @since 0.4.7
258
+ # @todo Add Kaltura::ConversionAttribute.
259
+ ##
260
+ def convert(entry_id,conversion_profile_id,dynamic_conversion_attributes=nil)
261
+ kparams = {}
262
+ client.add_params(kparams,'entryId',entry_id)
263
+ client.add_params(kparams,'conversionProfileId',conversion_profile_id)
264
+ client.add_params(kparams,'dynamicConversionAttributes',dynamic_conversion_attributes)
265
+ perform_request('media','convert',kparams,false)
266
+ end
267
+
268
+ ##
269
+ # Retrieves a media entry provided an ID. Will also return older versions if you know a specific number.
270
+ #
271
+ # @param [String] entry_id The Kaltura media entries ID.
272
+ # @param [Integer] version An optional version number. Defaults to the most recent version.
273
+ #
274
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
275
+ # out with the additional database fields the Kaltura service set. It would be a good idea
276
+ # to store the ID somewhere.
277
+ #
278
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
279
+ ##
41
280
  def get(entry_id, version=-1)
42
281
  kparams = {}
43
282
  client.add_param(kparams, 'entryId', entry_id)
@@ -45,19 +284,53 @@ module Kaltura
45
284
  perform_request('media','get',kparams,false)
46
285
  end
47
286
 
287
+ ##
288
+ # Updates a specific media entries metadata.
289
+ # Like all other update actions on the Kaltura service, it is best to instantiate a
290
+ # new media entry object and add any fields you wish to change to the new media entry rather
291
+ # than using a Kaltura::Service::MediaService#get call and then updating that specific entry.
292
+ #
293
+ # @param [String] entry_id The media entry to update.
294
+ # @param [Kaltura:MediaEntry] A newly insantiated media entry with the updated metadata fields in place.
295
+ #
296
+ # @return [Kaltura::MediaEntry] Returns a media entry object with the metadata fields filled
297
+ # out with the additional database fields the Kaltura service set. It would be a good idea
298
+ # to store the ID somewhere.
299
+ #
300
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
301
+ ##
48
302
  def update(entry_id, media_entry)
49
303
  kparams = {}
50
304
  client.add_param(kparams, 'entryId', entry_id)
51
305
  client.add_param(kparams, 'mediaEntry', media_entry)
52
306
  perform_request('media','update',kparams,false)
53
307
  end
54
-
308
+
309
+ ##
310
+ # Removes the specific entry from the Kaltura database.
311
+ #
312
+ # @param [String] entry_id The media entry to remove.
313
+ #
314
+ # @return [nil] Returns nothing.
315
+ #
316
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
317
+ ##
55
318
  def delete(entry_id)
56
319
  kparams = {}
57
320
  client.add_param(kparams, 'entryId', entry_id)
58
321
  perform_request('media','delete',kparams,false)
59
322
  end
60
323
 
324
+ ##
325
+ # Lists media entries given a filter and provides paging support for large lists.
326
+ #
327
+ # @param [Kaltura::Filter::MediaEntryFilter] The filter to list media entries by.
328
+ # @param [Kaltura::FilterPager] The default Kaltura pager.
329
+ #
330
+ # @return [Kaltura::Response::MediaListResponse] Returns a wrapper for Kaltura::Response::BaseResponse.
331
+ #
332
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
333
+ ##
61
334
  def list(filter=nil, pager=nil)
62
335
  kparams = {}
63
336
  client.add_param(kparams, 'filter', filter)
@@ -65,18 +338,49 @@ module Kaltura
65
338
  perform_request('media','list',kparams,false)
66
339
  end
67
340
 
341
+ ##
342
+ # Counts the total number of media entries that meet the filter criteria.
343
+ #
344
+ # @param [Kaltura::Filter::MediaEntryFilter] The criteria in which the count will be gathered against.
345
+ #
346
+ # @return [Integer] Returns the total.
347
+ #
348
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
349
+ ##
68
350
  def count(filter=nil)
69
351
  kparams = {}
70
352
  client.add_param(kparams, 'filter', filter)
71
353
  perform_request('media','count',kparams,false)
72
354
  end
73
355
 
356
+ ##
357
+ # Uploads a media file to Kaltura.
358
+ # This is the first step in creating a media entry from a local file.
359
+ #
360
+ # @param [File] file_data The file to upload.
361
+ #
362
+ # @return [String] Returns the upload token ID to be used for entry creation.
363
+ #
364
+ # @raise [Kalutra::APIError] Raises default Kaltura errors.
365
+ #
366
+ # @see Kaltura::Service::MediaService#add_from_uploaded_file
367
+ ##
74
368
  def upload(file_data)
75
369
  kparams = {}
76
370
  client.add_param(kparams, 'fileData', file_data)
77
371
  perform_request('media','upload',kparams,false)
78
372
  end
79
373
 
374
+ ##
375
+ # Updates a specific media entries thumbnail by a specified time offset in seconds.
376
+ #
377
+ # @param [String] entry_id The Kaltura entry ID.
378
+ # @param [Integer] time_offset The offset in seconds to create the thumbnail.
379
+ #
380
+ # @return [Kaltura::MediaEntry] Returns a Kaltura media entry with the updated version.
381
+ #
382
+ # @raise [Kalutra::APIError] Raises default Kaltura errors.
383
+ ##
80
384
  def update_thumbnail(entry_id, time_offset)
81
385
  kparams = {}
82
386
  client.add_param(kparams, 'entryId', entry_id)
@@ -84,6 +388,17 @@ module Kaltura
84
388
  perform_request('media','updateThumbnail',kparams,false)
85
389
  end
86
390
 
391
+ ##
392
+ # Updates a media entries thumbnail from another media entry given a time offset.
393
+ #
394
+ # @param [String] entry_id The entry to be updated.
395
+ # @param [String] source_entry_id The entry to create the thumbnail from.
396
+ # @param [Integer] time_offset The offset in seconds to create the thumbnail.
397
+ #
398
+ # @return [Kaltura::MediaEntry] Returns a kaltura media entry with the updated version.
399
+ #
400
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
401
+ ##
87
402
  def update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset)
88
403
  kparams = {}
89
404
  client.add_param(kparams, 'entryId', entry_id)
@@ -92,6 +407,16 @@ module Kaltura
92
407
  perform_request('media','updateThumbnailFromSourceEntry',kparams,false)
93
408
  end
94
409
 
410
+ ##
411
+ # Updates a media entries thumbnail from a JPEG file.
412
+ #
413
+ # @param [String] entry_id The entry to be updated.
414
+ # @param [File] file_data The JPEG file to use as the new thumbnail.
415
+ #
416
+ # @return [Kaltura::MediaEntry] Returns a kaltura media entry with the updated version.
417
+ #
418
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
419
+ ##
95
420
  def update_thumbnail_jpeg(entry_id, file_data)
96
421
  kparams = {}
97
422
  client.add_param(kparams, 'entryId', entry_id)
@@ -99,13 +424,34 @@ module Kaltura
99
424
  perform_request('media','updateThumbnailJpeg',kparams,false)
100
425
  end
101
426
 
427
+ ##
428
+ # Updates a media entries thumbnail given a URL.
429
+ #
430
+ # @param [String] entry_id The entry to be updated.
431
+ # @param [File] file_data The URL of a JPEG file to use as the new thumbnail.
432
+ #
433
+ # @return [Kaltura::MediaEntry] Returns a kaltura media entry with the updated version.
434
+ #
435
+ # @raise [Kaltura::APIError] Raises the default Kaltura errors.
436
+ ##
102
437
  def update_thumbnail_from_url(entry_id, url)
103
438
  kparams = {}
104
439
  client.add_param(kparams, 'entryId', entry_id)
105
440
  client.add_param(kparams, 'url', url)
106
441
  perform_request('media','updateThumbnailFromUrl',kparams,false)
107
442
  end
108
-
443
+
444
+ ##
445
+ # Requests a new conversion job.
446
+ # Use this over Kaltura::Service::MediaService#convert.
447
+ #
448
+ # @param [String] entry_id The entry to be updated.
449
+ # @param [String] file_format The format to convert to.
450
+ #
451
+ # @return [Integer] The Kalatura::FlavorParams ID converted.
452
+ #
453
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
454
+ ##
109
455
  def request_conversion(entry_id, file_format)
110
456
  kparams = {}
111
457
  client.add_param(kparams, 'entryId', entry_id)
@@ -113,24 +459,63 @@ module Kaltura
113
459
  perform_request('media','requestConversion',kparams,false)
114
460
  end
115
461
 
462
+ ##
463
+ # Flags an inappropriate media entry for moderation.
464
+ #
465
+ # @param [Kaltura::ModerationFlag] moderation_flag The flag to apply.
466
+ #
467
+ # @return [nil] Returns nothing
468
+ #
469
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
470
+ ##
116
471
  def flag(moderation_flag)
117
472
  kparams = {}
118
473
  client.add_param(kparams, 'moderationFlag', moderation_flag)
119
474
  perform_request('media','flag',kparams,false)
120
475
  end
121
476
 
477
+ ##
478
+ # Rejects the media entry and marks all pending flags as moderated.
479
+ # This makes the entry non-playable.
480
+ #
481
+ # @param [String] entry_id The Kaltura media entry to be updated.
482
+ #
483
+ # @return [nil] Returns nothing
484
+ #
485
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
486
+ ##
122
487
  def reject(entry_id)
123
488
  kparams = {}
124
489
  client.add_param(kparams, 'entryId', entry_id)
125
490
  perform_request('media','request',kparams,false)
126
491
  end
127
492
 
493
+ ##
494
+ # Approves the media entry and marks all pending flags as moderated.
495
+ # This makes the entry playable.
496
+ #
497
+ # @param [String] entry_id The Kaltura media entry to be updated.
498
+ #
499
+ # @return [nil] Returns nothing
500
+ #
501
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
502
+ ##
128
503
  def approve(entry_id)
129
504
  kparams = {}
130
505
  client.add_param(kparams, 'entryId', entry_id)
131
506
  perform_request('media','approve',kparams,false)
132
507
  end
133
508
 
509
+ ##
510
+ # Lists all pending moderation flags for the media entry with paging support for numerous flags.
511
+ #
512
+ # @param [String] entry_id The entry to locate moderation flags for.
513
+ # @param [Kaltura::FilterPager] The default Kaltura pager.
514
+ #
515
+ # @return [Kaltura::Response::ModerationFlagListResponse] A wrapper for Kaltura::Response::BaseResponse.
516
+ #
517
+ # @raise [Kaltura::APIError] Raises the defaault Kaltura errors.
518
+ ##
134
519
  def list_flags(entry_id, pager=nil)
135
520
  kparams = {}
136
521
  client.add_param(kparams, 'entryId', entry_id)
@@ -138,6 +523,18 @@ module Kaltura
138
523
  perform_request('media','listFlags',kparams,false)
139
524
  end
140
525
 
526
+ ##
527
+ # Rank a media entry.
528
+ # This does no validation to prevent duplicate rankings. Fairly worthless. It is suggested you
529
+ # maintain rankings on your own application.
530
+ #
531
+ # @param [String] The Kaltura entry to be updated.
532
+ # @param [Integer] The rank to apply.
533
+ #
534
+ # @return [nil] Returns nothing.
535
+ #
536
+ # @raise [Kaltura::APIError] Raises default Kaltura errors.
537
+ ##
141
538
  def anonymous_rank(entry_id, rank)
142
539
  kparams = {}
143
540
  client.add_param(kparams, 'entryId', entry_id)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{velir_kaltura-ruby}
8
- s.version = "0.4.6"
8
+ s.version = "0.4.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Robertson"]
12
- s.date = %q{2010-10-11}
12
+ s.date = %q{2010-10-27}
13
13
  s.email = %q{patrick.robertson@velir.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: velir_kaltura-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 6
10
- version: 0.4.6
9
+ - 7
10
+ version: 0.4.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Robertson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-11 00:00:00 -04:00
18
+ date: 2010-10-27 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency