-
Notifications
You must be signed in to change notification settings - Fork 0
/
KalturaClient.php
15078 lines (14137 loc) · 480 KB
/
KalturaClient.php
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platforms allow them to do with
// text.
//
// Copyright (C) 2006-2023 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
/**
* @package Kaltura
* @subpackage Client
*/
require_once(dirname(__FILE__) . "/KalturaClientBase.php");
require_once(dirname(__FILE__) . "/KalturaEnums.php");
require_once(dirname(__FILE__) . "/KalturaTypes.php");
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAnnouncementService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add a new future scheduled system announcement push notification
*
* @param KalturaAnnouncement $announcement The announcement to be added.
timezone parameter should be taken from the 'name of timezone' from: https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx
Recipients values: All, LoggedIn, Guests
* @return KalturaAnnouncement
*/
function add(KalturaAnnouncement $announcement)
{
$kparams = array();
$this->client->addParam($kparams, "announcement", $announcement->toParams());
$this->client->queueServiceActionCall("announcement", "add", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAnnouncement");
return $resultObject;
}
/**
* Delete an existing announcing. Announcement cannot be delete while being sent.
*
* @param bigint $id Id of the announcement.
* @return bool
*/
function delete($id)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->queueServiceActionCall("announcement", "delete", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* Enable system announcements
*
* @return bool
*/
function enableSystemAnnouncements()
{
$kparams = array();
$this->client->queueServiceActionCall("announcement", "enableSystemAnnouncements", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* Lists all announcements in the system.
*
* @param KalturaAnnouncementFilter $filter Filter object
* @param KalturaFilterPager $pager Paging the request
* @return KalturaAnnouncementListResponse
*/
function listAction(KalturaAnnouncementFilter $filter, KalturaFilterPager $pager = null)
{
$kparams = array();
$this->client->addParam($kparams, "filter", $filter->toParams());
if ($pager !== null)
$this->client->addParam($kparams, "pager", $pager->toParams());
$this->client->queueServiceActionCall("announcement", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAnnouncementListResponse");
return $resultObject;
}
/**
* Update an existing future system announcement push notification. Announcement can only be updated only before sending
*
* @param int $announcementId The announcement identifier
* @param KalturaAnnouncement $announcement The announcement to update.
timezone parameter should be taken from the 'name of timezone' from: https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx
Recipients values: All, LoggedIn, Guests
* @return KalturaAnnouncement
*/
function update($announcementId, KalturaAnnouncement $announcement)
{
$kparams = array();
$this->client->addParam($kparams, "announcementId", $announcementId);
$this->client->addParam($kparams, "announcement", $announcement->toParams());
$this->client->queueServiceActionCall("announcement", "update", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAnnouncement");
return $resultObject;
}
/**
* Update a system announcement status
*
* @param bigint $id Id of the announcement.
* @param bool $status Status to update to.
* @return bool
*/
function updateStatus($id, $status)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "status", $status);
$this->client->queueServiceActionCall("announcement", "updateStatus", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAppTokenService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add new application authentication token
*
* @param KalturaAppToken $appToken Application token
* @return KalturaAppToken
*/
function add(KalturaAppToken $appToken)
{
$kparams = array();
$this->client->addParam($kparams, "appToken", $appToken->toParams());
$this->client->queueServiceActionCall("apptoken", "add", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAppToken");
return $resultObject;
}
/**
* Delete application authentication token by id
*
* @param string $id Application token identifier
* @return bool
*/
function delete($id)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->queueServiceActionCall("apptoken", "delete", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* Get application authentication token by id
*
* @param string $id Application token identifier
* @return KalturaAppToken
*/
function get($id)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->queueServiceActionCall("apptoken", "get", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAppToken");
return $resultObject;
}
/**
* Starts a new KS (Kaltura Session) based on application authentication token id
*
* @param string $id Application token id
* @param string $tokenHash Hashed token - current KS concatenated with the application token hashed using the application token ‘hashType’
* @param string $userId Session user id, will be ignored if a different user id already defined on the application token
* @param int $expiry Session expiry (in seconds), could be overwritten by shorter expiry of the application token and the session-expiry that defined on the application token
* @param string $udid Device UDID
* @return KalturaSessionInfo
*/
function startSession($id, $tokenHash, $userId = null, $expiry = null, $udid = null)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "tokenHash", $tokenHash);
$this->client->addParam($kparams, "userId", $userId);
$this->client->addParam($kparams, "expiry", $expiry);
$this->client->addParam($kparams, "udid", $udid);
$this->client->queueServiceActionCall("apptoken", "startSession", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaSessionInfo");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetCommentService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add asset comments by asset id
*
* @param KalturaAssetComment $comment Comment
* @return KalturaAssetComment
*/
function add(KalturaAssetComment $comment)
{
$kparams = array();
$this->client->addParam($kparams, "comment", $comment->toParams());
$this->client->queueServiceActionCall("assetcomment", "add", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetComment");
return $resultObject;
}
/**
* Returns asset comments by asset id
*
* @param KalturaAssetCommentFilter $filter Filtering the assets comments request
* @param KalturaFilterPager $pager Page size and index
* @return KalturaAssetCommentListResponse
*/
function listAction(KalturaAssetCommentFilter $filter, KalturaFilterPager $pager = null)
{
$kparams = array();
$this->client->addParam($kparams, "filter", $filter->toParams());
if ($pager !== null)
$this->client->addParam($kparams, "pager", $pager->toParams());
$this->client->queueServiceActionCall("assetcomment", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetCommentListResponse");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add a new asset.
For metas of type bool-> use kalturaBoolValue, type number-> KalturaDoubleValue, type date -> KalturaLongValue, type string -> KalturaStringValue
*
* @param KalturaAsset $asset Asset object
* @return KalturaAsset
*/
function add(KalturaAsset $asset)
{
$kparams = array();
$this->client->addParam($kparams, "asset", $asset->toParams());
$this->client->queueServiceActionCall("asset", "add", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAsset");
return $resultObject;
}
/**
* Add new bulk upload batch job Conversion profile id can be specified in the API.
*
* @param file $fileData FileData
* @param KalturaBulkUploadJobData $bulkUploadJobData BulkUploadJobData
* @param KalturaBulkUploadAssetData $bulkUploadAssetData BulkUploadAssetData
* @return KalturaBulkUpload
*/
function addFromBulkUpload($fileData, KalturaBulkUploadJobData $bulkUploadJobData, KalturaBulkUploadAssetData $bulkUploadAssetData)
{
$kparams = array();
$kfiles = array();
$this->client->addParam($kfiles, "fileData", $fileData);
$this->client->addParam($kparams, "bulkUploadJobData", $bulkUploadJobData->toParams());
$this->client->addParam($kparams, "bulkUploadAssetData", $bulkUploadAssetData->toParams());
$this->client->queueServiceActionCall("asset", "addFromBulkUpload", $kparams, $kfiles);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaBulkUpload");
return $resultObject;
}
/**
* Returns a group-by result for media or EPG according to given filter. Lists values of each field and their respective count.
*
* @param KalturaSearchAssetFilter $filter Filtering the assets request
* @return KalturaAssetCount
*/
function count(KalturaSearchAssetFilter $filter = null)
{
$kparams = array();
if ($filter !== null)
$this->client->addParam($kparams, "filter", $filter->toParams());
$this->client->queueServiceActionCall("asset", "count", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetCount");
return $resultObject;
}
/**
* Delete an existing asset
*
* @param bigint $id Asset Identifier
* @param string $assetReferenceType Type of asset
* @return bool
*/
function delete($id, $assetReferenceType)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "assetReferenceType", $assetReferenceType);
$this->client->queueServiceActionCall("asset", "delete", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* 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 string $id Asset identifier
* @param string $assetReferenceType Asset type
* @return KalturaAsset
*/
function get($id, $assetReferenceType)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "assetReferenceType", $assetReferenceType);
$this->client->queueServiceActionCall("asset", "get", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAsset");
return $resultObject;
}
/**
* Returns the data for ads control
*
* @param string $assetId Asset identifier
* @param string $assetType Asset type
* @param KalturaPlaybackContextOptions $contextDataParams Parameters for the request
* @return KalturaAdsContext
*/
function getAdsContext($assetId, $assetType, KalturaPlaybackContextOptions $contextDataParams)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "contextDataParams", $contextDataParams->toParams());
$this->client->queueServiceActionCall("asset", "getAdsContext", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAdsContext");
return $resultObject;
}
/**
* This action delivers all data relevant for player
*
* @param string $assetId Asset identifier
* @param string $assetType Asset type
* @param KalturaPlaybackContextOptions $contextDataParams Parameters for the request
* @param string $sourceType Filter sources by type
* @return KalturaPlaybackContext
*/
function getPlaybackContext($assetId, $assetType, KalturaPlaybackContextOptions $contextDataParams, $sourceType = null)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "contextDataParams", $contextDataParams->toParams());
$this->client->addParam($kparams, "sourceType", $sourceType);
$this->client->queueServiceActionCall("asset", "getPlaybackContext", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaPlaybackContext");
return $resultObject;
}
/**
* This action delivers all data relevant for player
*
* @param string $assetId Asset identifier
* @param string $assetType Asset type
* @param KalturaPlaybackContextOptions $contextDataParams Parameters for the request
* @param string $sourceType Filter sources by type
* @return KalturaPlaybackContext
*/
function getPlaybackManifest($assetId, $assetType, KalturaPlaybackContextOptions $contextDataParams, $sourceType = null)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "contextDataParams", $contextDataParams->toParams());
$this->client->addParam($kparams, "sourceType", $sourceType);
$this->client->queueServiceActionCall("asset", "getPlaybackManifest", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaPlaybackContext");
return $resultObject;
}
/**
* Returns assets deduplicated by asset metadata (or supported asset's property).
*
* @param KalturaAssetGroupBy $groupBy A metadata (or supported asset's property) to group by the assets
* @param string $unmatchedItemsPolicy Defines the policy to handle assets that don't have groupBy property
* @param KalturaBaseAssetOrder $orderBy A metadata or supported asset's property to sort by
* @param KalturaListGroupsRepresentativesFilter $filter Filtering the assets request
* @param KalturaRepresentativeSelectionPolicy $selectionPolicy A policy that implements a well defined parametric process to select an asset out of group
* @param KalturaFilterPager $pager Paging the request
* @return KalturaAssetListResponse
*/
function groupRepresentativeList(KalturaAssetGroupBy $groupBy, $unmatchedItemsPolicy, KalturaBaseAssetOrder $orderBy = null, KalturaListGroupsRepresentativesFilter $filter = null, KalturaRepresentativeSelectionPolicy $selectionPolicy = null, KalturaFilterPager $pager = null)
{
$kparams = array();
$this->client->addParam($kparams, "groupBy", $groupBy->toParams());
$this->client->addParam($kparams, "unmatchedItemsPolicy", $unmatchedItemsPolicy);
if ($orderBy !== null)
$this->client->addParam($kparams, "orderBy", $orderBy->toParams());
if ($filter !== null)
$this->client->addParam($kparams, "filter", $filter->toParams());
if ($selectionPolicy !== null)
$this->client->addParam($kparams, "selectionPolicy", $selectionPolicy->toParams());
if ($pager !== null)
$this->client->addParam($kparams, "pager", $pager->toParams());
$this->client->queueServiceActionCall("asset", "groupRepresentativeList", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetListResponse");
return $resultObject;
}
/**
* Returns media or EPG assets. Filters by media identifiers or by EPG internal or external identifier.
*
* @param KalturaAssetFilter $filter Filtering the assets request
* @param KalturaFilterPager $pager Paging the request
* @return KalturaAssetListResponse
*/
function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null)
{
$kparams = array();
if ($filter !== null)
$this->client->addParam($kparams, "filter", $filter->toParams());
if ($pager !== null)
$this->client->addParam($kparams, "pager", $pager->toParams());
$this->client->queueServiceActionCall("asset", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetListResponse");
return $resultObject;
}
/**
* Returns recent selected assets
*
* @param KalturaPersonalAssetSelectionFilter $filter Filtering the assets request
* @return KalturaAssetListResponse
*/
function listPersonalSelection(KalturaPersonalAssetSelectionFilter $filter)
{
$kparams = array();
$this->client->addParam($kparams, "filter", $filter->toParams());
$this->client->queueServiceActionCall("asset", "listPersonalSelection", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetListResponse");
return $resultObject;
}
/**
* Remove metas and tags from asset
*
* @param bigint $id Asset Identifier
* @param string $assetReferenceType Type of asset
* @param string $idIn Comma separated ids of metas and tags
* @return bool
*/
function removeMetasAndTags($id, $assetReferenceType, $idIn)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "assetReferenceType", $assetReferenceType);
$this->client->addParam($kparams, "idIn", $idIn);
$this->client->queueServiceActionCall("asset", "removeMetasAndTags", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* Update an existing asset.
For metas of type bool-> use kalturaBoolValue, type number-> KalturaDoubleValue, type date -> KalturaLongValue, type string -> KalturaStringValue
*
* @param bigint $id Asset Identifier
* @param KalturaAsset $asset Asset object
* @return KalturaAsset
*/
function update($id, KalturaAsset $asset)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "asset", $asset->toParams());
$this->client->queueServiceActionCall("asset", "update", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAsset");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetFileService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Get KalturaAssetFileContext
*
* @param string $id Asset file identifier
* @param string $contextType Kaltura Context Type (none = 0, recording = 1)
* @return KalturaAssetFileContext
*/
function getContext($id, $contextType)
{
$kparams = array();
$this->client->addParam($kparams, "id", $id);
$this->client->addParam($kparams, "contextType", $contextType);
$this->client->queueServiceActionCall("assetfile", "getContext", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetFileContext");
return $resultObject;
}
/**
* Redirects to play manifest
*
* @param int $partnerId Partner identifier
* @param string $assetId Asset identifier
* @param string $assetType Asset type
* @param bigint $assetFileId Asset file identifier
* @param string $contextType Playback context type
* @param string $ks Kaltura session for the user, not mandatory for anonymous user
* @param string $tokenizedUrl Tokenized Url, not mandatory
* @param bool $isAltUrl Is alternative url
* @return KalturaAssetFile
*/
function playManifest($partnerId, $assetId, $assetType, $assetFileId, $contextType, $ks = null, $tokenizedUrl = null, $isAltUrl = false)
{
$kparams = array();
$this->client->addParam($kparams, "partnerId", $partnerId);
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "assetFileId", $assetFileId);
$this->client->addParam($kparams, "contextType", $contextType);
$this->client->addParam($kparams, "ks", $ks);
$this->client->addParam($kparams, "tokenizedUrl", $tokenizedUrl);
$this->client->addParam($kparams, "isAltUrl", $isAltUrl);
$this->client->queueServiceActionCall("assetfile", "playManifest", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetFile");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetFilePpvService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add asset file ppv
*
* @param KalturaAssetFilePpv $assetFilePpv Asset file ppv
* @return KalturaAssetFilePpv
*/
function add(KalturaAssetFilePpv $assetFilePpv)
{
$kparams = array();
$this->client->addParam($kparams, "assetFilePpv", $assetFilePpv->toParams());
$this->client->queueServiceActionCall("assetfileppv", "add", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetFilePpv");
return $resultObject;
}
/**
* Delete asset file ppv
*
* @param bigint $assetFileId Asset file id
* @param bigint $ppvModuleId Ppv module id
* @return bool
*/
function delete($assetFileId, $ppvModuleId)
{
$kparams = array();
$this->client->addParam($kparams, "assetFileId", $assetFileId);
$this->client->addParam($kparams, "ppvModuleId", $ppvModuleId);
$this->client->queueServiceActionCall("assetfileppv", "delete", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$resultObject = (bool) $resultObject;
return $resultObject;
}
/**
* Return a list of asset files ppvs for the account with optional filter
*
* @param KalturaAssetFilePpvFilter $filter Filter parameters for filtering out the result
* @return KalturaAssetFilePpvListResponse
*/
function listAction(KalturaAssetFilePpvFilter $filter)
{
$kparams = array();
$this->client->addParam($kparams, "filter", $filter->toParams());
$this->client->queueServiceActionCall("assetfileppv", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetFilePpvListResponse");
return $resultObject;
}
/**
* Update assetFilePpv
*
* @param bigint $assetFileId Asset file id
* @param bigint $ppvModuleId Ppv module id
* @param KalturaAssetFilePpv $assetFilePpv AssetFilePpv
* @return KalturaAssetFilePpv
*/
function update($assetFileId, $ppvModuleId, KalturaAssetFilePpv $assetFilePpv)
{
$kparams = array();
$this->client->addParam($kparams, "assetFileId", $assetFileId);
$this->client->addParam($kparams, "ppvModuleId", $ppvModuleId);
$this->client->addParam($kparams, "assetFilePpv", $assetFilePpv->toParams());
$this->client->queueServiceActionCall("assetfileppv", "update", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetFilePpv");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetHistoryService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Clean the user’s viewing history
*
* @param KalturaAssetHistoryFilter $filter List of assets identifier
*/
function clean(KalturaAssetHistoryFilter $filter = null)
{
$kparams = array();
if ($filter !== null)
$this->client->addParam($kparams, "filter", $filter->toParams());
$this->client->queueServiceActionCall("assethistory", "clean", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "null");
}
/**
* Get next episode by last watch asset in given assetId
*
* @param bigint $assetId Asset Id of series to search for next episode
* @param KalturaSeriesIdArguments $seriesIdArguments Series Id arguments
* @param string $notWatchedReturnStrategy Not watched any episode strategy
* @param string $watchedAllReturnStrategy Watched all series episodes strategy
* @return KalturaAssetHistory
*/
function getNextEpisode($assetId = null, KalturaSeriesIdArguments $seriesIdArguments = null, $notWatchedReturnStrategy = null, $watchedAllReturnStrategy = null)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
if ($seriesIdArguments !== null)
$this->client->addParam($kparams, "seriesIdArguments", $seriesIdArguments->toParams());
$this->client->addParam($kparams, "notWatchedReturnStrategy", $notWatchedReturnStrategy);
$this->client->addParam($kparams, "watchedAllReturnStrategy", $watchedAllReturnStrategy);
$this->client->queueServiceActionCall("assethistory", "getNextEpisode", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetHistory");
return $resultObject;
}
/**
* Get recently watched media for user, ordered by recently watched first.
*
* @param KalturaAssetHistoryFilter $filter Filter parameters for filtering out the result
* @param KalturaFilterPager $pager Page size and index. Number of assets to return per page. Possible range 5 ≤ size ≥ 50. If omitted - will be set to 25. If a value > 50 provided – will set to 50
* @return KalturaAssetHistoryListResponse
*/
function listAction(KalturaAssetHistoryFilter $filter = null, KalturaFilterPager $pager = null)
{
$kparams = array();
if ($filter !== null)
$this->client->addParam($kparams, "filter", $filter->toParams());
if ($pager !== null)
$this->client->addParam($kparams, "pager", $pager->toParams());
$this->client->queueServiceActionCall("assethistory", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetHistoryListResponse");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetPersonalMarkupService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Response with list of assetPersonalMarkup.
*
* @param KalturaAssetPersonalMarkupSearchFilter $filter Filter pager
* @return KalturaAssetPersonalMarkupListResponse
*/
function listAction(KalturaAssetPersonalMarkupSearchFilter $filter)
{
$kparams = array();
$this->client->addParam($kparams, "filter", $filter->toParams());
$this->client->queueServiceActionCall("assetpersonalmarkup", "list", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetPersonalMarkupListResponse");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetPersonalSelectionService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Remove asset selection in slot
*
* @param bigint $assetId Asset id
* @param string $assetType Asset type: media/epg
* @param int $slotNumber Slot number
*/
function delete($assetId, $assetType, $slotNumber)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "slotNumber", $slotNumber);
$this->client->queueServiceActionCall("assetpersonalselection", "delete", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "null");
}
/**
* Remove asset selection in slot
*
* @param int $slotNumber Slot number
*/
function deleteAll($slotNumber)
{
$kparams = array();
$this->client->addParam($kparams, "slotNumber", $slotNumber);
$this->client->queueServiceActionCall("assetpersonalselection", "deleteAll", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "null");
}
/**
* Add or update asset selection in slot
*
* @param bigint $assetId Asset id
* @param string $assetType Asset type: media/epg
* @param int $slotNumber Slot number
* @return KalturaAssetPersonalSelection
*/
function upsert($assetId, $assetType, $slotNumber)
{
$kparams = array();
$this->client->addParam($kparams, "assetId", $assetId);
$this->client->addParam($kparams, "assetType", $assetType);
$this->client->addParam($kparams, "slotNumber", $slotNumber);
$this->client->queueServiceActionCall("assetpersonalselection", "upsert", $kparams);
if ($this->client->isMultiRequest())
return $this->client->getMultiRequestResult();
$resultObject = $this->client->doQueue();
$this->client->throwExceptionIfError($resultObject);
$this->client->validateObjectType($resultObject, "KalturaAssetPersonalSelection");
return $resultObject;
}
}
/**
* @package Kaltura
* @subpackage Client
*/
class KalturaAssetRuleService extends KalturaServiceBase
{
function __construct(KalturaClient $client = null)
{
parent::__construct($client);
}
/**
* Add asset rule
*
* @param KalturaAssetRule $assetRule Asset rule
* @return KalturaAssetRule
*/
function add(KalturaAssetRule $assetRule)
{
$kparams = array();
$this->client->addParam($kparams, "assetRule", $assetRule->toParams());
$this->client->queueServiceActionCall("assetrule", "add", $kparams);
if ($this->client->isMultiRequest())