0
我必須選擇在選配意圖視頻或圖像這樣得到onActivityResult
Intent getIntent = new Intent(Intent.ACTION_GET_CONTENT);
getIntent.setType("image/* video/*");
Intent pickIntent = new Intent(Intent.ACTION_PICK);
pickIntent.setType("image/* video/*");
Intent chooserIntent = Intent.createChooser(getIntent, "Select Media");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] {pickIntent});
startActivityForResult(chooserIntent, 1);
然後我想選擇的文件的元數據onActivityResult()
一樣的高度和寬度以及視頻的長度和媒體元數據大小
它不會得到這個錯誤 'java.lang.RuntimeException:傳遞結果失敗ResultInfo {who = null,request = 1,result = -1,data = Intent {dat = content:// media/external/images/media/57}} to activity {com.ts.tkllm/com.ts.tkllm.Chat}:java.lang.RuntimeException:setDataSource failed:status = 0x80000000' –
您是否提供了正確的數據文件路徑,通過onActivityResult()? –
感謝您爲視頻 工作,我用drewnoakes:metadata-extractor:2.10.1爲圖像 –