forked from wistia/bakery-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
41 lines (28 loc) · 966 Bytes
/
Copy pathREADME
File metadata and controls
41 lines (28 loc) · 966 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
Bakery API
==================
Ruby API for the Bakery. See http://doc.unraw.net.
This is currently in the form of a Rails plugin. Drop it into
vendor/plugins and you're off to the races.
Configure it like so:
Bakery::Configuration.configure!(
:api_scheme => 'https',
:api_host => 'account.unraw.net',
:api_user => 'user',
:api_password => 'password',
:api_access_key => 'abc123',
:http_delivery_host => 'account.media.unraw.net',
:https_delivery_host => 'account.media.unraw.net')
Then you can do stuff like get info about an asset:
media = Bakery::Media.find(123)
media.extension #=> 'mov'
media.status #=> 1 (Bakery::Media::PROCESSING)
media.progress #=> 0.58
Or extract and resize a jpeg still from a video asset:
Bakery::Derivative.create(
:media_id => 123,
:extension => 'jpg',
:image_resize => '640',
:video_still_time => 15
)
=====================
Copyright (c) 2009 Brendan Schwartz, released under the MIT license