我在安卓视频播放中遇到问题。从服务器制作视频并设置为videoview,但视频在后台播放中无法看到视频,请参阅我的代码我尝试过的内容。如何设置android视频宽度和高度
XML文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<VideoView
android:id="@+id/eventDetailsPage_videosView"
android:layout_width="160dp"
android:layout_height="100dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/ic_eventvideo_image" />
</LinearLayout>
的Java类
Uri uri=Uri.parse(mEventDetailsUtil1.getAttachmentsUrls().get(0).getAttach_url());
VideoView mVideosView = (VideoView) findViewById(R.id.eventDetailsPage_videosView);
MediaController mc = new MediaController(this);
mc.setAnchorView(mVideosView);
mc.setMediaPlayer(mVideosView);
mVideosView.setMediaController(mc);
mVideosView.setVideoURI(uri);
mVideosView.requestFocus();
mVideosView.start();
视频是打开活动时玩,但我不想这样,我需要当我在VideoView点击我需要打开视频全屏。
谢谢@Siddharth维亚斯我会尝试 – venu
@Ydder这可能会有所帮助http://www.edumobile.org/android/android-beginner-tutorials/how-to-play-a-video-file/ –