Skip to content

Commit 96449f8

Browse files
author
Patrice Brend'amour
committed
Added small how to
1 parent e4bb07e commit 96449f8

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

README.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,66 @@ zencoder-java
33

44
Java Client Library for Zencoder API
55

6+
**Current release version:** 0.9.3
67
**Current development version:** 0.9.4-SNAPSHOT
78

89
## How to use zencoder-java
9-
TODO
10+
11+
Zencoder-java currently supports most of the functions of Zencoder, e.g.:
12+
- Watermarks
13+
- Multiple outputs
14+
- S3 storage (both for in and output)
15+
- Notifications (email, HTTP, ...)
16+
- ...
17+
18+
Using zencoder-java to create your zencoder jobs is fairly easy:
19+
### Create a client instance
20+
```java
21+
ZencoderClient zencoderClient = new ZencoderClient(API_KEY, API_VERSION);
22+
HttpClient client = new HttpClient(new SimpleHttpConnectionManager());
23+
ApacheHttpClientHandler apacheHttpClientHandler = new ApacheHttpClientHandler(client, new DefaultApacheHttpClientConfig());
24+
ApacheHttpClient httpClient = new ApacheHttpClient(apacheHttpClientHandler);
25+
zencoderClient.setHttpClient(httpClient);
26+
```
27+
### Create Output
28+
```java
29+
//Add notification email
30+
ZencoderNotification notification = new ZencoderNotification("test@test.de");
31+
32+
ZencoderOutput output = new ZencoderOutput("test", "se://test/");
33+
output.addNotification(notification);
34+
35+
ZencoderJob job = new ZencoderJob("http://ca.bitzeche.de/big_buck_bunny_720p_h264.mov");
36+
job.addOutput(output);
37+
//region where the job is processed
38+
job.setZencoderRegion(ZencoderRegion.EUROPE);
39+
//set test mode
40+
job.setTest(true);
41+
```
42+
43+
### Submit Job
44+
```java
45+
client.createJob(job);
46+
```
47+
48+
### Cancel Job
49+
```java
50+
client.cancelJob(job);
51+
```
52+
53+
### Resubmit Job
54+
```java
55+
boolean resubmitted = client.resubmitJob(job);
56+
```
57+
58+
### Delete Job
59+
```java
60+
client.deleteJob(job);
61+
```
62+
63+
64+
### Add Watermark
65+
```java
66+
ZencoderWatermark watermark = new ZencoderWatermark("http://url/");
67+
output.addWatermark(watermark);
68+
```

0 commit comments

Comments
 (0)