forked from vimeo/vimeo-php-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
22 lines (18 loc) · 806 Bytes
/
upload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include 'vimeo.php';
$vimeo = new phpVimeo('CONSUMER_KEY', 'CONSUMER_SECRET', 'ACCESS_TOKEN', 'ACCESS_TOKEN_SECRET');
try {
$video_id = $vimeo->upload('PATH_TO_VIDEO_FILE');
if ($video_id) {
echo '<a href="http://vimeo.com/' . $video_id . '">Upload successful!</a>';
//$vimeo->call('vimeo.videos.setPrivacy', array('privacy' => 'nobody', 'video_id' => $video_id));
$vimeo->call('vimeo.videos.setTitle', array('title' => 'YOUR TITLE', 'video_id' => $video_id));
$vimeo->call('vimeo.videos.setDescription', array('description' => 'YOUR_DESCRIPTION', 'video_id' => $video_id));
}
else {
echo "Video file did not exist!";
}
}
catch (VimeoAPIException $e) {
echo "Encountered an API error -- code {$e->getCode()} - {$e->getMessage()}";
}