Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Bring view to top - Android FIX #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/android/OpenTokAndroidPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.json.JSONObject;

import android.Manifest;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.content.pm.PackageManager;
import android.annotation.SuppressLint;
Expand Down Expand Up @@ -113,7 +114,11 @@ public void updateZIndices() {
// If the zIndex is 0(default) bring the view to the top, last one wins.
// See: https://github.com/saghul/cordova-plugin-iosrtc/blob/5b6a180b324c8c9bac533fa481a457b74183c740/src/PluginMediaStreamRenderer.swift#L191
if(viewContainer.getZIndex() == 0) {
viewContainer.mView.bringToFront();
if (viewContainer.mView instanceof GLSurfaceView) {
((GLSurfaceView) viewContainer.mView).setZOrderOnTop(true);
} else {
viewContainer.mView.bringToFront();
}
}
}
}
Expand Down Expand Up @@ -1090,4 +1095,4 @@ public void onStreamVideoTypeChanged(Session arg0, Stream arg1,
// TODO Auto-generated method stub

}
}
}