title: WilddogVideoViewLayout

视频流展示控件容器,继承Android.ViewGroup。 使用时将 WilddogVideoView 包裹在 WilddogVideoViewLayout 中,可以实现多窗口显示多个视频流功能。

示例

在Activity的布局文件中:

  1. <RelativeLayout
  2. android:id="@+id/views"
  3. android:layout_width="match_parent"
  4. android:layout_height="320dp">
  5. <com.wilddog.video.WilddogVideoViewLayout
  6. android:id="@+id/local_video_layout"
  7. android:layout_width="match_parent"
  8. android:layout_height="match_parent">
  9. <com.wilddog.video.WilddogVideoView
  10. android:id="@+id/local_video_view"
  11. android:layout_width="wrap_content"
  12. android:layout_height="wrap_content"/>
  13. </com.wilddog.video.WilddogVideoViewLayout>
  14. </RelativeLayout>

方法

setPosition(int,int,int,int)

定义

  1. public void setPosition(int xPercent, int yPercent, int widthPercent, int heightPercent)

说明

设置控件的位置与大小。

参数

参数名 描述
xPercent 控件左上角横坐标起始位置,数值为 1-100 的正整数,代表起始位置与父控件宽度的百分比
yPercent 控件左上角纵标起始位置,数值为 1-100 的正整数,代表起始位置与父控件高度的百分比
widthPercent 控件宽度,数值为 1-100 的正整数,代表宽度与父控件宽度的百分比
heightPercent 控件高度,数值为 1-100 的正整数,代表高度与父控件高度百分比

示例

  1. //父控件左上角为原点,设置控件的位置起始坐标为(0,0),控件宽占父控件的50%,高占父控件50%
  2. localRenderLayout.setPosition(0,0, 50, 50);