2016-10-03 50 views
-2

我正在使用來自here的Gary示例。Android libVLC - 文件路徑而不是URL錯誤

唯一的修改是,我打開一個本地視頻這樣的:

mMediaUrl = "/storage/emulated/0/MyFolder/20161003_1217.mp4"; 

,我得到以下錯誤:

10-03 12:54:13.588 16681-17397/windylabs.com.vlcplayersample E/VLC-std: Warning: input_item_SetURI("/storage/emulated/0/MyFolder/20161003_1217.mp4"): file path instead of URL. 
10-03 12:54:13.588 16681-17397/windylabs.com.vlcplayersample E/VLC-std: input_SplitMRL("/storage/emulated/0/MyFolder/20161003_1217.mp4") probably not a valid URI! 
10-03 12:54:15.718 16681-17399/windylabs.com.vlcplayersample E/VLC: [dece4214] core input: open of `/storage/emulated/0/MyFolder/20161003_1217.mp4' failed 
10-03 12:54:15.728 16681-17399/windylabs.com.vlcplayersample E/VLC: [dece4214] core input: Your input can't be opened 
10-03 12:54:15.728 16681-17399/windylabs.com.vlcplayersample E/VLC: [dece4214] core input: VLC is unable to open the MRL '/storage/emulated/0/MyFolder/20161003_1217.mp4'. Check the log for details. 

我不知道從哪裏上的錯誤指定的日誌是。這個例子中,來自here的視頻流正在運行,但是我的SD卡上的視頻未播放!

回答

0

我已經找到了解決方案,可能會幫助某人,某個時候。

你需要下載的文件是這樣的:

mMediaUrl = Uri.fromFile(pathToMediaFile).toString(); 
0

試試這個

mMediaUrl = "/sdcard/MyFolder/20161003_1217.mp4"; 

或在清單檢查READ_EXTERNAL_STORAGE許可。

+0

感謝您的回答,但這個工作沒有人! – hackingforgirls