Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updates kaltura

  • Loading branch information...
commit 3dca0236c744b63a83206fc0f10f40c6d053dc39 1 parent 7282e2a
Zohar Babin authored
Showing with 40,330 additions and 8 deletions.
  1. +2 −2 acceptfile.php
  2. +30 −6 index.php
  3. +443 −0 log_file.log
  4. +87 −0 mictest-html5.php
  5. +5,291 −0 php5/KalturaClient.php
  6. +1,017 −0 php5/KalturaClientBase.php
  7. +2,886 −0 php5/KalturaEnums.php
  8. +253 −0 php5/KalturaPlugins/KalturaAdCuePointClientPlugin.php
  9. +594 −0 php5/KalturaPlugins/KalturaAdminConsoleClientPlugin.php
  10. +371 −0 php5/KalturaPlugins/KalturaAnnotationClientPlugin.php
  11. +375 −0 php5/KalturaPlugins/KalturaAttachmentClientPlugin.php
  12. +875 −0 php5/KalturaPlugins/KalturaAuditClientPlugin.php
  13. +154 −0 php5/KalturaPlugins/KalturaBulkUploadClientPlugin.php
  14. +104 −0 php5/KalturaPlugins/KalturaBulkUploadCsvClientPlugin.php
  15. +84 −0 php5/KalturaPlugins/KalturaBulkUploadXmlClientPlugin.php
  16. +642 −0 php5/KalturaPlugins/KalturaCaptionClientPlugin.php
  17. +291 −0 php5/KalturaPlugins/KalturaCaptionSearchClientPlugin.php
  18. +237 −0 php5/KalturaPlugins/KalturaCodeCuePointClientPlugin.php
  19. +3,086 −0 php5/KalturaPlugins/KalturaContentDistributionClientPlugin.php
  20. +588 −0 php5/KalturaPlugins/KalturaCuePointClientPlugin.php
  21. +795 −0 php5/KalturaPlugins/KalturaDocumentClientPlugin.php
  22. +1,471 −0 php5/KalturaPlugins/KalturaDropFolderClientPlugin.php
  23. +86 −0 php5/KalturaPlugins/KalturaDropFolderXmlBulkUploadClientPlugin.php
  24. +226 −0 php5/KalturaPlugins/KalturaEmailNotificationClientPlugin.php
  25. +227 −0 php5/KalturaPlugins/KalturaEventNotificationClientPlugin.php
  26. +338 −0 php5/KalturaPlugins/KalturaFileSyncClientPlugin.php
  27. +197 −0 php5/KalturaPlugins/KalturaKalturaInternalToolsClientPlugin.php
  28. +134 −0 php5/KalturaPlugins/KalturaLikeClientPlugin.php
  29. +1,291 −0 php5/KalturaPlugins/KalturaMetadataClientPlugin.php
  30. +112 −0 php5/KalturaPlugins/KalturaMultiCentersClientPlugin.php
  31. +436 −0 php5/KalturaPlugins/KalturaShortLinkClientPlugin.php
  32. +946 −0 php5/KalturaPlugins/KalturaSystemPartnerClientPlugin.php
  33. +235 −0 php5/KalturaPlugins/KalturaTagSearchClientPlugin.php
  34. +367 −0 php5/KalturaPlugins/KalturaVarConsoleClientPlugin.php
  35. +506 −0 php5/KalturaPlugins/KalturaVirusScanClientPlugin.php
  36. +14,707 −0 php5/KalturaTypes.php
  37. BIN  php5/TestCode/DemoVideo.flv
  38. +36 −0 php5/TestCode/KalturaTestConfiguration.php
  39. +136 −0 php5/TestCode/TestMain.php
  40. +674 −0 php5/agpl.txt
  41. BIN  watson-audio.wav
  42. BIN  watson.wav
4 acceptfile.php
View
@@ -15,8 +15,8 @@
fclose($fp);
- $commandString = 'ffmpeg -i watson.wav -y -ar 8000 -ab 16 -ac 1 watson-audio.wav >> log_file.log 2>&1 &';
- $command = exec($commandString);
+// $commandString = 'ffmpeg -i watson.wav -y -ar 8000 -ab 16 -ac 1 watson-audio.wav >> log_file.log 2>&1 &';
+// $command = exec($commandString);
exit('done');
36 index.php
View
@@ -7,8 +7,11 @@
<?php
header("Content-Type: text/html; charset=ISO-8859-1");
include ("config.php");
-include ($oauth_file);
-error_reporting(0);
+//include ($oauth_file);
+require_once('php5/KalturaClient.php');
+require_once('php5/TestCode/KalturaTestConfiguration.php');
+
+//error_reporting(0);
session_start();
function RefreshToken($FQDN,$api_key,$secret_key,$scope,$fullToken){
@@ -394,11 +397,12 @@ function callback_activityTime(time)
$fullToken=check_token($FQDN,$api_key,$secret_key,$scope,$fullToken,$oauth_file);
$accessToken=$fullToken["accessToken"];
- $filename = $_FILES['f1']['name'];
+ $filename = null; //$_FILES['f1']['name'];
if($filename == null) {
-
+ $commandString = 'ffmpeg -i watson.wav -y -ar 8000 -ab 16 -ac 1 watson-audio.wav >> log_file.log 2>&1 &';
+ $command = exec($commandString);
$filename = dirname(__FILE__).'/watson-audio.wav';
$file_binary = fread(fopen($filename, 'rb'), filesize($filename));
@@ -497,8 +501,28 @@ function callback_activityTime(time)
-
-
+ $kConfig = new KalturaConfiguration(KalturaTestConfiguration::PARTNER_ID);
+ $kConfig->serviceUrl = KalturaTestConfiguration::SERVICE_URL;
+ $client = new KalturaClient($kConfig);
+ $userId = "watsongangham";
+ $sessionType = KalturaSessionType::ADMIN;
+ $ks = $client->generateSession(KalturaTestConfiguration::ADMIN_SECRET, $userId, $sessionType, KalturaTestConfiguration::PARTNER_ID);
+ $client->setKs($ks);
+// $client = $this->getKalturaClient(KalturaTestConfiguration::PARTNER_ID, KalturaTestConfiguration::ADMIN_SECRET, false);
+ $filePath = dirname(__FILE__).'/watson-audio.wav'; //'watson-audio.wav';
+ //$token = $client->media->upload($filePath);
+ $token = $client->uploadToken->add();
+ $client->uploadToken->upload($token->id, $filePath);
+ $mediaResource = new KalturaUploadedFileTokenResource();
+ $mediaResource->token = $token->id;
+ $entry = new KalturaMediaEntry();
+ $entry->name = "watson gangham - ".@$jsonObj2->Recognition->ResponseId;
+ $entry->description = @$jsonObj2->Recognition->NBest[0]->ResultText;
+ $entry->mediaType = KalturaMediaType::AUDIO;
+ $entry = $client->media->add($entry);
+ $newEntry = $client->media->addContent($entry->id, $mediaResource);
+ //$newEntry = $client->media->addFromUploadedFile($entry, $token);
+ echo "<p>Uploaded to Kaltura: " . $newEntry->id . '<br />' . $filePath . '</p>';
}else{
443 log_file.log
View
@@ -34,3 +34,446 @@ Stream mapping:
Press ctrl-c to stop encoding
size= 89kB time=5.71 bitrate= 128.1kbits/s
video:0kB audio:89kB global headers:0kB muxing overhead 0.050343%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0xa6b7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:05.61, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 88kB time=5.62 bitrate= 128.1kbits/s
+video:0kB audio:88kB global headers:0kB muxing overhead 0.051175%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x258c7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:08.35, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 131kB time=8.36 bitrate= 128.0kbits/s
+video:0kB audio:131kB global headers:0kB muxing overhead 0.034398%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x112c7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.56, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 118kB time=7.57 bitrate= 128.0kbits/s
+video:0kB audio:118kB global headers:0kB muxing overhead 0.037986%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x6b07a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:14.72, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 230kB time=14.72 bitrate= 128.0kbits/s
+video:0kB audio:230kB global headers:0kB muxing overhead 0.019531%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1d2a7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:08.17, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 128kB time=8.17 bitrate= 128.0kbits/s
+video:0kB audio:128kB global headers:0kB muxing overhead 0.035180%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x141e7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.24, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 113kB time=7.24 bitrate= 128.1kbits/s
+video:0kB audio:113kB global headers:0kB muxing overhead 0.039691%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:03.76, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 59kB time=3.76 bitrate= 128.1kbits/s
+video:0kB audio:59kB global headers:0kB muxing overhead 0.076453%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:04.17, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 65kB time=4.18 bitrate= 128.1kbits/s
+video:0kB audio:65kB global headers:0kB muxing overhead 0.068807%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:03.85, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 60kB time=3.85 bitrate= 128.1kbits/s
+video:0kB audio:60kB global headers:0kB muxing overhead 0.074610%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:02.46, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 38kB time=2.46 bitrate= 128.1kbits/s
+video:0kB audio:38kB global headers:0kB muxing overhead 0.116864%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:03.76, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 59kB time=3.76 bitrate= 128.1kbits/s
+video:0kB audio:59kB global headers:0kB muxing overhead 0.076453%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:03.25, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 51kB time=3.25 bitrate= 128.1kbits/s
+video:0kB audio:51kB global headers:0kB muxing overhead 0.088472%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:03.76, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 59kB time=3.76 bitrate= 128.1kbits/s
+video:0kB audio:59kB global headers:0kB muxing overhead 0.076453%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0xba57a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.26, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 98kB time=6.27 bitrate= 128.1kbits/s
+video:0kB audio:98kB global headers:0kB muxing overhead 0.045866%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1b4a7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.59, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 103kB time=6.59 bitrate= 128.1kbits/s
+video:0kB audio:103kB global headers:0kB muxing overhead 0.043605%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x7827a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.45, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 101kB time=6.45 bitrate= 128.1kbits/s
+video:0kB audio:101kB global headers:0kB muxing overhead 0.044546%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1df97a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.13, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 96kB time=6.13 bitrate= 128.1kbits/s
+video:0kB audio:96kB global headers:0kB muxing overhead 0.046909%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0xd057a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.17, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 97kB time=6.18 bitrate= 128.1kbits/s
+video:0kB audio:96kB global headers:0kB muxing overhead 0.046556%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1de47a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:06.31, bitrate: 693 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 97kB time=6.20 bitrate= 128.1kbits/s
+video:0kB audio:97kB global headers:0kB muxing overhead 0.046341%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1b437a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.19, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 112kB time=7.20 bitrate= 128.1kbits/s
+video:0kB audio:112kB global headers:0kB muxing overhead 0.039947%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x14e87a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:28.23, bitrate: 402 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 251kB time=16.09 bitrate= 128.0kbits/s
+video:0kB audio:251kB global headers:0kB muxing overhead 0.017871%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1b3a7a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:24.65, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 385kB time=24.66 bitrate= 128.0kbits/s
+video:0kB audio:385kB global headers:0kB muxing overhead 0.011659%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x14c87a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.66, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 120kB time=7.66 bitrate= 128.0kbits/s
+video:0kB audio:120kB global headers:0kB muxing overhead 0.037526%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x1fc37a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.66, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 120kB time=7.66 bitrate= 128.0kbits/s
+video:0kB audio:120kB global headers:0kB muxing overhead 0.037526%
+ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
+ built on Jun 12 2012 16:52:09 with gcc 4.6.3
+*** THIS PROGRAM IS DEPRECATED ***
+This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
+[wav @ 0x8b57a0] max_analyze_duration reached
+Input #0, wav, from 'watson.wav':
+ Duration: 00:00:07.66, bitrate: 705 kb/s
+ Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
+The bitrate parameter is set too low.It takes bits/s as argument, not kbits/s
+Output #0, wav, to 'watson-audio.wav':
+ Metadata:
+ encoder : Lavf53.21.0
+ Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s
+Stream mapping:
+ Stream #0.0 -> #0.0
+Press ctrl-c to stop encoding
+size= 120kB time=7.66 bitrate= 128.0kbits/s
+video:0kB audio:120kB global headers:0kB muxing overhead 0.037526%
87 mictest-html5.php
View
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
+ <script>
+ var localMediaStream;
+ var recorder;
+ var video;
+ var audio;
+
+ function hasGetUserMedia() {
+ // Note: Opera is unprefixed.
+ return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
+ }
+
+ function onFailSoHard (e) {
+ console.log('Reeeejected!', e);
+ };
+
+ function initializeMediaElements () {
+ console.log('initializing...');
+ window.URL = window.URL || window.webkitURL;
+ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
+ video = document.querySelector('video');
+ audio = document.querySelector('audio');
+ navigator.getUserMedia({video: true, audio: true, toString: function() {return "video,audio";}}, function (stream) {
+ audio.src = window.URL.createObjectURL(stream);
+ audio.play();
+ video.src = window.URL.createObjectURL(stream);
+ video.play();
+ localMediaStream = stream;
+ console.log('camera and mic are setup');
+ }, onFailSoHard);
+ }
+
+ function startRecording (){
+ console.log('recording video and audio to local blob...');
+ console.log(localMediaStream);
+ recorder = localMediaStream.record();
+ }
+
+ function stopRecording (){
+ localMediaStream.stop();
+ /*audio.src = window.URL.createObjectURL(localMediaStream);
+ video.src = window.URL.createObjectURL(localMediaStream);
+ audio.play();
+ video.play();
+ console.log('playing from the local blob');
+ */
+ recorder.getRecordedData(function(blob) {
+ // Upload blob using XHR2.
+ audio.src = window.URL.createObjectURL(blob);
+ video.src = window.URL.createObjectURL(blob);
+ document.getElementById('audiodata').innerHTML = blob;
+ audio.play();
+ video.play();
+ console.log('playing from the local blob');
+ console.log(blob);
+ });
+ }
+
+ $(document).ready(function() {
+ // Handler for .ready() called.
+ if (hasGetUserMedia()) {
+ console.log('Good to go! we have support for getUserMedia API!');
+ initializeMediaElements();
+ } else {
+ alert('getUserMedia() is not supported in your browser');
+ }
+ });
+
+ </script>
+</head>
+<body>
+ <video style="width:320px;height:240px;"></video>
+ <audio></audio>
+ <div id="audiodata"></div>
+ <input onclick="startRecording()" type="button" value="start recording" />
+ <input onclick="stopRecording()" type="button" value="stop recording and play" />
+ <!--
+<form enctype="multipart/form-data">
+<input name="file" type="file" />
+<input type="button" value="Upload" />
+</form>
+-->
+</body>
+</html>
5,291 php5/KalturaClient.php
View
5,291 additions, 0 deletions not shown
1,017 php5/KalturaClientBase.php
View
@@ -0,0 +1,1017 @@
+<?php
+// ===================================================================================================
+// _ __ _ _
+// | |/ /__ _| | |_ _ _ _ _ __ _
+// | ' </ _` | | _| || | '_/ _` |
+// |_|\_\__,_|_|\__|\_,_|_| \__,_|
+//
+// This file is part of the Kaltura Collaborative Media Suite which allows users
+// to do with audio, video, and animation what Wiki platfroms allow them to do with
+// text.
+//
+// Copyright (C) 2006-2011 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
+ */
+class MultiRequestSubResult
+{
+ function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ function __toString()
+ {
+ return '{' . $this->value . '}';
+ }
+
+ function __get($name)
+ {
+ return new MultiRequestSubResult($this->value . ':' . $name);
+ }
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaNull
+{
+ private static $instance;
+
+ private function __construct()
+ {
+
+ }
+
+ public static function getInstance()
+ {
+ if (!isset(self::$instance)) {
+ $c = __CLASS__;
+ self::$instance = new $c();
+ }
+ return self::$instance;
+ }
+
+ function __toString()
+ {
+ return '';
+ }
+
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaClientBase
+{
+ const KALTURA_SERVICE_FORMAT_JSON = 1;
+ const KALTURA_SERVICE_FORMAT_XML = 2;
+ const KALTURA_SERVICE_FORMAT_PHP = 3;
+
+ /**
+ * @var string
+ */
+ protected $apiVersion = null;
+
+ /**
+ * @var KalturaConfiguration
+ */
+ protected $config;
+
+ /**
+ * @var string
+ */
+ private $ks;
+
+ /**
+ * @var boolean
+ */
+ private $shouldLog = false;
+
+ /**
+ * @var bool
+ */
+ private $isMultiRequest = false;
+
+ /**
+ * @var unknown_type
+ */
+ private $callsQueue = array();
+
+ /**
+ * Array of all plugin services
+ *
+ * @var array<KalturaServiceBase>
+ */
+ protected $pluginServices = array();
+
+ /**
+ * @var Array of response headers
+ */
+ private $responseHeaders = array();
+
+ public function __get($serviceName)
+ {
+ if(isset($this->pluginServices[$serviceName]))
+ return $this->pluginServices[$serviceName];
+
+ return null;
+ }
+
+ /**
+ * Kaltura client constructor
+ *
+ * @param KalturaConfiguration $config
+ */
+ public function __construct(KalturaConfiguration $config)
+ {
+ $this->config = $config;
+
+ $logger = $this->config->getLogger();
+ if ($logger)
+ {
+ $this->shouldLog = true;
+ }
+
+ // load all plugins
+ $pluginsFolder = realpath(dirname(__FILE__)) . '/KalturaPlugins';
+ if(is_dir($pluginsFolder))
+ {
+ $dir = dir($pluginsFolder);
+ while (false !== $fileName = $dir->read())
+ {
+ $matches = null;
+ if(preg_match('/^([^.]+).php$/', $fileName, $matches))
+ {
+ require_once("$pluginsFolder/$fileName");
+
+ $pluginClass = $matches[1];
+ if(!class_exists($pluginClass) || !in_array('IKalturaClientPlugin', class_implements($pluginClass)))
+ continue;
+
+ $plugin = call_user_func(array($pluginClass, 'get'), $this);
+ if(!($plugin instanceof IKalturaClientPlugin))
+ continue;
+
+ $pluginName = $plugin->getName();
+ $services = $plugin->getServices();
+ foreach($services as $serviceName => $service)
+ {
+ $service->setClient($this);
+ $this->pluginServices[$serviceName] = $service;
+ }
+ }
+ }
+ }
+ }
+
+ /* Store response headers into array */
+ public function readHeader($ch, $string)
+ {
+ array_push($this->responseHeaders, $string);
+ return strlen($string);
+ }
+
+ /* Retrive response headers */
+ public function getResponseHeaders()
+ {
+ return $this->responseHeaders;
+ }
+
+ public function getServeUrl()
+ {
+ if (count($this->callsQueue) != 1)
+ return null;
+
+ $params = array();
+ $files = array();
+ $this->log("service url: [" . $this->config->serviceUrl . "]");
+
+ // append the basic params
+ $this->addParam($params, "apiVersion", $this->apiVersion);
+ $this->addParam($params, "format", $this->config->format);
+ $this->addParam($params, "clientTag", $this->config->clientTag);
+
+ $call = $this->callsQueue[0];
+ $this->callsQueue = array();
+ $this->isMultiRequest = false;
+
+ $params = array_merge($params, $call->params);
+ $signature = $this->signature($params);
+ $this->addParam($params, "kalsig", $signature);
+
+ $url = $this->config->serviceUrl . "/api_v3/index.php?service={$call->service}&action={$call->action}";
+ $url .= '&' . http_build_query($params);
+ $this->log("Returned url [$url]");
+ return $url;
+ }
+
+ public function queueServiceActionCall($service, $action, $params = array(), $files = array())
+ {
+ // in start session partner id is optional (default -1). if partner id was not set, use the one in the config
+ if (!isset($params["partnerId"]) || $params["partnerId"] === -1)
+ $params["partnerId"] = $this->config->partnerId;
+
+ $this->addParam($params, "ks", $this->ks);
+
+ $call = new KalturaServiceActionCall($service, $action, $params, $files);
+ $this->callsQueue[] = $call;
+ }
+
+ /**
+ * Call all API service that are in queue
+ *
+ * @return unknown
+ */
+ public function doQueue()
+ {
+ if (count($this->callsQueue) == 0)
+ {
+ $this->isMultiRequest = false;
+ return null;
+ }
+
+ $startTime = microtime(true);
+
+ $params = array();
+ $files = array();
+ $this->log("service url: [" . $this->config->serviceUrl . "]");
+
+ // append the basic params
+ $this->addParam($params, "apiVersion", $this->apiVersion);
+ $this->addParam($params, "format", $this->config->format);
+ $this->addParam($params, "clientTag", $this->config->clientTag);
+ $this->addParam($params, "ignoreNull", true);
+
+ $url = $this->config->serviceUrl."/api_v3/index.php?service=";
+ if ($this->isMultiRequest)
+ {
+ $url .= "multirequest";
+ $i = 1;
+ foreach ($this->callsQueue as $call)
+ {
+ $callParams = $call->getParamsForMultiRequest($i);
+ $callFiles = $call->getFilesForMultiRequest($i);
+ $params = array_merge($params, $callParams);
+ $files = array_merge($files, $callFiles);
+ $i++;
+ }
+ }
+ else
+ {
+ $call = $this->callsQueue[0];
+ $url .= $call->service."&action=".$call->action;
+ $params = array_merge($params, $call->params);
+ $files = $call->files;
+ }
+
+ // reset
+ $this->callsQueue = array();
+ $this->isMultiRequest = false;
+
+ $signature = $this->signature($params);
+ $this->addParam($params, "kalsig", $signature);
+
+ list($postResult, $error) = $this->doHttpRequest($url, $params, $files);
+
+ if ($error)
+ {
+ throw new KalturaClientException($error, KalturaClientException::ERROR_GENERIC);
+ }
+ else
+ {
+// if(strlen($postResult) > 1024)
+// $this->log("result (serialized): " . strlen($postResult) . " bytes");
+// else
+ $this->log("result (serialized): " . $postResult);
+
+ if ($this->config->format == self::KALTURA_SERVICE_FORMAT_PHP)
+ {
+ $result = @unserialize($postResult);
+
+ if ($result === false && serialize(false) !== $postResult)
+ {
+ throw new KalturaClientException("failed to unserialize server result\n$postResult", KalturaClientException::ERROR_UNSERIALIZE_FAILED);
+ }
+ $dump = print_r($result, true);
+// if(strlen($dump) < 1024)
+ $this->log("result (object dump): " . $dump);
+ }
+ else
+ {
+ throw new KalturaClientException("unsupported format: $postResult", KalturaClientException::ERROR_FORMAT_NOT_SUPPORTED);
+ }
+ }
+
+ $endTime = microtime (true);
+
+ $this->log("execution time for [".$url."]: [" . ($endTime - $startTime) . "]");
+
+ return $result;
+ }
+
+ /**
+ * Sign array of parameters
+ *
+ * @param array $params
+ * @return string
+ */
+ private function signature($params)
+ {
+ ksort($params);
+ $str = "";
+ foreach ($params as $k => $v)
+ {
+ $str .= $k.$v;
+ }
+ return md5($str);
+ }
+
+ /**
+ * Send http request by using curl (if available) or php stream_context
+ *
+ * @param string $url
+ * @param parameters $params
+ * @return array of result and error
+ */
+ private function doHttpRequest($url, $params = array(), $files = array())
+ {
+ if (function_exists('curl_init'))
+ return $this->doCurl($url, $params, $files);
+ else
+ return $this->doPostRequest($url, $params, $files);
+ }
+
+ /**
+ * Curl HTTP POST Request
+ *
+ * @param string $url
+ * @param array $params
+ * @return array of result and error
+ */
+ private function doCurl($url, $params = array(), $files = array())
+ {
+ $this->responseHeaders = array();
+ $cookies = array();
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ if (count($files) > 0)
+ {
+ foreach($files as &$file)
+ $file = "@".$file; // let curl know its a file
+ curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($params, $files));
+ }
+ else
+ {
+ $opt = http_build_query($params, null, "&");
+ $this->log("curl: $url&$opt");
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $opt);
+ }
+ curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_USERAGENT, $this->config->userAgent);
+ if (count($files) > 0)
+ curl_setopt($ch, CURLOPT_TIMEOUT, 0);
+ else
+ curl_setopt($ch, CURLOPT_TIMEOUT, $this->config->curlTimeout);
+
+ if ($this->config->startZendDebuggerSession === true)
+ {
+ $zendDebuggerParams = $this->getZendDebuggerParams($url);
+ $cookies = array_merge($cookies, $zendDebuggerParams);
+ }
+
+ if (count($cookies) > 0)
+ {
+ $cookiesStr = http_build_query($cookies, null, '; ');
+ curl_setopt($ch, CURLOPT_COOKIE, $cookiesStr);
+ }
+
+ if (isset($this->config->proxyHost)) {
+ curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
+ curl_setopt($ch, CURLOPT_PROXY, $this->config->proxyHost);
+ if (isset($this->config->proxyPort)) {
+ curl_setopt($ch, CURLOPT_PROXYPORT, $this->config->proxyPort);
+ }
+ if (isset($this->config->proxyUser)) {
+ curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->config->proxyUser.':'.$this->config->proxyPassword);
+ }
+ if (isset($this->config->proxyType) && $this->config->proxyType === 'SOCKS5') {
+ curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+ }
+ }
+
+ // Set SSL verification
+ if(!$this->getConfig()->verifySSL)
+ {
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
+ }
+
+ // Set custom headers
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $this->config->requestHeaders );
+
+ // Save response headers
+ curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'readHeader') );
+
+ $result = curl_exec($ch);
+ $curlError = curl_error($ch);
+ curl_close($ch);
+ return array($result, $curlError);
+ }
+
+ /**
+ * HTTP stream context request
+ *
+ * @param string $url
+ * @param array $params
+ * @return array of result and error
+ */
+ private function doPostRequest($url, $params = array(), $files = array())
+ {
+ if (count($files) > 0)
+ throw new KalturaClientException("Uploading files is not supported with stream context http request, please use curl", KalturaClientException::ERROR_UPLOAD_NOT_SUPPORTED);
+
+ $formattedData = http_build_query($params , "", "&");
+ $params = array('http' => array(
+ "method" => "POST",
+ "User-Agent: " . $this->config->userAgent . "\r\n".
+ "Accept-language: en\r\n".
+ "Content-type: application/x-www-form-urlencoded\r\n",
+ "content" => $formattedData
+ ));
+
+ if (isset($this->config->proxyType) && $this->config->proxyType === 'SOCKS5') {
+ throw new KalturaClientException("Cannot use SOCKS5 without curl installed.", KalturaClientException::ERROR_CONNECTION_FAILED);
+ }
+ if (isset($this->config->proxyHost)) {
+ $proxyhost = 'tcp://' . $this->config->proxyHost;
+ if (isset($this->config->proxyPort)) {
+ $proxyhost = $proxyhost . ":" . $this->config->proxyPort;
+ }
+ $params['http']['proxy'] = $proxyhost;
+ $params['http']['request_fulluri'] = true;
+ if (isset($this->config->proxyUser)) {
+ $auth = base64_encode($this->config->proxyUser.':'.$this->config->proxyPassword);
+ $params['http']['header'] = 'Proxy-Authorization: Basic ' . $auth;
+ }
+ }
+
+ $ctx = stream_context_create($params);
+ $fp = @fopen($url, 'rb', false, $ctx);
+ if (!$fp) {
+ $phpErrorMsg = "";
+ throw new KalturaClientException("Problem with $url, $phpErrorMsg", KalturaClientException::ERROR_CONNECTION_FAILED);
+ }
+ $response = @stream_get_contents($fp);
+ if ($response === false) {
+ throw new KalturaClientException("Problem reading data from $url, $phpErrorMsg", KalturaClientException::ERROR_READ_FAILED);
+ }
+ return array($response, '');
+ }
+
+ /**
+ * @return string
+ */
+ public function getKs()
+ {
+ return $this->ks;
+ }
+
+ /**
+ * @param string $ks
+ */
+ public function setKs($ks)
+ {
+ $this->ks = $ks;
+ }
+
+ /**
+ * @return KalturaConfiguration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * @param KalturaConfiguration $config
+ */
+ public function setConfig(KalturaConfiguration $config)
+ {
+ $this->config = $config;
+
+ $logger = $this->config->getLogger();
+ if ($logger instanceof IKalturaLogger)
+ {
+ $this->shouldLog = true;
+ }
+ }
+
+ /**
+ * Add parameter to array of parameters that is passed by reference
+ *
+ * @param arrat $params
+ * @param string $paramName
+ * @param string $paramValue
+ */
+ public function addParam(&$params, $paramName, $paramValue)
+ {
+ if ($paramValue === null)
+ return;
+
+ if ($paramValue instanceof KalturaNull) {
+ $params[$paramName . '__null'] = '';
+ return;
+ }
+
+ if(is_object($paramValue) && $paramValue instanceof KalturaObjectBase)
+ {
+ $this->addParam($params, "$paramName:objectType", get_class($paramValue));
+ foreach($paramValue as $prop => $val)
+ $this->addParam($params, "$paramName:$prop", $val);
+
+ return;
+ }
+
+ if(!is_array($paramValue))
+ {
+ $params[$paramName] = (string)$paramValue;
+ return;
+ }
+
+ if ($paramValue)
+ {
+ foreach($paramValue as $subParamName => $subParamValue)
+ $this->addParam($params, "$paramName:$subParamName", $subParamValue);
+ }
+ else
+ {
+ $this->addParam($params, "$paramName:-", "");
+ }
+ }
+
+ /**
+ * Validate the result object and throw exception if its an error
+ *
+ * @param object $resultObject
+ */
+ public function throwExceptionIfError($resultObject)
+ {
+ if ($this->isError($resultObject))
+ {
+ throw new KalturaException($resultObject["message"], $resultObject["code"]);
+ }
+ }
+
+ /**
+ * Checks whether the result object is an error
+ *
+ * @param object $resultObject
+ */
+ public function isError($resultObject)
+ {
+ return (is_array($resultObject) && isset($resultObject["message"]) && isset($resultObject["code"]));
+ }
+
+ /**
+ * Validate that the passed object type is of the expected type
+ *
+ * @param any $resultObject
+ * @param string $objectType
+ */
+ public function validateObjectType($resultObject, $objectType)
+ {
+ if (is_object($resultObject))
+ {
+ if (!($resultObject instanceof $objectType))
+ throw new KalturaClientException("Invalid object type", KalturaClientException::ERROR_INVALID_OBJECT_TYPE);
+ }
+ else if (gettype($resultObject) !== "NULL" && gettype($resultObject) !== $objectType)
+ {
+ throw new KalturaClientException("Invalid object type", KalturaClientException::ERROR_INVALID_OBJECT_TYPE);
+ }
+ }
+
+ public function startMultiRequest()
+ {
+ $this->isMultiRequest = true;
+ }
+
+ public function doMultiRequest()
+ {
+ return $this->doQueue();
+ }
+
+ public function isMultiRequest()
+ {
+ return $this->isMultiRequest;
+ }
+
+ public function getMultiRequestQueueSize()
+ {
+ return count($this->callsQueue);
+ }
+
+ public function getMultiRequestResult()
+ {
+ return new MultiRequestSubResult($this->getMultiRequestQueueSize() . ':result');
+ }
+
+ /**
+ * @param string $msg
+ */
+ protected function log($msg)
+ {
+ if ($this->shouldLog)
+ $this->config->getLogger()->log($msg);
+ }
+
+ /**
+ * Return a list of parameter used to a new start debug on the destination server api
+ * @link http://kb.zend.com/index.php?View=entry&EntryID=434
+ * @param $url
+ */
+ protected function getZendDebuggerParams($url)
+ {
+ $params = array();
+ $passThruParams = array('debug_host',
+ 'debug_fastfile',
+ 'debug_port',
+ 'start_debug',
+ 'send_debug_header',
+ 'send_sess_end',
+ 'debug_jit',
+ 'debug_stop',
+ 'use_remote');
+
+ foreach($passThruParams as $param)
+ {
+ if (isset($_COOKIE[$param]))
+ $params[$param] = $_COOKIE[$param];
+ }
+
+ $params['original_url'] = $url;
+ $params['debug_session_id'] = microtime(true); // to create a new debug session
+
+ return $params;
+ }
+
+ public function generateSession($adminSecretForSigning, $userId, $type, $partnerId, $expiry = 86400, $privileges = '')
+ {
+ $rand = rand(0, 32000);
+ $expiry = time()+$expiry;
+ $fields = array (
+ $partnerId ,
+ $partnerId ,
+ $expiry ,
+ $type,
+ $rand ,
+ $userId ,
+ $privileges
+ );
+ $info = implode ( ";" , $fields );
+
+ $signature = $this->hash ( $adminSecretForSigning , $info );
+ $strToHash = $signature . "|" . $info ;
+ $encoded_str = base64_encode( $strToHash );
+
+ return $encoded_str;
+ }
+
+ private function hash ( $salt , $str )
+ {
+ return sha1($salt.$str);
+ }
+
+ /**
+ * @return KalturaNull
+ */
+ public static function getKalturaNullValue()
+ {
+
+ return KalturaNull::getInstance();
+ }
+
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+interface IKalturaClientPlugin
+{
+ /**
+ * @return KalturaClientPlugin
+ */
+ public static function get(KalturaClient $client);
+
+ /**
+ * @return array<KalturaServiceBase>
+ */
+ public function getServices();
+
+ /**
+ * @return string
+ */
+ public function getName();
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+abstract class KalturaClientPlugin implements IKalturaClientPlugin
+{
+ protected function __construct(KalturaClient $client)
+ {
+
+ }
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaServiceActionCall
+{
+ /**
+ * @var string
+ */
+ public $service;
+
+ /**
+ * @var string
+ */
+ public $action;
+
+
+ /**
+ * @var array
+ */
+ public $params;
+
+ /**
+ * @var array
+ */
+ public $files;
+
+ /**
+ * Contruct new Kaltura service action call, if params array contain sub arrays (for objects), it will be flattened
+ *
+ * @param string $service
+ * @param string $action
+ * @param array $params
+ * @param array $files
+ */
+ public function __construct($service, $action, $params = array(), $files = array())
+ {
+ $this->service = $service;
+ $this->action = $action;
+ $this->params = $this->parseParams($params);
+ $this->files = $files;
+ }
+
+ /**
+ * Parse params array and sub arrays (for objects)
+ *
+ * @param array $params
+ */
+ public function parseParams(array $params)
+ {
+ $newParams = array();
+ foreach($params as $key => $val)
+ {
+ if (is_array($val))
+ {
+ $newParams[$key] = $this->parseParams($val);
+ }
+ else
+ {
+ $newParams[$key] = $val;
+ }
+ }
+ return $newParams;
+ }
+
+ /**
+ * Return the parameters for a multi request
+ *
+ * @param int $multiRequestIndex
+ */
+ public function getParamsForMultiRequest($multiRequestIndex)
+ {
+ $multiRequestParams = array();
+ $multiRequestParams[$multiRequestIndex.":service"] = $this->service;
+ $multiRequestParams[$multiRequestIndex.":action"] = $this->action;
+ foreach($this->params as $key => $val)
+ {
+ $multiRequestParams[$multiRequestIndex.":".$key] = $val;
+ }
+ return $multiRequestParams;
+ }
+
+ /**
+ * Return the parameters for a multi request
+ *
+ * @param int $multiRequestIndex
+ */
+ public function getFilesForMultiRequest($multiRequestIndex)
+ {
+ $multiRequestParams = array();
+ foreach($this->files as $key => $val)
+ {
+ $multiRequestParams[$multiRequestIndex.":".$key] = $val;
+ }
+ return $multiRequestParams;
+ }
+}
+
+/**
+ * Abstract base class for all client services
+ *
+ * @package Kaltura
+ * @subpackage Client
+ */
+abstract class KalturaServiceBase
+{
+ /**
+ * @var KalturaClient
+ */
+ protected $client;
+
+ /**
+ * Initialize the service keeping reference to the KalturaClient
+ *
+ * @param KalturaClient $client
+ */
+ public function __construct(KalturaClient $client = null)
+ {
+ $this->client = $client;
+ }
+
+ /**
+ * @param KalturaClient $client
+ */
+ public function setClient(KalturaClient $client)
+ {
+ $this->client = $client;
+ }
+}
+
+/**
+ * Abstract base class for all client objects
+ *
+ * @package Kaltura
+ * @subpackage Client
+ */
+abstract class KalturaObjectBase
+{
+ protected function addIfNotNull(&$params, $paramName, $paramValue)
+ {
+ if ($paramValue !== null)
+ {
+ if($paramValue instanceof KalturaObjectBase)
+ {
+ $params[$paramName] = $paramValue->toParams();
+ }
+ else
+ {
+ $params[$paramName] = $paramValue;
+ }
+ }
+ }
+
+ public function toParams()
+ {
+ $params = array();
+ $params["objectType"] = get_class($this);
+ foreach($this as $prop => $val)
+ {
+ $this->addIfNotNull($params, $prop, $val);
+ }
+ return $params;
+ }
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaException extends Exception
+{
+ public function __construct($message, $code)
+ {
+ $this->code = $code;
+ parent::__construct($message);
+ }
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaClientException extends Exception
+{
+ const ERROR_GENERIC = -1;
+ const ERROR_UNSERIALIZE_FAILED = -2;
+ const ERROR_FORMAT_NOT_SUPPORTED = -3;
+ const ERROR_UPLOAD_NOT_SUPPORTED = -4;
+ const ERROR_CONNECTION_FAILED = -5;
+ const ERROR_READ_FAILED = -6;
+ const ERROR_INVALID_PARTNER_ID = -7;
+ const ERROR_INVALID_OBJECT_TYPE = -8;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaConfiguration
+{
+ private $logger;
+
+ public $serviceUrl = "http://www.kaltura.com/";
+ public $partnerId = null;
+ public $format = 3;
+ public $clientTag = "php5";
+ public $curlTimeout = 10;
+ public $userAgent = '';
+ public $startZendDebuggerSession = false;
+ public $proxyHost = null;
+ public $proxyPort = null;
+ public $proxyType = 'HTTP';
+ public $proxyUser = null;
+ public $proxyPassword = '';
+ public $verifySSL = true;
+ public $requestHeaders = array();
+
+
+
+
+ /**
+ * Constructs new Kaltura configuration object
+ *
+ */
+ public function __construct($partnerId = -1)
+ {
+ if (!is_numeric($partnerId))
+ throw new KalturaClientException("Invalid partner id", KalturaClientException::ERROR_INVALID_PARTNER_ID);
+
+ $this->partnerId = $partnerId;
+ }
+
+ /**
+ * Set logger to get kaltura client debug logs
+ *
+ * @param IKalturaLogger $log
+ */
+ public function setLogger(IKalturaLogger $log)
+ {
+ $this->logger = $log;
+ }
+
+ /**
+ * Gets the logger (Internal client use)
+ *
+ * @return IKalturaLogger
+ */
+ public function getLogger()
+ {
+ return $this->logger;
+ }
+}
+
+/**
+ * Implement to get Kaltura Client logs
+ *
+ * @package Kaltura
+ * @subpackage Client
+ */
+interface IKalturaLogger
+{
+ function log($msg);
+}
+
+
2,886 php5/KalturaEnums.php
View
@@ -0,0 +1,2886 @@
+<?php
+// ===================================================================================================
+// _ __ _ _
+// | |/ /__ _| | |_ _ _ _ _ __ _
+// | ' </ _` | | _| || | '_/ _` |
+// |_|\_\__,_|_|\__|\_,_|_| \__,_|
+//
+// This file is part of the Kaltura Collaborative Media Suite which allows users
+// to do with audio, video, and animation what Wiki platfroms allow them to do with
+// text.
+//
+// Copyright (C) 2006-2011 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("KalturaClientBase.php");
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaAppearInListType
+{
+ const PARTNER_ONLY = 1;
+ const CATEGORY_MEMBERS_ONLY = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaAssetParamsOrigin
+{
+ const CONVERT = 0;
+ const INGEST = 1;
+ const CONVERT_WHEN_MISSING = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaAssetStatus
+{
+ const ERROR = -1;
+ const QUEUED = 0;
+ const READY = 2;
+ const DELETED = 3;
+ const IMPORTING = 7;
+ const EXPORTING = 9;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaBatchJobErrorTypes
+{
+ const APP = 0;
+ const RUNTIME = 1;
+ const HTTP = 2;
+ const CURL = 3;
+ const KALTURA_API = 4;
+ const KALTURA_CLIENT = 5;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaBatchJobStatus
+{
+ const PENDING = 0;
+ const QUEUED = 1;
+ const PROCESSING = 2;
+ const PROCESSED = 3;
+ const MOVEFILE = 4;
+ const FINISHED = 5;
+ const FAILED = 6;
+ const ABORTED = 7;
+ const ALMOST_DONE = 8;
+ const RETRY = 9;
+ const FATAL = 10;
+ const DONT_PROCESS = 11;
+ const FINISHED_PARTIALLY = 12;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaBitRateMode
+{
+ const CBR = 1;
+ const VBR = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCategoryEntryStatus
+{
+ const PENDING = 1;
+ const ACTIVE = 2;
+ const DELETED = 3;
+ const REJECTED = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCategoryStatus
+{
+ const UPDATING = 1;
+ const ACTIVE = 2;
+ const DELETED = 3;
+ const PURGED = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCategoryUserPermissionLevel
+{
+ const MANAGER = 0;
+ const MODERATOR = 1;
+ const CONTRIBUTOR = 2;
+ const MEMBER = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCategoryUserStatus
+{
+ const ACTIVE = 1;
+ const PENDING = 2;
+ const NOT_ACTIVE = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCommercialUseType
+{
+ const COMMERCIAL_USE = 1;
+ const NON_COMMERCIAL_USE = 0;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaContributionPolicyType
+{
+ const ALL = 1;
+ const MEMBERS_WITH_CONTRIBUTION_PERMISSION = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaControlPanelCommandStatus
+{
+ const PENDING = 1;
+ const HANDLED = 2;
+ const DONE = 3;
+ const FAILED = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaControlPanelCommandTargetType
+{
+ const DATA_CENTER = 1;
+ const SCHEDULER = 2;
+ const JOB_TYPE = 3;
+ const JOB = 4;
+ const BATCH = 5;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaControlPanelCommandType
+{
+ const STOP = 1;
+ const START = 2;
+ const CONFIG = 3;
+ const KILL = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaCountryRestrictionType
+{
+ const RESTRICT_COUNTRY_LIST = 0;
+ const ALLOW_COUNTRY_LIST = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaDirectoryRestrictionType
+{
+ const DONT_DISPLAY = 0;
+ const DISPLAY_WITH_LINK = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaEditorType
+{
+ const SIMPLE = 1;
+ const ADVANCED = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaEmailIngestionProfileStatus
+{
+ const INACTIVE = 0;
+ const ACTIVE = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaEntryModerationStatus
+{
+ const PENDING_MODERATION = 1;
+ const APPROVED = 2;
+ const REJECTED = 3;
+ const FLAGGED_FOR_REVIEW = 5;
+ const AUTO_APPROVED = 6;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaFeatureStatusType
+{
+ const LOCK_CATEGORY = 1;
+ const CATEGORY = 2;
+ const CATEGORY_ENTRY = 3;
+ const ENTRY = 4;
+ const CATEGORY_USER = 5;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaFlavorAssetStatus
+{
+ const CONVERTING = 1;
+ const NOT_APPLICABLE = 4;
+ const TEMP = 5;
+ const WAIT_FOR_CONVERT = 6;
+ const VALIDATING = 8;
+ const ERROR = -1;
+ const QUEUED = 0;
+ const READY = 2;
+ const DELETED = 3;
+ const IMPORTING = 7;
+ const EXPORTING = 9;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaFlavorReadyBehaviorType
+{
+ const NO_IMPACT = 0;
+ const REQUIRED = 1;
+ const OPTIONAL = 2;
+ const INHERIT_FLAVOR_PARAMS = 0;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaGender
+{
+ const UNKNOWN = 0;
+ const MALE = 1;
+ const FEMALE = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaInheritanceType
+{
+ const INHERIT = 1;
+ const MANUAL = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaIpAddressRestrictionType
+{
+ const RESTRICT_LIST = 0;
+ const ALLOW_LIST = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaLicenseType
+{
+ const UNKNOWN = -1;
+ const NONE = 0;
+ const COPYRIGHTED = 1;
+ const PUBLIC_DOMAIN = 2;
+ const CREATIVECOMMONS_ATTRIBUTION = 3;
+ const CREATIVECOMMONS_ATTRIBUTION_SHARE_ALIKE = 4;
+ const CREATIVECOMMONS_ATTRIBUTION_NO_DERIVATIVES = 5;
+ const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL = 6;
+ const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL_SHARE_ALIKE = 7;
+ const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL_NO_DERIVATIVES = 8;
+ const GFDL = 9;
+ const GPL = 10;
+ const AFFERO_GPL = 11;
+ const LGPL = 12;
+ const BSD = 13;
+ const APACHE = 14;
+ const MOZILLA = 15;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaMailJobStatus
+{
+ const PENDING = 1;
+ const SENT = 2;
+ const ERROR = 3;
+ const QUEUED = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaMediaType
+{
+ const VIDEO = 1;
+ const IMAGE = 2;
+ const AUDIO = 5;
+ const LIVE_STREAM_FLASH = 201;
+ const LIVE_STREAM_WINDOWS_MEDIA = 202;
+ const LIVE_STREAM_REAL_MEDIA = 203;
+ const LIVE_STREAM_QUICKTIME = 204;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaModerationFlagStatus
+{
+ const PENDING = 1;
+ const MODERATED = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaModerationFlagType
+{
+ const SEXUAL_CONTENT = 1;
+ const VIOLENT_REPULSIVE = 2;
+ const HARMFUL_DANGEROUS = 3;
+ const SPAM_COMMERCIALS = 4;
+ const COPYRIGHT = 5;
+ const TERMS_OF_USE_VIOLATION = 6;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaModerationObjectType
+{
+ const ENTRY = 2;
+ const USER = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaNotificationObjectType
+{
+ const ENTRY = 1;
+ const KSHOW = 2;
+ const USER = 3;
+ const BATCH_JOB = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaNotificationStatus
+{
+ const PENDING = 1;
+ const SENT = 2;
+ const ERROR = 3;
+ const SHOULD_RESEND = 4;
+ const ERROR_RESENDING = 5;
+ const SENT_SYNCH = 6;
+ const QUEUED = 7;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaNotificationType
+{
+ const ENTRY_ADD = 1;
+ const ENTR_UPDATE_PERMISSIONS = 2;
+ const ENTRY_DELETE = 3;
+ const ENTRY_BLOCK = 4;
+ const ENTRY_UPDATE = 5;
+ const ENTRY_UPDATE_THUMBNAIL = 6;
+ const ENTRY_UPDATE_MODERATION = 7;
+ const USER_ADD = 21;
+ const USER_BANNED = 26;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaNullableBoolean
+{
+ const NULL_VALUE = -1;
+ const FALSE_VALUE = 0;
+ const TRUE_VALUE = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPartnerGroupType
+{
+ const PUBLISHER = 1;
+ const VAR_GROUP = 2;
+ const GROUP = 3;
+ const TEMPLATE = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPartnerStatus
+{
+ const ACTIVE = 1;
+ const BLOCKED = 2;
+ const FULL_BLOCK = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPartnerType
+{
+ const KMC = 1;
+ const WIKI = 100;
+ const WORDPRESS = 101;
+ const DRUPAL = 102;
+ const DEKIWIKI = 103;
+ const MOODLE = 104;
+ const COMMUNITY_EDITION = 105;
+ const JOOMLA = 106;
+ const BLACKBOARD = 107;
+ const SAKAI = 108;
+ const ADMIN_CONSOLE = 109;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPermissionStatus
+{
+ const ACTIVE = 1;
+ const BLOCKED = 2;
+ const DELETED = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPermissionType
+{
+ const NORMAL = 1;
+ const SPECIAL_FEATURE = 2;
+ const PLUGIN = 3;
+ const PARTNER_GROUP = 4;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPlaylistType
+{
+ const DYNAMIC = 10;
+ const STATIC_LIST = 3;
+ const EXTERNAL = 101;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaPrivacyType
+{
+ const ALL = 1;
+ const AUTHENTICATED_USERS = 2;
+ const MEMBERS_ONLY = 3;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaReportType
+{
+ const TOP_CONTENT = 1;
+ const CONTENT_DROPOFF = 2;
+ const CONTENT_INTERACTIONS = 3;
+ const MAP_OVERLAY = 4;
+ const TOP_CONTRIBUTORS = 5;
+ const TOP_SYNDICATION = 6;
+ const CONTENT_CONTRIBUTIONS = 7;
+ const WIDGETS_STATS = 8;
+ const USER_ENGAGEMENT = 11;
+ const SPEFICIC_USER_ENGAGEMENT = 12;
+ const USER_TOP_CONTENT = 13;
+ const USER_CONTENT_DROPOFF = 14;
+ const USER_CONTENT_INTERACTIONS = 15;
+ const APPLICATIONS = 16;
+ const USER_USAGE = 17;
+ const SPECIFIC_USER_USAGE = 18;
+ const PARTNER_USAGE = 201;
+ const VAR_USAGE = 19;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaSearchOperatorType
+{
+ const SEARCH_AND = 1;
+ const SEARCH_OR = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaSearchProviderType
+{
+ const FLICKR = 3;
+ const YOUTUBE = 4;
+ const MYSPACE = 7;
+ const PHOTOBUCKET = 8;
+ const JAMENDO = 9;
+ const CCMIXTER = 10;
+ const NYPL = 11;
+ const CURRENT = 12;
+ const MEDIA_COMMONS = 13;
+ const KALTURA = 20;
+ const KALTURA_USER_CLIPS = 21;
+ const ARCHIVE_ORG = 22;
+ const KALTURA_PARTNER = 23;
+ const METACAFE = 24;
+ const SEARCH_PROXY = 28;
+ const PARTNER_SPECIFIC = 100;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaSessionType
+{
+ const USER = 0;
+ const ADMIN = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaSiteRestrictionType
+{
+ const RESTRICT_SITE_LIST = 0;
+ const ALLOW_SITE_LIST = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaStatsEventType
+{
+ const WIDGET_LOADED = 1;
+ const MEDIA_LOADED = 2;
+ const PLAY = 3;
+ const PLAY_REACHED_25 = 4;
+ const PLAY_REACHED_50 = 5;
+ const PLAY_REACHED_75 = 6;
+ const PLAY_REACHED_100 = 7;
+ const OPEN_EDIT = 8;
+ const OPEN_VIRAL = 9;
+ const OPEN_DOWNLOAD = 10;
+ const OPEN_REPORT = 11;
+ const BUFFER_START = 12;
+ const BUFFER_END = 13;
+ const OPEN_FULL_SCREEN = 14;
+ const CLOSE_FULL_SCREEN = 15;
+ const REPLAY = 16;
+ const SEEK = 17;
+ const OPEN_UPLOAD = 18;
+ const SAVE_PUBLISH = 19;
+ const CLOSE_EDITOR = 20;
+ const PRE_BUMPER_PLAYED = 21;
+ const POST_BUMPER_PLAYED = 22;
+ const BUMPER_CLICKED = 23;
+ const PREROLL_STARTED = 24;
+ const MIDROLL_STARTED = 25;
+ const POSTROLL_STARTED = 26;
+ const OVERLAY_STARTED = 27;
+ const PREROLL_CLICKED = 28;
+ const MIDROLL_CLICKED = 29;
+ const POSTROLL_CLICKED = 30;
+ const OVERLAY_CLICKED = 31;
+ const PREROLL_25 = 32;
+ const PREROLL_50 = 33;
+ const PREROLL_75 = 34;
+ const MIDROLL_25 = 35;
+ const MIDROLL_50 = 36;
+ const MIDROLL_75 = 37;
+ const POSTROLL_25 = 38;
+ const POSTROLL_50 = 39;
+ const POSTROLL_75 = 40;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaStatsFeatureType
+{
+ const NONE = 0;
+ const RELATED = 1;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaStatsKmcEventType
+{
+ const CONTENT_PAGE_VIEW = 1001;
+ const CONTENT_ADD_PLAYLIST = 1010;
+ const CONTENT_EDIT_PLAYLIST = 1011;
+ const CONTENT_DELETE_PLAYLIST = 1012;
+ const CONTENT_DELETE_ITEM = 1058;
+ const CONTENT_DELETE_MIX = 1059;
+ const CONTENT_EDIT_ENTRY = 1013;
+ const CONTENT_CHANGE_THUMBNAIL = 1014;
+ const CONTENT_ADD_TAGS = 1015;
+ const CONTENT_REMOVE_TAGS = 1016;
+ const CONTENT_ADD_ADMIN_TAGS = 1017;
+ const CONTENT_REMOVE_ADMIN_TAGS = 1018;
+ const CONTENT_DOWNLOAD = 1019;
+ const CONTENT_APPROVE_MODERATION = 1020;
+ const CONTENT_REJECT_MODERATION = 1021;
+ const CONTENT_BULK_UPLOAD = 1022;
+ const CONTENT_ADMIN_KCW_UPLOAD = 1023;
+ const CONTENT_CONTENT_GO_TO_PAGE = 1057;
+ const CONTENT_ENTRY_DRILLDOWN = 1088;
+ const CONTENT_OPEN_PREVIEW_AND_EMBED = 1089;
+ const ACCOUNT_CHANGE_PARTNER_INFO = 1030;
+ const ACCOUNT_CHANGE_LOGIN_INFO = 1031;
+ const ACCOUNT_CONTACT_US_USAGE = 1032;
+ const ACCOUNT_UPDATE_SERVER_SETTINGS = 1033;
+ const ACCOUNT_ACCOUNT_OVERVIEW = 1034;
+ const ACCOUNT_ACCESS_CONTROL = 1035;
+ const ACCOUNT_TRANSCODING_SETTINGS = 1036;
+ const ACCOUNT_ACCOUNT_UPGRADE = 1037;
+ const ACCOUNT_SAVE_SERVER_SETTINGS = 1038;
+ const ACCOUNT_ACCESS_CONTROL_DELETE = 1039;
+ const ACCOUNT_SAVE_TRANSCODING_SETTINGS = 1040;
+ const LOGIN = 1041;
+ const DASHBOARD_IMPORT_CONTENT = 1042;
+ const DASHBOARD_UPDATE_CONTENT = 1043;
+ const DASHBOARD_ACCOUNT_CONTACT_US = 1044;
+ const DASHBOARD_VIEW_REPORTS = 1045;
+ const DASHBOARD_EMBED_PLAYER = 1046;
+ const DASHBOARD_EMBED_PLAYLIST = 1047;
+ const DASHBOARD_CUSTOMIZE_PLAYERS = 1048;
+ const APP_STUDIO_NEW_PLAYER_SINGLE_VIDEO = 1050;
+ const APP_STUDIO_NEW_PLAYER_PLAYLIST = 1051;
+ const APP_STUDIO_NEW_PLAYER_MULTI_TAB_PLAYLIST = 1052;
+ const APP_STUDIO_EDIT_PLAYER_SINGLE_VIDEO = 1053;
+ const APP_STUDIO_EDIT_PLAYER_PLAYLIST = 1054;
+ const APP_STUDIO_EDIT_PLAYER_MULTI_TAB_PLAYLIST = 1055;
+ const APP_STUDIO_DUPLICATE_PLAYER = 1056;
+ const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_TAB = 1070;
+ const REPORTS_AND_ANALYTICS_CONTENT_REPORTS_TAB = 1071;
+ const REPORTS_AND_ANALYTICS_USERS_AND_COMMUNITY_REPORTS_TAB = 1072;
+ const REPORTS_AND_ANALYTICS_TOP_CONTRIBUTORS = 1073;
+ const REPORTS_AND_ANALYTICS_MAP_OVERLAYS = 1074;
+ const REPORTS_AND_ANALYTICS_TOP_SYNDICATIONS = 1075;
+ const REPORTS_AND_ANALYTICS_TOP_CONTENT = 1076;
+ const REPORTS_AND_ANALYTICS_CONTENT_DROPOFF = 1077;
+ const REPORTS_AND_ANALYTICS_CONTENT_INTERACTIONS = 1078;
+ const REPORTS_AND_ANALYTICS_CONTENT_CONTRIBUTIONS = 1079;
+ const REPORTS_AND_ANALYTICS_VIDEO_DRILL_DOWN = 1080;
+ const REPORTS_AND_ANALYTICS_CONTENT_DRILL_DOWN_INTERACTION = 1081;
+ const REPORTS_AND_ANALYTICS_CONTENT_CONTRIBUTIONS_DRILLDOWN = 1082;
+ const REPORTS_AND_ANALYTICS_VIDEO_DRILL_DOWN_DROPOFF = 1083;
+ const REPORTS_AND_ANALYTICS_MAP_OVERLAYS_DRILLDOWN = 1084;
+ const REPORTS_AND_ANALYTICS_TOP_SYNDICATIONS_DRILL_DOWN = 1085;
+ const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_VIEW_MONTHLY = 1086;
+ const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_VIEW_YEARLY = 1087;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaStorageProfileDeliveryStatus
+{
+ const ACTIVE = 1;
+ const BLOCKED = 2;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client
+ */
+class KalturaStorageProfileProtocol
+{
+ const KALTURA_DC = 0;
+ const FTP = 1;
+ const SCP = 2;
+ const SFTP = 3;
+ const S3 = 6;
+}
+
+/**
+ * @package Kaltura
+ * @subpackage Client