开发者社区> 问答> 正文

阿里云视频点播-报错问题,请帮忙解答 报错如图

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() + "\n"); VideoMeta meta = getVideoPlayAuthResponse.getVideoMeta(); // VideoMeta信息 log.info("VideoMeta.Title = " + meta.getTitle() + "\n"); return meta.getDuration();

    } catch (Exception e) {
        log.error("[VodController.getVideoPlayAuth] 阿里云视频-获取播放凭证异常", e);
    }
    return (float) 0.0;

3f8790854f22acf441cbc908a9b650c.png

展开
收起
1138865711161311 2022-01-06 16:04:45 764 0
1 条回答
写回答
取消 提交回答
  • 十分耕耘,一定会有一分收获!

    楼主你好,根据错误信息,报错为"GetVideoPlayAuthRequest未初始化",这意味着你没有正确地实例化GetVideoPlayAuthRequest对象或者没有设置videoId属性。

    请确保以下几点:

    1. 确保已正确导入相关的类和依赖项。
    2. 确保getVideoPlayAuthRequest对象已经被正确创建,例如:GetVideoPlayAuthRequest getVideoPlayAuthRequest = new GetVideoPlayAuthRequest();
    3. 确保videoId属性已经被正确设置,例如:getVideoPlayAuthRequest.setVideoId(videoId)。

    如果以上步骤都正确无误,仍然出现报错,请检查你的业务逻辑是否正确,并尝试查找更详细的错误日志或异常堆栈跟踪,以进一步定位问题。

    2023-07-09 22:00:02
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
互联网音视频点播业务云上实践 立即下载
《VoD问题排查与实战手册》 立即下载
DataWorks V2新版本功能揭秘 立即下载

相关实验场景

更多