最近更新时间:2023.11.13 15:23:04
首次发布时间:2021.02.23 10:42:40
Java SDK 可通过 Access Key 初始化。您可以根据需求选择设置 AK/SK 的方法。本文为您介绍初始化的操作步骤。
点播服务支持的区域:华北 cn-north-1。
支持 3种 AK/SK 的设置方法。
vodService.setAccessKey("ak"); vodService.setSecretKey("sk");
VOLC_ACCESSKEY="ak" VOLC_SECRETKEY="sk"
在本地的 ~/.volc/config 中添加的内容如下所示。
{ "ak":"Your-AK", "sk":"Your-SK" }
package com.volcengine.example; import com.volcengine.helper.Const; import com.volcengine.service.vod.IVodService; import com.volcengine.service.vod.impl.VodServiceImpl; public class Demo { public static void main(String[] args) fdj{ IVodService vodService = VodServiceImpl.getInstance(Const.REGION_CN_NORTH_1); // call below method if you dont set ak and sk in ~/.volc/config vodService.setAccessKey("ak"); vodService.setSecretKey("sk"); // then call specific action }