生のフォルダからすべてのビデオを読み込み、mediaplayrで表示します。これはコードに続いて使用しますが、Exceptionを取得します。なにが問題ですか? おかげrawからすべてのビデオを読み込み、メディアプレーヤーで表示
あなたはString UrlPath="android.resource://"+getPackageName()+"/"+R.raw.ur_file_name;
videocontainer.setVideoURI(Uri.parse(UrlPath));
videocontainer.start();
コードはここから司教Fakhryから取られたこの機能を使用して、生のビデオを再生することができ
String filePath = "android.resource://" + this.getPackageName() + "/raw/";
ContentResolver resolver=getContentResolver();
String projection[]= {MediaStore.Video.Media._ID,MediaStore.Video.Media.DISPLAY_NAME,MediaStore.Video.Media.DURATION};
Cursor cursor= resolver.query(MediaStore.Video.Media.INTERNAL_CONTENT_URI ,projection, MediaStore.MediaColumns.DATA+ "='"+filePath+"'", null, null);
videoDetails=new ArrayList<VideoInfo>();
while(cursor.moveToNext())
{
int id=cursor.getInt(0);
String title=cursor.getString(1);
int dur=cursor.getInt(2);
videoDetails.add(new VideoInfo(id,title,dur));
}
可能な重複[アンドロイドで動画を再生する方法資産フォルダまたは生のフォルダから?](http://stackoverflow.com/questions/3028717/how-to-play-videos-in-android-from-assets-folder-or-raw-folder) –