vuforia AR SDK - 无法通过网址播放视频

问题描述 投票:4回答:1

我正在尝试使用Vuforia增强现实SDK及其样本。我成功编译了videopayback样本并在我的平板电脑上运行它。然后我尝试从网址而不是从设备加载视频。按照示例代码中的注释,在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();

并对此部分进行了评论,并在线添加了一个网址:

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);
java android sdk augmented-reality vuforia
1个回答
0
投票

在完成问题中提到的那些更改后,我遇到了同样的问题。但是,在VideoPlayerHelper.java中,我只是评论了AssetFileDescriptor代码(3行)

//AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
//mMediaPlayer.setDataSource(afd.getFileDescriptor(),  afd.getStartOffset(),afd.getLength());
//afd.close();

并取消注释/更改以下行mMediaPlayer.setDataSource(“http://giftsoninternet.com/android/EngageApp/VuforiaSizzleReel_1.m4v”);

我通过在VideoPlayback.java文件中注释一行来纠正此问题,其中视频播放器正在尝试从assets / VideoPlayback文件夹访问视频。

// mMovieName[STONES] = "VideoPlayback/VuforiaSizzleReel_1.mp4";

附: - 我只评论了这一行,因为我只使用STONES.jpg目标图像进行Vuforia渲染。如果您正在使用CHIPS,则可以注释该行。

© www.soinside.com 2019 - 2024. All rights reserved.