Permalink
Browse files

updates kaltura

  • Loading branch information...
1 parent 7282e2a commit 3dca0236c744b63a83206fc0f10f40c6d053dc39 @zoharbabin committed Oct 14, 2012
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
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');
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{
Oops, something went wrong. Retry.

0 comments on commit 3dca023

Please sign in to comment.