kaltura_api 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +40 -0
- data/Rakefile +19 -0
- data/kaltura_api.yml +7 -0
- data/lib/kaltura_api.rb +31 -0
- data/lib/kaltura_client.rb +14450 -0
- data/lib/kaltura_client_base.rb +432 -0
- data/lib/kaltura_plugins/kaltura_abc_screeners_watermark_access_control_client_plugin.rb +37 -0
- data/lib/kaltura_plugins/kaltura_ad_cue_point_client_plugin.rb +108 -0
- data/lib/kaltura_plugins/kaltura_annotation_client_plugin.rb +237 -0
- data/lib/kaltura_plugins/kaltura_aspera_client_plugin.rb +61 -0
- data/lib/kaltura_plugins/kaltura_attachment_client_plugin.rb +227 -0
- data/lib/kaltura_plugins/kaltura_audit_client_plugin.rb +349 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_client_plugin.rb +109 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_csv_client_plugin.rb +55 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_filter_client_plugin.rb +46 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_xml_client_plugin.rb +40 -0
- data/lib/kaltura_plugins/kaltura_caption_client_plugin.rb +406 -0
- data/lib/kaltura_plugins/kaltura_caption_search_client_plugin.rb +138 -0
- data/lib/kaltura_plugins/kaltura_code_cue_point_client_plugin.rb +97 -0
- data/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1717 -0
- data/lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb +290 -0
- data/lib/kaltura_plugins/kaltura_document_client_plugin.rb +522 -0
- data/lib/kaltura_plugins/kaltura_drm_client_plugin.rb +204 -0
- data/lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb +810 -0
- data/lib/kaltura_plugins/kaltura_drop_folder_xml_bulk_upload_client_plugin.rb +39 -0
- data/lib/kaltura_plugins/kaltura_email_notification_client_plugin.rb +276 -0
- data/lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb +405 -0
- data/lib/kaltura_plugins/kaltura_external_media_client_plugin.rb +203 -0
- data/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +151 -0
- data/lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb +309 -0
- data/lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb +72 -0
- data/lib/kaltura_plugins/kaltura_like_client_plugin.rb +82 -0
- data/lib/kaltura_plugins/kaltura_metadata_client_plugin.rb +788 -0
- data/lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb +45 -0
- data/lib/kaltura_plugins/kaltura_short_link_client_plugin.rb +231 -0
- data/lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb +145 -0
- data/lib/kaltura_plugins/kaltura_var_console_client_plugin.rb +238 -0
- data/lib/kaltura_plugins/kaltura_velocix_client_plugin.rb +40 -0
- data/lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb +263 -0
- data/lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb +121 -0
- data/lib/kaltura_plugins/kaltura_widevine_client_plugin.rb +195 -0
- data/test/access_control_service_test.rb +75 -0
- data/test/base_entry_service_test.rb +267 -0
- data/test/configuration_test.rb +178 -0
- data/test/cue_point_service_test.rb +67 -0
- data/test/data_service_test.rb +76 -0
- data/test/document_service_test.rb +41 -0
- data/test/media/test.mov +0 -0
- data/test/media/test.pdf +0 -0
- data/test/media/test.png +0 -0
- data/test/media/test.swf +0 -0
- data/test/media/test.wmv +0 -0
- data/test/media_service_test.rb +294 -0
- data/test/metadata_profile_service_test.rb +63 -0
- data/test/test_helper.rb +59 -0
- metadata +126 -0
@@ -0,0 +1,294 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# ===================================================================================================
|
4
|
+
# _ __ _ _
|
5
|
+
# | |/ /__ _| | |_ _ _ _ _ __ _
|
6
|
+
# | ' </ _` | | _| || | '_/ _` |
|
7
|
+
# |_|\_\__,_|_|\__|\_,_|_| \__,_|
|
8
|
+
#
|
9
|
+
# This file is part of the Kaltura Collaborative Media Suite which allows users
|
10
|
+
# to do with audio, video, and animation what Wiki platfroms allow them to do with
|
11
|
+
# text.
|
12
|
+
#
|
13
|
+
# Copyright (C) 2006-2011 Kaltura Inc.
|
14
|
+
#
|
15
|
+
# This program is free software: you can redistribute it and/or modify
|
16
|
+
# it under the terms of the GNU Affero General Public License as
|
17
|
+
# published by the Free Software Foundation, either version 3 of the
|
18
|
+
# License, or (at your option) any later version.
|
19
|
+
#
|
20
|
+
# This program is distributed in the hope that it will be useful,
|
21
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23
|
+
# GNU Affero General Public License for more details.
|
24
|
+
#
|
25
|
+
# You should have received a copy of the GNU Affero General Public License
|
26
|
+
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
27
|
+
#
|
28
|
+
# @ignore
|
29
|
+
# ===================================================================================================
|
30
|
+
require 'test_helper'
|
31
|
+
require 'uri'
|
32
|
+
|
33
|
+
class MediaServiceTest < Test::Unit::TestCase
|
34
|
+
|
35
|
+
# this test uploads a video file to kaltura and creates a media entry using the uploaded file.
|
36
|
+
should "upload a video file and create a kaltura entry" do
|
37
|
+
|
38
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
39
|
+
media_entry.name = "kaltura_test1"
|
40
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
41
|
+
video_file = File.open("test/media/test.wmv")
|
42
|
+
|
43
|
+
video_token = @client.media_service.upload(video_file)
|
44
|
+
created_entry1 = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
45
|
+
|
46
|
+
assert_not_nil created_entry1.id
|
47
|
+
assert_nil @client.media_service.delete(created_entry1.id)
|
48
|
+
end
|
49
|
+
|
50
|
+
# this test uploads a image file to kaltura and creates a media entry using the uploaded file.
|
51
|
+
should "upload a image file and create a kaltura entry" do
|
52
|
+
|
53
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
54
|
+
media_entry.name = "kaltura_test2"
|
55
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::IMAGE
|
56
|
+
video_file = File.open("test/media/test.png")
|
57
|
+
|
58
|
+
video_token = @client.media_service.upload(video_file)
|
59
|
+
created_entry2 = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
60
|
+
|
61
|
+
assert_not_nil created_entry2.id
|
62
|
+
assert_nil @client.media_service.delete(created_entry2.id)
|
63
|
+
end
|
64
|
+
|
65
|
+
# this test uploads a video file to kaltura reading from a url and creates a media entry using the uploaded file.
|
66
|
+
should "upload a flv file from url and create a kaltura entry" do
|
67
|
+
|
68
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
69
|
+
media_entry.name = "kaltura_test3"
|
70
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
71
|
+
|
72
|
+
created_entry3 = @client.media_service.add_from_url(media_entry, URI.escape("http://www.kaltura.org/kalorg/kaltura-api-clients-generators/trunk/sources/csharp/KalturaClientTester/DemoVideo.flv", Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")))
|
73
|
+
|
74
|
+
assert_not_nil created_entry3.id
|
75
|
+
assert_equal created_entry3.status, KalturaApi::KalturaEntryStatus::IMPORT
|
76
|
+
assert_nil @client.media_service.delete(created_entry3.id)
|
77
|
+
end
|
78
|
+
|
79
|
+
# this test creates an entry and ranks it
|
80
|
+
should "set the rank attributes" do
|
81
|
+
|
82
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
83
|
+
media_entry.name = "kaltura_test"
|
84
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
85
|
+
video_file = File.open("test/media/test.wmv")
|
86
|
+
|
87
|
+
video_token = @client.media_service.upload(video_file)
|
88
|
+
created_entry = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
89
|
+
|
90
|
+
assert_not_nil created_entry.id
|
91
|
+
assert_equal created_entry.rank, 0
|
92
|
+
assert_equal created_entry.total_rank, 0
|
93
|
+
assert_equal created_entry.votes, 0
|
94
|
+
|
95
|
+
@client.media_service.anonymous_rank(created_entry.id, 5)
|
96
|
+
created_entry = @client.media_service.get(created_entry.id)
|
97
|
+
|
98
|
+
assert_equal created_entry.rank, 5
|
99
|
+
assert_equal created_entry.total_rank, 5
|
100
|
+
assert_equal created_entry.votes, 1
|
101
|
+
|
102
|
+
@client.media_service.anonymous_rank(created_entry.id, 2)
|
103
|
+
created_entry = @client.media_service.get(created_entry.id)
|
104
|
+
|
105
|
+
assert_equal created_entry.rank, 3.5
|
106
|
+
assert_equal created_entry.total_rank, 7
|
107
|
+
assert_equal created_entry.votes, 2
|
108
|
+
|
109
|
+
assert_nil @client.media_service.delete(created_entry.id)
|
110
|
+
end
|
111
|
+
|
112
|
+
# this test creates an entry and updates the thumbnail of it using a image url
|
113
|
+
should "update the thumbnail from url" do
|
114
|
+
|
115
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
116
|
+
media_entry.name = "kaltura_test"
|
117
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
118
|
+
video_file = File.open("test/media/test.wmv")
|
119
|
+
|
120
|
+
video_token = @client.media_service.upload(video_file)
|
121
|
+
created_entry = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
122
|
+
|
123
|
+
assert_not_nil created_entry.id
|
124
|
+
|
125
|
+
updated_entry = @client.media_service.update_thumbnail_from_url(created_entry.id, "http://corp.kaltura.com/sites/kaltura-website/files/logo_0.png")
|
126
|
+
|
127
|
+
assert_not_nil updated_entry
|
128
|
+
assert_not_nil updated_entry.thumbnail_url
|
129
|
+
assert_not_equal created_entry.thumbnail_url, updated_entry.thumbnail_url
|
130
|
+
|
131
|
+
assert_nil @client.media_service.delete(created_entry.id)
|
132
|
+
end
|
133
|
+
|
134
|
+
# this test tries to create a media entry with invalid token.
|
135
|
+
should "not create a media entry for a invalid token" do
|
136
|
+
|
137
|
+
assert_raise KalturaApi::KalturaAPIError do
|
138
|
+
@created_entry = @client.media_service.get("invalid entry id")
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# this test validates the response of a multi request when thre are no requests in the queue
|
143
|
+
should "get empty array for multi request when there are no requests in the queue" do
|
144
|
+
|
145
|
+
@client.start_multirequest
|
146
|
+
|
147
|
+
retVal = @client.do_multirequest
|
148
|
+
|
149
|
+
assert_equal retVal, []
|
150
|
+
end
|
151
|
+
|
152
|
+
# this test starts multirequest couple of times
|
153
|
+
should "not raise any errors for double start multi request" do
|
154
|
+
|
155
|
+
assert_nothing_raised KalturaApi::KalturaAPIError do
|
156
|
+
@client.start_multirequest
|
157
|
+
@client.start_multirequest
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# this test calls do_multirequest without stating it.
|
162
|
+
should "get an empty array for the multirequest when it calls without starting it" do
|
163
|
+
|
164
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
165
|
+
media_entry.name = "kaltura_test3"
|
166
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
167
|
+
video_file = File.open("test/media/test.wmv")
|
168
|
+
|
169
|
+
video_token = @client.media_service.upload(video_file)
|
170
|
+
|
171
|
+
ceated_media_entry = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
172
|
+
|
173
|
+
media_entry_filter = KalturaApi::KalturaMediaEntryFilter.new
|
174
|
+
media_entry_filter.name_multi_like_or = "kaltura_test3"
|
175
|
+
filter_pager = KalturaApi::KalturaFilterPager.new
|
176
|
+
@client.media_service.list(media_entry_filter, filter_pager)
|
177
|
+
|
178
|
+
retVal = @client.do_multirequest
|
179
|
+
|
180
|
+
assert_equal retVal, []
|
181
|
+
|
182
|
+
assert_nil @client.media_service.delete(ceated_media_entry.id)
|
183
|
+
end
|
184
|
+
|
185
|
+
# this test uses multi request to retrieve the media entry list and create a new entry.
|
186
|
+
should "get the media list and create a media entry" do
|
187
|
+
|
188
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
189
|
+
media_entry.name = "kaltura_test3"
|
190
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
191
|
+
video_file = File.open("test/media/test.wmv")
|
192
|
+
|
193
|
+
video_token = @client.media_service.upload(video_file)
|
194
|
+
|
195
|
+
@client.start_multirequest
|
196
|
+
|
197
|
+
@client.media_service.add_from_uploaded_file(media_entry, video_token)
|
198
|
+
|
199
|
+
media_entry_filter = KalturaApi::KalturaMediaEntryFilter.new
|
200
|
+
media_entry_filter.name_multi_like_or = "kaltura_test3"
|
201
|
+
filter_pager = KalturaApi::KalturaFilterPager.new
|
202
|
+
@client.media_service.list(media_entry_filter, filter_pager)
|
203
|
+
|
204
|
+
retVal = @client.do_multirequest
|
205
|
+
|
206
|
+
assert_instance_of KalturaApi::KalturaMediaEntry, retVal[0]
|
207
|
+
assert_instance_of KalturaApi::KalturaMediaListResponse, retVal[1]
|
208
|
+
assert_not_nil retVal[0].id
|
209
|
+
assert_not_nil retVal[1].total_count
|
210
|
+
assert_nil @client.media_service.delete(retVal[0].id)
|
211
|
+
end
|
212
|
+
|
213
|
+
# this test retrieves error objects when a action in a multi request fails.
|
214
|
+
should "return error objects for failed actions" do
|
215
|
+
|
216
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
217
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
218
|
+
|
219
|
+
@client.start_multirequest
|
220
|
+
|
221
|
+
@client.media_service.get("invalid entry id")
|
222
|
+
|
223
|
+
media_entry_filter = KalturaApi::KalturaMediaEntryFilter.new
|
224
|
+
filter_pager = KalturaApi::KalturaFilterPager.new
|
225
|
+
@client.media_service.list(media_entry_filter, filter_pager)
|
226
|
+
|
227
|
+
retVal = @client.do_multirequest
|
228
|
+
|
229
|
+
assert_instance_of KalturaApi::KalturaAPIError, retVal[0]
|
230
|
+
assert_instance_of KalturaApi::KalturaMediaListResponse, retVal[1]
|
231
|
+
assert_not_nil retVal[1].total_count
|
232
|
+
end
|
233
|
+
|
234
|
+
# this test uses utf8 content in the media entry meta data.
|
235
|
+
should "support UTF content in entry metadata" do
|
236
|
+
|
237
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
238
|
+
media_entry.name = "שלום"
|
239
|
+
media_entry.description = @description
|
240
|
+
|
241
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
242
|
+
video_file = File.open("test/media/test.wmv")
|
243
|
+
|
244
|
+
video_token = @client.media_service.upload(video_file)
|
245
|
+
created_entry = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
246
|
+
|
247
|
+
assert_not_nil created_entry.id
|
248
|
+
|
249
|
+
media_entry = @client.base_entry_service.get(created_entry.id)
|
250
|
+
|
251
|
+
assert_equal media_entry.name, "שלום"
|
252
|
+
assert_equal media_entry.description, @description
|
253
|
+
assert_nil @client.media_service.delete(media_entry.id)
|
254
|
+
end
|
255
|
+
|
256
|
+
# this test resets content in the media entry meta data.
|
257
|
+
should "support setting nil for content in entry metadata" do
|
258
|
+
|
259
|
+
media_entry = KalturaApi::KalturaMediaEntry.new
|
260
|
+
media_entry.name = "kaltura_test1"
|
261
|
+
media_entry.description = "kaltura_test1 description"
|
262
|
+
media_entry.media_type = KalturaApi::KalturaMediaType::VIDEO
|
263
|
+
video_file = File.open("test/media/test.wmv")
|
264
|
+
|
265
|
+
video_token = @client.media_service.upload(video_file)
|
266
|
+
created_entry = @client.media_service.add_from_uploaded_file(media_entry, video_token)
|
267
|
+
|
268
|
+
assert_not_nil created_entry.id
|
269
|
+
|
270
|
+
media_entry = @client.base_entry_service.get(created_entry.id)
|
271
|
+
|
272
|
+
assert_equal media_entry.name, "kaltura_test1"
|
273
|
+
assert_equal media_entry.description, "kaltura_test1 description"
|
274
|
+
|
275
|
+
# update the desc with value
|
276
|
+
media_entry = KalturaApi::KalturaBaseEntry.new
|
277
|
+
media_entry.name = "kaltura_test1 updated"
|
278
|
+
media_entry.description = nil
|
279
|
+
media_entry_updated = @client.base_entry_service.update(created_entry.id, media_entry)
|
280
|
+
|
281
|
+
assert_equal media_entry_updated.description, nil
|
282
|
+
|
283
|
+
assert_nil @client.media_service.delete(media_entry_updated.id)
|
284
|
+
end
|
285
|
+
|
286
|
+
def setup
|
287
|
+
super
|
288
|
+
@description=
|
289
|
+
<<-DESC
|
290
|
+
שלום עולם
|
291
|
+
DESC
|
292
|
+
end
|
293
|
+
|
294
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# ===================================================================================================
|
2
|
+
# _ __ _ _
|
3
|
+
# | |/ /__ _| | |_ _ _ _ _ __ _
|
4
|
+
# | ' </ _` | | _| || | '_/ _` |
|
5
|
+
# |_|\_\__,_|_|\__|\_,_|_| \__,_|
|
6
|
+
#
|
7
|
+
# This file is part of the Kaltura Collaborative Media Suite which allows users
|
8
|
+
# to do with audio, video, and animation what Wiki platfroms allow them to do with
|
9
|
+
# text.
|
10
|
+
#
|
11
|
+
# Copyright (C) 2006-2011 Kaltura Inc.
|
12
|
+
#
|
13
|
+
# This program is free software: you can redistribute it and/or modify
|
14
|
+
# it under the terms of the GNU Affero General Public License as
|
15
|
+
# published by the Free Software Foundation, either version 3 of the
|
16
|
+
# License, or (at your option) any later version.
|
17
|
+
#
|
18
|
+
# This program is distributed in the hope that it will be useful,
|
19
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21
|
+
# GNU Affero General Public License for more details.
|
22
|
+
#
|
23
|
+
# You should have received a copy of the GNU Affero General Public License
|
24
|
+
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
25
|
+
#
|
26
|
+
# @ignore
|
27
|
+
# ===================================================================================================
|
28
|
+
require 'test_helper'
|
29
|
+
|
30
|
+
class MetadataProfileServiceTest < Test::Unit::TestCase
|
31
|
+
|
32
|
+
# this test adds a metadata_profile and retrieves the list of metadata_profiles to demonstrate the use of kaltura plugins.
|
33
|
+
should "creates a metadata_profile and get the metadata_profile list" do
|
34
|
+
|
35
|
+
# cleaning up the list
|
36
|
+
metadata_profile_filter = KalturaApi::KalturaMetadataProfileFilter.new
|
37
|
+
filter_pager = KalturaApi::KalturaFilterPager.new
|
38
|
+
metadata_profile_list = @client.metadata_profile_service.list(metadata_profile_filter, filter_pager)
|
39
|
+
metadata_profile_list.objects.each do |obj|
|
40
|
+
@client.metadata_profile_service.delete(obj.id) rescue nil
|
41
|
+
end if metadata_profile_list.objects
|
42
|
+
|
43
|
+
# creates a metadata_profile
|
44
|
+
metadata_profile = KalturaApi::KalturaMetadataProfile.new
|
45
|
+
metadata_profile.name = "test profile"
|
46
|
+
metadata_profile.metadata_object_type = KalturaApi::KalturaMetadataObjectType::ENTRY
|
47
|
+
metadata_profile.create_mode = KalturaApi::KalturaMetadataProfileCreateMode::API
|
48
|
+
|
49
|
+
created_metadata_profile = @client.metadata_profile_service.add(metadata_profile, "<xsd:schema></xsd:schema>", "viewsData")
|
50
|
+
|
51
|
+
assert_not_nil created_metadata_profile.id
|
52
|
+
|
53
|
+
# list the metadata_profiles
|
54
|
+
metadata_profile_filter = KalturaApi::KalturaMetadataProfileFilter.new
|
55
|
+
filter_pager = KalturaApi::KalturaFilterPager.new
|
56
|
+
|
57
|
+
metadata_profile_list = @client.metadata_profile_service.list(metadata_profile_filter, filter_pager)
|
58
|
+
|
59
|
+
assert_equal metadata_profile_list.total_count, 1
|
60
|
+
|
61
|
+
assert_nil @client.metadata_profile_service.delete(created_metadata_profile.id)
|
62
|
+
end
|
63
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# ===================================================================================================
|
2
|
+
# _ __ _ _
|
3
|
+
# | |/ /__ _| | |_ _ _ _ _ __ _
|
4
|
+
# | ' </ _` | | _| || | '_/ _` |
|
5
|
+
# |_|\_\__,_|_|\__|\_,_|_| \__,_|
|
6
|
+
#
|
7
|
+
# This file is part of the Kaltura Collaborative Media Suite which allows users
|
8
|
+
# to do with audio, video, and animation what Wiki platfroms allow them to do with
|
9
|
+
# text.
|
10
|
+
#
|
11
|
+
# Copyright (C) 2006-2011 Kaltura Inc.
|
12
|
+
#
|
13
|
+
# This program is free software: you can redistribute it and/or modify
|
14
|
+
# it under the terms of the GNU Affero General Public License as
|
15
|
+
# published by the Free Software Foundation, either version 3 of the
|
16
|
+
# License, or (at your option) any later version.
|
17
|
+
#
|
18
|
+
# This program is distributed in the hope that it will be useful,
|
19
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21
|
+
# GNU Affero General Public License for more details.
|
22
|
+
#
|
23
|
+
# You should have received a copy of the GNU Affero General Public License
|
24
|
+
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
25
|
+
#
|
26
|
+
# @ignore
|
27
|
+
# ===================================================================================================
|
28
|
+
require 'rubygems'
|
29
|
+
require 'test/unit'
|
30
|
+
require 'shoulda'
|
31
|
+
require 'yaml'
|
32
|
+
require 'logger'
|
33
|
+
|
34
|
+
require 'kaltura'
|
35
|
+
|
36
|
+
class Test::Unit::TestCase
|
37
|
+
|
38
|
+
# read the kaltura config file
|
39
|
+
# initiate a kaltura configuration object
|
40
|
+
# initiate kaltura client object
|
41
|
+
# get the sesion object and assigns it to the client
|
42
|
+
def setup
|
43
|
+
config_file = YAML.load_file("kaltura.yml")
|
44
|
+
|
45
|
+
partner_id = config_file["test"]["partner_id"]
|
46
|
+
service_url = config_file["test"]["service_url"]
|
47
|
+
administrator_secret = config_file["test"]["administrator_secret"]
|
48
|
+
timeout = config_file["test"]["timeout"]
|
49
|
+
|
50
|
+
config = KalturaApi::KalturaConfiguration.new(partner_id, service_url)
|
51
|
+
config.logger = Logger.new(STDOUT)
|
52
|
+
config.timeout = timeout
|
53
|
+
|
54
|
+
@client = KalturaApi::KalturaClient.new( config )
|
55
|
+
session = @client.session_service.start( administrator_secret, '', KalturaApi::KalturaSessionType::ADMIN )
|
56
|
+
@client.ks = session
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kaltura_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- rojace shrestha
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: A gem implementation of Kaltura's Ruby Client.
|
28
|
+
email: rojace2011@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- README
|
34
|
+
- Rakefile
|
35
|
+
- kaltura_api.yml
|
36
|
+
- lib/kaltura_api.rb
|
37
|
+
- lib/kaltura_client.rb
|
38
|
+
- lib/kaltura_client_base.rb
|
39
|
+
- lib/kaltura_plugins/kaltura_abc_screeners_watermark_access_control_client_plugin.rb
|
40
|
+
- lib/kaltura_plugins/kaltura_ad_cue_point_client_plugin.rb
|
41
|
+
- lib/kaltura_plugins/kaltura_annotation_client_plugin.rb
|
42
|
+
- lib/kaltura_plugins/kaltura_aspera_client_plugin.rb
|
43
|
+
- lib/kaltura_plugins/kaltura_attachment_client_plugin.rb
|
44
|
+
- lib/kaltura_plugins/kaltura_audit_client_plugin.rb
|
45
|
+
- lib/kaltura_plugins/kaltura_bulk_upload_client_plugin.rb
|
46
|
+
- lib/kaltura_plugins/kaltura_bulk_upload_csv_client_plugin.rb
|
47
|
+
- lib/kaltura_plugins/kaltura_bulk_upload_filter_client_plugin.rb
|
48
|
+
- lib/kaltura_plugins/kaltura_bulk_upload_xml_client_plugin.rb
|
49
|
+
- lib/kaltura_plugins/kaltura_caption_client_plugin.rb
|
50
|
+
- lib/kaltura_plugins/kaltura_caption_search_client_plugin.rb
|
51
|
+
- lib/kaltura_plugins/kaltura_code_cue_point_client_plugin.rb
|
52
|
+
- lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb
|
53
|
+
- lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb
|
54
|
+
- lib/kaltura_plugins/kaltura_document_client_plugin.rb
|
55
|
+
- lib/kaltura_plugins/kaltura_drm_client_plugin.rb
|
56
|
+
- lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb
|
57
|
+
- lib/kaltura_plugins/kaltura_drop_folder_xml_bulk_upload_client_plugin.rb
|
58
|
+
- lib/kaltura_plugins/kaltura_email_notification_client_plugin.rb
|
59
|
+
- lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb
|
60
|
+
- lib/kaltura_plugins/kaltura_external_media_client_plugin.rb
|
61
|
+
- lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb
|
62
|
+
- lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb
|
63
|
+
- lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb
|
64
|
+
- lib/kaltura_plugins/kaltura_like_client_plugin.rb
|
65
|
+
- lib/kaltura_plugins/kaltura_metadata_client_plugin.rb
|
66
|
+
- lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb
|
67
|
+
- lib/kaltura_plugins/kaltura_short_link_client_plugin.rb
|
68
|
+
- lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb
|
69
|
+
- lib/kaltura_plugins/kaltura_var_console_client_plugin.rb
|
70
|
+
- lib/kaltura_plugins/kaltura_velocix_client_plugin.rb
|
71
|
+
- lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb
|
72
|
+
- lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb
|
73
|
+
- lib/kaltura_plugins/kaltura_widevine_client_plugin.rb
|
74
|
+
- test/access_control_service_test.rb
|
75
|
+
- test/base_entry_service_test.rb
|
76
|
+
- test/configuration_test.rb
|
77
|
+
- test/cue_point_service_test.rb
|
78
|
+
- test/data_service_test.rb
|
79
|
+
- test/document_service_test.rb
|
80
|
+
- test/media/test.mov
|
81
|
+
- test/media/test.pdf
|
82
|
+
- test/media/test.png
|
83
|
+
- test/media/test.swf
|
84
|
+
- test/media/test.wmv
|
85
|
+
- test/media_service_test.rb
|
86
|
+
- test/metadata_profile_service_test.rb
|
87
|
+
- test/test_helper.rb
|
88
|
+
homepage: http://www.kaltura.com/
|
89
|
+
licenses: []
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.4.5
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: A gem implementation of Kaltura's Ruby Client
|
111
|
+
test_files:
|
112
|
+
- test/test_helper.rb
|
113
|
+
- test/access_control_service_test.rb
|
114
|
+
- test/base_entry_service_test.rb
|
115
|
+
- test/configuration_test.rb
|
116
|
+
- test/cue_point_service_test.rb
|
117
|
+
- test/data_service_test.rb
|
118
|
+
- test/document_service_test.rb
|
119
|
+
- test/media_service_test.rb
|
120
|
+
- test/metadata_profile_service_test.rb
|
121
|
+
- test/media/test.mov
|
122
|
+
- test/media/test.pdf
|
123
|
+
- test/media/test.png
|
124
|
+
- test/media/test.swf
|
125
|
+
- test/media/test.wmv
|
126
|
+
has_rdoc:
|