From d9917d144b0bf9ec91f6e5e59f50e05573963ec4 Mon Sep 17 00:00:00 2001 From: Nicolas Grevet Date: Tue, 21 Oct 2014 13:53:47 +0200 Subject: [PATCH] Added a way to retrieve the `progress_url` from Dailymotion::uploadFile() --- Dailymotion.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dailymotion.php b/Dailymotion.php index 3e125c4..f5e928c 100644 --- a/Dailymotion.php +++ b/Dailymotion.php @@ -302,13 +302,15 @@ protected function getCurlFile($filePath) * 'published' => true, * ); * ``` - * @param string $filePath Path to the file to upload on the local filesystem. - * @param string $forceHostname Force a specific Dailymotion server (not recommended). - * @return string URL of the file on Dailymotion's servers. + * @param string $filePath Path to the file to upload on the local filesystem. + * @param string $forceHostname Force a specific Dailymotion server (not recommended). + * @param boolean &$progressUrl If this variable is given, it will include the progress URL in it. + * @return string URL of the file on Dailymotion's servers. */ - public function uploadFile($filePath, $forceHostname = null) + public function uploadFile($filePath, $forceHostname = null, &$progressUrl = null) { $result = $this->get('/file/upload'); + $progressUrl = $result['progress_url']; if (!empty($forceHostname)) { $result['upload_url'] = preg_replace('#://[^/]+/#', "://{$forceHostname}/", $result['upload_url']);