Skip to content

Instantly share code, notes, and snippets.

@woss
Created July 11, 2014 09:21
Show Gist options
  • Save woss/697e80c4ee42636527ec to your computer and use it in GitHub Desktop.
Save woss/697e80c4ee42636527ec to your computer and use it in GitHub Desktop.
createJobs
<?php
/**
* Create jobs
* @param $videoId int
* @return $this
*/
public function createJobs($videoId)
{
$this->setVideoId($videoId);
$this->setVideoTitle($this->getVideoInfo($videoId)['title']);
$jobs = array(
array(
'format_id' => 'ios_720p'
),
array(
'format_id' => 'mp4_720p'
),
array(
'format_id' => 'android_240p'
),
array(
'format_id' => 'android_360p'
),
array(
'format_id' => 'android_720p'
),
array(
'format_id' => 'webm_240p'
),
array(
'format_id' => 'webm_360p'
),
array(
'format_id' => 'theora_240p'
),
array(
'format_id' => 'theora_360p'
),
array(
'format_id' => 'mp4_240p',
'offset' => 0,
'duration' => 3,
'name' => 'short_mp4_240p'
),
);
foreach ($jobs as $job) {
$this->createJob($job);
}
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment