opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
211 stars 169 forks source link

SubscriberViewContaine Is Gone when PublisherViewContainer is match_parent (FullScreen) #115

Closed ateek closed 7 years ago

ateek commented 7 years ago

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:keepScreenOn="true" android:paddingBottom="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingTop="16dp">

<FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <FrameLayout
        android:id="@+id/publisherview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    </FrameLayout>

    <FrameLayout
        android:id="@+id/subscriberview"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_gravity="bottom|end"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="16dp"
        android:background="@color/grey_3"
        android:padding="16dp"/>
</FrameLayout>

ateek commented 7 years ago

device-2017-05-02-145301

ateek commented 7 years ago

I fixed this by doing that GLSurfaceView subscriberView = (GLSurfaceView) subscriber.getView(); subscriberView.setZOrderMediaOverlay(true); subscriberView.setZOrderOnTop(true);

robjperez commented 7 years ago

Due to the behaviour of GLSurfaceViews you need to explicitly set the order of each view,

Like you have already pointed out, the solution is to do something similar to this: https://github.com/opentok/opentok-android-sdk-samples/blob/master/OpenTokSamples/1.Hello-World/src/main/java/com/opentok/android/samples/hello_world/MainActivity.java#L162

mstar0125 commented 7 years ago

Hi @robjperez Your url is not working. Could you please explain again?