Vimeo-如何上传私人视频

问题描述 投票:1回答:2

我正在使用官方的node.js模块将视频上传到Vimeo,可以找到here

我能够毫无问题地上传视频。但是,我发现上传的视频是公开的。任何人都可以访问它们。

我如何将视频设为私有。我的帐户同时包含公共和私人视频。我希望通过应用程序上传的视频会自动变为私有。

[我在用于上传视频的上述Node.js模块的文档中和我的文档中找不到此内容。

vimeo vimeo-api
2个回答
2
投票

有两种方法可以做到这一点。

  1. 所有上传的视频都尊重您的全局隐私设置。这包括API上传。您可以了解更多here

  2. 您可以在视频上传后(以及在转码之前或之后)将其设为私有。签出文档here。具体来说,您要编辑privacy.view密钥。


0
投票

这里是答案:

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

© www.soinside.com 2019 - 2024. All rights reserved.