|
我下载了官方的demo,然后我改了下布局,把其中的一段代码注视了,本想达到我想要的效果,但是结果只能看到对方的视频,看不到自己的
//改之后的布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/chat_bk"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/layout_buttom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal" >
<ProgressBar
android:id="@+id/progress_remote"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="60dip"
android:layout_height="5dip"
android:max="100" />
<Button
android:id="@+id/End"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="结束通话" />
<ImageView
android:id="@+id/image_switch_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@drawable/btn_switchvideo_background"
android:src="@drawable/switchvideo"
android:visibility="visible" />
<ProgressBar
android:id="@+id/progress_local"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="50dip"
android:layout_height="5dip"
android:layout_below="@+id/layout_local"
android:max="100" />
</LinearLayout>
<SurfaceView
android:id="@+id/surface_local"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
<SurfaceView
android:id="@+id/surface_remote"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/layout_buttom" />
</RelativeLayout>
//注释了在VideoActivity中的这个方法 adjuestVideoSize
// private void adjuestVideoSize(int width, int height) {
//
// if (3 * width > 4 * height) {
//
// dwRemoteVideoHeight = height;
// dwRemoteVideoWidth = (int) (4.0 / 3.0 * dwRemoteVideoHeight);
// } else {
// dwRemoteVideoWidth = width;
// dwRemoteVideoHeight = (int) (3.0 / 4.0 * dwRemoteVideoWidth);
// }
// dwLocalVideoWidth = dwRemoteVideoWidth;
// dwLocalVideoHeight = dwRemoteVideoHeight;
// FrameLayout.LayoutParams layoutPramOther=new FrameLayout.LayoutParams(500, 500);
// FrameLayout.LayoutParams layoutParamSelf=new FrameLayout.LayoutParams(350, 220);
// otherView.setLayoutParams(layoutPramOther);
// myView.setLayoutParams(layoutParamSelf);
//
// }
|
|