0

I am trying to play video in Android. My widget is Kindle Fire so Android version is 2.3.4. Here is my code:

super.onCreate(savedInstanceState);
setContentView(R.layout.video);
Uri uri = Uri.parse(getIntent().getExtras().getString(VIDEO_URI));
MediaController mediaController = new MediaController(this);
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();

It shows dialog box with title

"Cannot play video"

and message

"An error occured while trying to play your video. The video may have been interrupted or is an unsupported format. Please try again."

4

1 回答 1

1

错误消息不言自明,VideoView 不支持视频格式

在此处检查支持的格式:http: //developer.android.com/guide/appendix/media-formats.html

您可以尝试使用视频转换器工具将视频转换为适当的格式。

于 2012-05-08T11:40:27.920 回答