Skip to content

Instantly share code, notes, and snippets.

@juizmill
Created May 29, 2014 12:53
Show Gist options
  • Select an option

  • Save juizmill/e0f70788ba732f0d073f to your computer and use it in GitHub Desktop.

Select an option

Save juizmill/e0f70788ba732f0d073f to your computer and use it in GitHub Desktop.
<?php
public function completeVideoVimeo(Array $data)
{
try{
$check = $this->vimeo->call('vimeo.videos.upload.checkTicket', array(
'oauth_token' => $this->config['vimeo']['token'],
'ticket_id' => $data['ticket']));
$complete = $this->vimeo->call('vimeo.videos.upload.complete', array(
'oauth_token' => $this->config['vimeo']['token'],
'ticket_id' => $check->ticket->id,
'filename' => $data['filename']));
$data['video_id'] = $complete->ticket->video_id;
$this->vimeo->call('vimeo.videos.setTitle', array('video_id' => $complete->ticket->video_id, 'title' => $data['title']));
$this->vimeo->call('vimeo.videos.setDescription', array('video_id' => $complete->ticket->video_id, 'description' => $data['description']));
$this->vimeo->call('vimeo.videos.embed.setPreset', array('video_id' => $complete->ticket->video_id, 'preset_id' => '419504'));
$this->vimeo->call('vimeo.channels.addVideo', array('channel_id' => $data['cd_channel'], 'video_id' => $complete->ticket->video_id));
return $data;
}catch (\Exception $e){
Logger::writeLogger($e);
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment