-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathzencoder.php
More file actions
43 lines (29 loc) · 799 Bytes
/
zencoder.php
File metadata and controls
43 lines (29 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Zencoder;
use Laravel\Config;
/**
* Zencoder Exceptions
*/
class ZencoderEncodingException extends \Exception {}
class ZencoderFileLocationException extends \Exception {}
class ZencoderFileFormatException extends \Exception {}
class ZencoderConnectionException extends \Exception {}
class Zencoder
{
const STATUS_NEW = 1;
const STATUS_PENDING = 2;
const STATUS_FINISHED = 3;
const STATUS_FAILED = 4;
public static function create($input, $encodingScheme = 1)
{
$newZencoderFile = new Models\ZencoderFile();
//$newZencoderFile->encoding_scheme = $encodingScheme;
$newZencoderFile->status = 1;
$newZencoderFile->original_filename = $input;
if($newZencoderFile->run($encodingScheme))
{
$newZencoderFile->save();
}
return $newZencoderFile;
}
}