3
我想播放mp4 videoin我简单的android videoview。这里是我的代码在Android视频播放mp4文件
VideoView videoView;
videoView = (VideoView) findViewById(R.id.videoViewa);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
//URI either from net
Uri video = Uri.parse("http://www.fieldandrurallife.tv/videos/Benltey%20Mulsanne.mp4");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
我的布局看起来像
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<VideoView
android:id="@+id/videoViewa"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="match_parent" />
</RelativeLayout>
清单看起来像
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
我收到的时候我尝试启动应用程序
Couldn't open file on client side, trying server side
error (1, -1004)
以下错误
有没有人脸d一样吗?
请帮助 在此先感谢
固定!!!对于有同样问题的人请注意,Android将只播放H.264压缩视频。一旦我尝试使用上述视频,问题就解决了 – ramesh