Skip to content

Commit

Permalink
Added a way to retrieve the progress_url from Dailymotion::uploadFi…
Browse files Browse the repository at this point in the history
…le()
  • Loading branch information
Nicolas Grevet committed Oct 21, 2014
1 parent 795b2b8 commit d9917d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dailymotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit d9917d1

Please sign in to comment.