public function upload($file) { $url = $this->api->uploadFile($file); $result = $this->call('video.create', array('url' => $url)); $remoteId = $result['id']; return $remoteId; }
* Created by PhpStorm. * User: vanhung * Date: 6/7/15 * Time: 10:52 PM */ include_once "Dailymotion.php"; include_once "PDOImplement.php"; header('Content-Type: text/html; charset=UTF-8'); set_time_limit(0); //require_once 'sdk/Dailymotion.php'; try { $apiKey = '0c201474be2087aa73fa'; $apiSecret = '1a461e78a3747381ab735fca88421bd70380084e'; $testUser = '******'; $testPassword = '******'; $api = new Dailymotion(); $pdo = new PDOImplement(); $result = $pdo->ExecuteQuery("select type,tag, youtube_id,title,description,catagory,id from youtube"); foreach ($result as $item => $value) { $youtube_id = $value["youtube_id"]; $id = $value["id"]; $type = $value["type"]; $title = $value["title"]; $tag = explode(" ", $value["tag"]); $title = $value["title"]; $description = $value["description"]; $catagory = $value["catagory"]; if ($type == 1) { $videoFile = __DIR__ . "/files_download/" . $youtube_id . ".mp4"; } else { $videoFile = __DIR__ . "/files_download/" . $title . ".mp4";
public function updateSubtitle($remoteSubtitleId, KalturaDailymotionDistributionCaptionInfo $captionInfo) { $url = $this->api->uploadFile($captionInfo->filePath); $args = array(); $args['url'] = $url; $args['language'] = $captionInfo->language; $args['format'] = $this->getCaptionFormate($captionInfo->format); $tempApiEndpointUrl = $this->api->apiEndpointUrl; $this->api->apiEndpointUrl = self::NEW_API_END_POINT_URL; $response = $this->call("POST /subtitle/{$remoteSubtitleId}", $args); $this->api->apiEndpointUrl = $tempApiEndpointUrl; }