全部产品
云市场

初始化

更新时间:2019-03-01 21:01:27

前置条件

初始化

点播服务的接入区域参考 接入区域标识,如国内请使用cn-shanghai

  1. var RPCClient = require('@alicloud/pop-core').RPCClient;
  2. function initVodClient(accessKeyId, secretAccessKey,) {
  3. var regionId = 'cn-shanghai'; // 点播服务接入区域
  4. var client = new RPCClient({
  5. accessKeyId: accessKeyId,
  6. secretAccessKey: secretAccessKey,
  7. endpoint: 'http://vod.' + regionId + '.aliyuncs.com',
  8. apiVersion: '2017-03-21'
  9. });
  10. return client;
  11. }
  • 使用 STS 初始化
  1. var RPCClient = require('@alicloud/pop-core').RPCClient;
  2. function initVodClient(accessKeyId, secretAccessKey, securityToken) {
  3. var regionId = 'cn-shanghai'; // 点播服务接入区域
  4. var client = new RPCClient({
  5. accessKeyId: accessKeyId,
  6. secretAccessKey: secretAccessKey,
  7. securityToken: securityToken,
  8. endpoint: 'http://vod.' + regionId + '.aliyuncs.com',
  9. apiVersion: '2017-03-21'
  10. });
  11. return client;
  12. }