【发布时间】:2017-08-05 08:09:12
【问题描述】:
我只想进行视频通话布局,但我遇到了这个问题 我想在 SurfaceView 上添加一些 imageView 和按钮,用于切换摄像头、静音、结束通话和一些信息,这是我的 xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<org.webrtc.SurfaceViewRenderer
android:id="@+id/preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/rind"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- here my ImageView and button -->
</LinearLayout>
</RelativeLayout>
SurfaceViewRenderer 扩展surfaceView
现在,当我运行此程序时,我在 surfaceView 中看不到我的相机,我为 SurfaceViewRenderer 添加了红色背景,它出现时没有我的相机显示但我看不到我的观点(静音,结束通话......)
我也试试
mySurfaceView.setZOrderMediaOverlay(true);
mySurfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT);
没有影响
我只想做这样的布局
在我使用surfaceView 之前,我尝试过glsurfaceview,但它是一样的,我读到我在 glsurfaceview 中做不到(在 glsurfaceview 上添加视图)
【问题讨论】:
标签: android surfaceview