初始化视频首次加载的时间
This commit is contained in:
@@ -6,9 +6,11 @@ import com.aliyun.vod20170321.Client;
|
||||
import com.aliyun.vod20170321.models.GetVideoPlayAuthRequest;
|
||||
import com.aliyun.vod20170321.models.GetVideoPlayAuthResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class SpdbUtil {
|
||||
|
||||
public static String getPlayAuth(String vid) throws Exception {
|
||||
public static GetVideoPlayAuthResponse getPlayAuth(String vid) throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
|
||||
.setAccessKeyId("LTAI5tMKmWhPfnPsz2J3bfxL")
|
||||
@@ -22,14 +24,15 @@ public class SpdbUtil {
|
||||
try {
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
GetVideoPlayAuthResponse videoPlayAuthWithOptions = client.getVideoPlayAuthWithOptions(getVideoPlayAuthRequest, runtimeOptions);
|
||||
return videoPlayAuthWithOptions.getBody().getPlayAuth();
|
||||
return videoPlayAuthWithOptions;
|
||||
// return videoPlayAuthWithOptions.getBody().getPlayAuth();
|
||||
} catch (TeaException error) {
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
System.out.println(error.getMessage());
|
||||
// 诊断地址
|
||||
System.out.println(error.getData().get("Recommend"));
|
||||
return "error";
|
||||
return null;
|
||||
|
||||
} catch (Exception _error) {
|
||||
TeaException error = new TeaException(_error.getMessage(), _error);
|
||||
@@ -38,7 +41,7 @@ public class SpdbUtil {
|
||||
System.out.println(error.getMessage());
|
||||
// 诊断地址
|
||||
System.out.println(error.getData().get("Recommend"));
|
||||
return "error";
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user