我正在尝试使用Vuforia增强现实SDK及其样例。我已经成功编译了videopayback示例并在我的平板电脑上运行它。然后我尝试从url加载视频而不是从设备加载。根据示例代码中的注释,在VideoPlayerHelper.java中我注释掉了这部分:
// This example shows how to load the movie from the
// assets folder of the app
// However, if you would like to load the movie from the
// sdcard or from a network location
// simply comment the three lines below
AssetFileDescriptor afd = mParentActivity.getAssets()
.openFd(filename);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(), afd.getLength());
afd.close();
并评论了这部分,并添加了一个指向在线视频文件的URL:
mMediaPlayer.setDataSource("http://oneshot.qualcomm.com/webAR/content/strawberryfields_H264_AAC.mp4");
我仍然可以成功编译,但是当我把相机对准触发图像时,要么看到一个十字形标记,要么看到沙漏,似乎意味着正在加载视频,但是没有任何反应。你有什么其他建议来解决这个问题吗?我在Vuforia论坛上查找了一些解决方案,大多数都建议正确选择视频(我使用的是那里建议的视频),做一些基本操作。比如:
Uri videolink = Uri.parse("http://oneshot.qualcomm.com/webAR/content/strawberryfields_H264_AAC.mp4");
mMediaPlayer.setDataSource(mParentActivity,videolink);