-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
100 lines (85 loc) · 2.82 KB
/
README
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
=== Getting Started
Run these commands to try it out.
bundle
rake db:setup
rails s
rake jobs:work
If you want to try it on any OS other than MacOS you should add this to your Gemfile:
gem 'execjs'
gem 'therubyracer'
=== Prerequisites
You should have ffmpeg installed. If ffmpeg on your machine is installed not in "/usr/local/bin/ffmpeg" directory, you should edit Paperclip.options[:command_path] line in "/config/environments/*" config files.
=== API
== GET /videos.json
Example request:
GET /videos.json
Example response:
[{
"convertation_status":"ended"
"created_at":"2012-01-19T23:51:15Z",
"id":44,
"name":"David Blaine",
"updated_at":"2012-01-19T23:51:15Z",
"uploaded_video_content_type":"video/quicktime",
"uploaded_video_file_name":"test.mov",
"uploaded_video_file_size":9781678,
"uploaded_video_updated_at":"2012-01-19T23:51:15Z",
"preview_url":"/system/uploaded_videos/44/preview/test.jpg?1327017075",
"flv_url":"/system/uploaded_videos/44/flv/test.flv?1327017075"},
…]
== GET /videos/:id.json
Example request:
GET /videos/48.json
Example response:
{
"convertation_status":"started"
"created_at":"2012-01-20T02:07:33Z",
"id":48,
"name":"Chuck Norris is dead",
"updated_at":"2012-01-20T02:07:33Z",
"uploaded_video_content_type":"video/quicktime",
"uploaded_video_file_name":"IMG_0192.MOV",
"uploaded_video_file_size":224815088,
"uploaded_video_updated_at":"2012-01-20T02:07:24Z",
"preview_url":"/system/uploaded_videos/48/preview/IMG_0192.jpg?1327025244",
"flv_url":"/system/uploaded_videos/48/flv/IMG_0192.flv?1327025244"
}
== PUT /videos/:id.json
Example request:
PUT /videos/48.json
Example response:
{
"convertation_status":"ended"
"created_at":"2012-01-20T02:07:33Z",
"id":48,
"name":"Chuck Norris can't be dead",
"updated_at":"2012-01-20T02:09:03Z",
"uploaded_video_content_type":"video/quicktime",
"uploaded_video_file_name":"IMG_0192.MOV",
"uploaded_video_file_size":224815088,
"uploaded_video_updated_at":"2012-01-20T02:07:24Z",
"preview_url":"/system/uploaded_videos/48/preview/IMG_0192.jpg?1327025244",
"flv_url":"/system/uploaded_videos/48/flv/IMG_0192.flv?1327025244"
}
== POST /videos.json
Example request:
POST /videos.json
Example response:
{
"convertation_status":null
"created_at":"2012-01-20T02:07:33Z",
"id":54,
"name":"New video about Justin Bieber",
"updated_at":"2012-01-20T02:08:35Z",
"uploaded_video_content_type":"video/quicktime",
"uploaded_video_file_name":"IMG_0245.MOV",
"uploaded_video_file_size":235752248,
"uploaded_video_updated_at":"2012-01-20T02:09:34Z",
"preview_url":"/system/uploaded_videos/54/preview/IMG_0245.jpg?1327025244",
"flv_url":"/system/uploaded_videos/54/flv/IMG_0245.flv?1327025244"
}
== DELETE /videos/:id.json
Example request:
DELETE /videos/54.json
Example response:
status: 200