Skip to content

Commit

Permalink
Merge branch 'master' into dev/3.2.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	Annotations.java
#	BeanCovertor.kt
#	RtcChannel.kt
#	RtcEngine.kt
#	RtcSurfaceView.kt
#	RtcTextureView.kt
  • Loading branch information
LichKing-2234 committed Dec 17, 2020
2 parents 2fef3ae + 313cddd commit ddeaefb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
10 changes: 10 additions & 0 deletions RtcSurfaceView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class RtcSurfaceView(
) : FrameLayout(context) {
private var surface: SurfaceView
private var canvas: VideoCanvas
private var isMediaOverlay = false
private var onTop = false
private var channel: WeakReference<RtcChannel>? = null

init {
Expand All @@ -26,6 +28,7 @@ class RtcSurfaceView(
}

fun setZOrderMediaOverlay(isMediaOverlay: Boolean) {
this.isMediaOverlay = isMediaOverlay
try {
removeView(surface)
surface.setZOrderMediaOverlay(isMediaOverlay)
Expand All @@ -36,6 +39,7 @@ class RtcSurfaceView(
}

fun setZOrderOnTop(onTop: Boolean) {
this.onTop = onTop
try {
removeView(surface)
surface.setZOrderOnTop(onTop)
Expand All @@ -62,6 +66,12 @@ class RtcSurfaceView(
}

private fun setupVideoCanvas(engine: RtcEngine) {
removeAllViews()
surface = RtcEngine.CreateRendererView(context.applicationContext)
surface.setZOrderMediaOverlay(isMediaOverlay)
surface.setZOrderOnTop(onTop)
addView(surface)
canvas.view = surface
if (canvas.uid == 0) {
engine.setupLocalVideo(canvas)
} else {
Expand Down
4 changes: 4 additions & 0 deletions RtcTextureView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class RtcTextureView(
}

private fun setupVideoCanvas(engine: RtcEngine) {
removeAllViews()
texture = RtcEngine.CreateTextureView(context.applicationContext)
addView(texture)
canvas.view = texture
if (canvas.uid == 0) {
engine.setupLocalVideo(canvas)
} else {
Expand Down

0 comments on commit ddeaefb

Please sign in to comment.