2016-05-16 54 views
8

几天来,我在quickblox.i上工作,让我的视图下方保留着对象视图。 enter image description hereQuickBlox WebRtc VideoChat Android

它工作正常,但当我保持像Skype的意见: - 对手视图是在全屏幕上,我的观点是在对手视图的右上角它呈现只有一个视图,最后呈现。 我看quickblox webrtc在quickblox网站上给出的示例。我看到了该示例中的代码,但它包含会议讨论给出了一些复杂的循环视图编码对我来说单一对一的谈话是必需的任何人都可以告诉我最好的方法来保持一个webrtc视图高于另一个以完美的方式工作任何一个人都可以告诉我如何将一个webrtc放在另一个之上。

+0

我不明白你的问题。你能详细解释一下吗? – Rajesh

+0

你可以在截图中看到。目前我的看法是这样的,但我想要一个像Skype这样的视图,大视图是对手用户视图,我希望全屏显示该视图,右上角的小视图是我的视图,我希望视图在右上方的对手视图上方我试图把,但只有最后渲染视图是显示。 – santoXme

回答

2

在我的理解QuickBlox正在处理基于WebRTC协议的基于视频聊天的聊天室。他们正在管理房间ID,任何人都可以加入视频。我们可以用我们自己的想法创建一对一的会议。 在布局的情况下,我们可以用我们自己的方式修改布局。请检查我的布局实施和它的工作适合我。

<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" 
    tools:context=".MainActivity"> 

    <RelativeLayout 
     android:id="@+id/rl_video_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <ImageView 
      android:id="@+id/iv_hang_up_icon" 
      android:layout_width="@dimen/app_video_screen_icon_width_height" 
      android:layout_height="@dimen/app_video_screen_icon_width_height" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentTop="true" 
      android:layout_marginRight="@dimen/activity_horizontal_margin" 
      android:layout_marginTop="@dimen/activity_horizontal_margin" 
      android:background="@mipmap/hung_up" /> 

     <android.support.v4.view.ViewPager 
      android:id="@+id/pager" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:visibility="gone" 
      android:layout_gravity="top"> 

      <android.support.v4.view.PagerTitleStrip 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="top" 
       android:background="@color/app_text_icon_color" /> 

     </android.support.v4.view.ViewPager> 

     <RelativeLayout 
      android:id="@+id/preview" 
      android:layout_width="100dp" 
      android:layout_height="100dp" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentRight="true" 
      android:layout_margin="@dimen/app_common_five_dp_padding" /> 
    </RelativeLayout> 

    <RelativeLayout 
     android:id="@+id/rl_patient_info_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@android:color/transparent" 
     android:gravity="bottom"> 

     <LinearLayout 
      android:id="@+id/ll_patient_details_container" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="@dimen/app_common_five_dp_padding" 
      android:orientation="vertical"> 

      <com.adoctortalk.android.utilities.CustomTxtViewBold 
       android:id="@+id/tv_patient_name" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="@dimen/app_common_five_dp_padding" 
       android:layout_marginLeft="@dimen/app_common_ten_dp_padding" 
       android:layout_marginTop="@dimen/app_common_five_dp_padding" 
       android:text="New Text" 
       android:textColor="@color/app_text_icon_color" 
       android:textSize="@dimen/application_font_size_very_large" /> 

      <com.adoctortalk.android.utilities.CustomTxtViewBold 
       android:id="@+id/tv_patient_sub_info" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="@dimen/app_common_five_dp_padding" 
       android:layout_marginLeft="@dimen/app_common_ten_dp_padding" 
       android:layout_marginTop="@dimen/app_common_five_dp_padding" 
       android:text="New Text" 
       android:textColor="@color/app_text_icon_color" 
       android:textSize="@dimen/application_font_size_large" /> 

      <LinearLayout 
       android:id="@+id/ll_patient_action_cotainer" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_marginBottom="@dimen/app_common_five_dp_padding" 
       android:layout_margin="@dimen/app_common_five_dp_padding" 
       android:orientation="horizontal" 
       android:visibility="visible"> 

       <ImageView 
        android:id="@+id/iv_profile_icon" 
        android:layout_width="@dimen/app_video_screen_icon_width_height" 
        android:layout_height="@dimen/app_video_screen_icon_width_height" 
        android:layout_marginRight="@dimen/app_common_five_dp_padding" 
        android:background="@mipmap/profile" /> 

       <ImageView 
        android:id="@+id/iv_medical_notes_icon" 
        android:layout_width="@dimen/app_video_screen_icon_width_height" 
        android:layout_height="@dimen/app_video_screen_icon_width_height" 
        android:layout_marginLeft="@dimen/app_common_five_dp_padding" 
        android:layout_marginRight="@dimen/app_common_five_dp_padding" 
        android:background="@mipmap/medical_notes" /> 

       <ImageView 
        android:id="@+id/iv_prescription_icon" 
        android:layout_width="@dimen/app_video_screen_icon_width_height" 
        android:layout_height="@dimen/app_video_screen_icon_width_height" 
        android:layout_marginLeft="@dimen/app_common_five_dp_padding" 
        android:layout_marginRight="@dimen/app_common_five_dp_padding" 
        android:background="@mipmap/prescription" /> 

       <ImageView 
        android:id="@+id/iv_attachment_icon" 
        android:layout_width="@dimen/app_video_screen_icon_width_height" 
        android:layout_height="@dimen/app_video_screen_icon_width_height" 
        android:layout_marginLeft="@dimen/app_common_five_dp_padding" 
        android:layout_marginRight="@dimen/app_common_five_dp_padding" 
        android:background="@mipmap/attachments" /> 
      </LinearLayout> 
     </LinearLayout> 

     <RelativeLayout 
      android:id="@+id/rl_video_fragmnet_container" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@+id/ll_patient_details_container" 
      android:visibility="gone"></RelativeLayout> 
    </RelativeLayout> 

</RelativeLayout>