我正在使用官方的node.js模块将视频上传到Vimeo,可以找到here。
我能够毫无问题地上传视频。但是,我发现上传的视频是公开的。任何人都可以访问它们。
我如何将视频设为私有。我的帐户同时包含公共和私人视频。我希望通过应用程序上传的视频会自动变为私有。
[我在用于上传视频的上述Node.js模块的文档中和我的文档中找不到此内容。
这里是答案:
var client = new Vimeo(config.client_id, config.client_secret, config.access_token)
var params = {
'name': 'Vimeo API SDK test upload',
'description': "This video was uploaded through the Vimeo API's NodeJS SDK.",
'privacy':{
'view' : "nobody"
}
}
client.upload(
filePath,
params,
function (uri) {
// Get the metadata response from the upload and log out the Vimeo.com url
client.request(uri + '?fields=link', function (error, body, statusCode, headers) {
if (error) {
console.log('There was an error making the request.')
console.log('Server reported: ' + error)
return
}
console.log('"' + filePath + '" has been uploaded to ' + body.link)
}
privacy.view
的其他值是:任何人|联系人|禁用|没有人密码不公开|用户*。
有关更多信息,您可以访问this page。