我按照https://github.com/vimeo/vimeo-networking-java使用硬编码访问令牌(可以访问公共和私人视频)在Android上配置Vimeo 客户端(由该访问令牌初始化)。但VimeoClient.getInstance().fetchContent()的调用失败。
public void vimeoSettings(){
String urlPublic = "https://player.vimeo.com/video/496738949";
String urlPrivate = "https://player.vimeo.com/video/496739025";
Configuration.Builder confBuilder = new Configuration.Builder("ACCESS_TOKEN");
//later will generate in runtime and whats the validity?
Configuration configuration = confBuilder.build();
VimeoClient.initialize(configuration);
VimeoClient.getInstance().fetchContent(String.valueOf(Uri.parse(urlPublic)), CacheControl.FORCE_NETWORK, new ModelCallback<Video>(Video.class){
@Override
public void success(Video video) {
if(video != null){
Log.d("webviewactivity","inside vimeo settings - video not null ");
Play play = video.getPlay();
if (play != null) {
VideoFile dashFile = play.getDashVideoFile();
String dashLink = dashFile.getLink();
// load link
VideoFile hlsFile = play.getHlsVideoFile();
String hlsLink = hlsFile.getLink();
// load link
ArrayList<VideoFile> progressiveFiles = play.getProgressiveVideoFiles();
String linkToMp4File = progressiveFiles.get(0).getLink();
webView.load(linkToMp4File);
}
}
}
@Override
public void failure(VimeoError error) {
Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
面对这些错误:
E/cr_VariationsUtils: Failed reading seed file "/data/user/0/com.emergingit.emergingstudy/app_webview/variations_seed": /data/user/0/com.emergingit.emergingstudy/app_webview/variations_seed (No such file or directory)
E/chromium: [ERROR:gl_surface_egl.cc(335)] eglChooseConfig failed with error EGL_SUCCESS
这些错误表明了什么,即使我解决了这个问题,
- 这是在 Webview 中加载的正确方法,因为我必须将我的视频设为私有,并针对网站用例进行域限制?
- 我可以使用这种方法在https://github.com/ct7ct7ct7/Android-VimeoPlayer中播放吗?
我首先通过来自后端的令牌进行验证,然后给出 URL。之后使用访问令牌并配置 Vimeo 客户端,我需要加载视频。 对于这种适用于 android 的私人视频场景的Vimeo 官方文档对我来说似乎真的很不清楚,并且也联系了寻求帮助,但尽管我有一个付费帐户,但没有得到任何回应。
请帮助或建议..!!