当视频流加载到约束layou中时,它会隐藏相对布局视图,从而在Android中发布我自己的相机?

马赫什

我正在创建需要通过实时视频通话进行通信的应用。为此,我使用了(https://tokbox.com/developer/sdks/android/)Tokbox API(Vonage API)。右下角的相机是我的相机。全屏摄像头就是对手摄像头。

问题:当我在android 8操作系统版本中运行该应用程序时。效果很好,可以同时显示两个视频。当我在android 10操作系统版本中运行该应用程序时,当对手进行视频通话时,它会隐藏我自己的下角视频。

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorWhite">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/mPublisherViewContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <ImageView
            android:id="@+id/imgNoAttendees"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/_10sdp"
            android:src="@drawable/no_participant"
            app:layout_constraintBottom_toTopOf="@+id/txtWaitAttendees" />

        <com.app.readyb.customview.textview.CustomTextAxiReg
            android:id="@+id/txtWaitAttendees"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:textColor="@color/colorBlack"
            android:textSize="@dimen/_12ssp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/imgNoAttendees"
            app:layout_constraintTop_toTopOf="parent" />

        <RelativeLayout
            android:id="@+id/relativeVideo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <RelativeLayout
        android:id="@+id/relPublisherView"
        android:layout_width="@dimen/_100sdp"
        android:layout_height="@dimen/_130sdp"
        android:layout_gravity="end|bottom"
        android:layout_marginBottom="@dimen/_15sdp"
        android:padding="@dimen/_10sdp" />

    <include layout="@layout/cm_bottom_sheet_persistent" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

Android OS 8屏幕截图

Android OS 8

Android OS 10屏幕截图

Android OS 10 Android OS 10

马赫什

抱歉,我不想回答自己的问题,但我想这样做,因为它将对其他开发人员有所帮助。

在会话连接后,我需要添加这一行。

if (mPublisher.getView() instanceof GLSurfaceView) {
            ((GLSurfaceView) mPublisher.getView()).setZOrderOnTop(true);
        }

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档