GetVideoPlayAuthRequest getVideoPlayAuthRequest = new GetVideoPlayAuthRequest(); GetVideoPlayAuthResponse getVideoPlayAuthResponse = new GetVideoPlayAuthResponse(); getVideoPlayAuthRequest.setVideoId(videoId); try { DefaultAcsClient client = getDefaultAcsClient(); getVideoPlayAuthResponse = VodUtil.getVideoPlayAuth(client, getVideoPlayAuthRequest); // 播放凭证 log.info(“PlayAuth = ” + getVideoPlayAuthResponse.getPlayAuth() + ”
“); VideoMeta meta = getVideoPlayAuthResponse.getVideoMeta(); // VideoMeta信息 log.info(“VideoMeta.Title = ” + meta.getTitle() + ”
“); return meta.getDuration();
} catch (Exception e) {
log.error("[VodController.getVideoPlayAuth] 阿里云视频-获取播放凭证异常", e);
}
return (float) 0.0;