1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | var Vimeo = require('../index').Vimeo;
|
19 |
|
20 | try {
|
21 | var config = require('./config.json');
|
22 | } catch (error) {
|
23 | console.error('ERROR: For this example to run properly you must create an api app at developer.vimeo.com/apps/new and set your callback url to http://localhost:8080/oauth_callback');
|
24 | console.error('ERROR: Once you have your app, make a copy of config.json.example named "config.json" and add your client id, client secret and access token');
|
25 | return;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 | var lib = new Vimeo(config.client_id, config.client_secret);
|
31 | lib.access_token = config.access_token;
|
32 |
|
33 |
|
34 | lib.streamingUpload(__dirname + '/test.mp4', function (error, body, status_code, headers) {
|
35 | if (error) {
|
36 | console.log('error');
|
37 | console.log(error);
|
38 | } else {
|
39 | console.log('body');
|
40 | console.log(body);
|
41 | }
|
42 |
|
43 | console.log('status code');
|
44 | console.log(status_code);
|
45 | console.log('headers');
|
46 | console.log(headers);
|
47 | });
|
48 |
|
49 | require('repl').start('hi'); |
\ | No newline at end of file |