Я хочу воспроизвести видео с URL-адреса с помощью Vuforia Android Native API.
Я изменил код в примере VideoPlayback, как показано ниже:
VideoPlayback.java
Video from Url
mMovieName[STONES] = "..Youtube Video link..";
mMovieName[CHIPS] = "..Youtube Video link..";
mMovieName[celebVM_LOGO] = "..Youtube Video link..";
Я удалил некоторый код из VideoPlayerHelper.java, как показано ниже:
for Video from Url, in Load method
AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(), afd.getLength());
afd.close();
Добавлен:
mMediaPlayer.setDataSource(filename);
И удаление кода
try {
AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
afd.close();
} catch (Exception e) {
Log.d(LOGTAG, "File does not exist");
mCurrentState = MEDIA_STATE.ERROR;
mMediaPlayerLock.unlock();
mSurfaceTextureLock.unlock();
return false;
}
Не работает, может кто подскажет почему? Пожалуйста, перейдите по этой ссылке для получения дополнительной информации: https://developer.vuforia.com/forum/android/how-work-video-url-videoplayback