我在Samsung Galaxy S上播放我的視頻時遇到了問題。如果播放的是SD卡,但是當我上傳到服務器,然後發送它給我的網址時,播放狀態良好「對不起,此視頻無法播放玩過」。這是一個.mp4視頻,我使用Sothink視頻轉換器將其轉換爲android格式。對不起,該視頻無法播放! Error/PlayerDriver
這是我的VideoView代碼:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(ArrayAdapter.createFromResource(getApplicationContext(),
R.array.lecturehalls,R.layout.list_item));
final String[] links = getResources().getStringArray(R.array.vid_links);
getListView().setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
String content = links[position];
Intent showContent = new Intent(getApplicationContext(),
VideoOutput.class);
showContent.setData(Uri.parse(content));
startActivity(showContent);
}
});
}
注:URL路徑存儲在strings.xml中 數組當我使用這個鏈接它工作正常:http://www.pocketjourney.com/downloads/pj/video/famous.3gp 我的鏈接能正常工作,以及我測試它在我的電腦上,但是在電話上它不起作用!
這就是我得到:
12-14 02:11:01.621: ERROR/PlayerDriver(1287): Command PLAYER_INIT completed with an error or info PVMFFailure
編輯: VideoOutput類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videoview);
MediaController mediaController = new MediaController(this);
VideoView videoView = (VideoView) findViewById(R.id.video);
Intent launchingIntent = getIntent();
String content = launchingIntent.getData().toString();
mediaController.setMediaPlayer(videoView);
videoView.setVideoPath(content);
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.start();
mediaController.show();
}
我嘗試了許多不同的轉換器,但我仍然嘗試使用手剎改變編解碼器的設置,現在我得到這個錯誤是一樣的:「對不起,這個視頻是無效在此設備上」 ..我有一個以上的視頻和我需要從服務器播放它們不是SD – ukama 2011-12-14 17:54:14