diff --git a/Callback.kt b/Callback.kt index d2dd152c1..0d9b69378 100644 --- a/Callback.kt +++ b/Callback.kt @@ -5,7 +5,7 @@ import io.agora.rtc.RtcEngine import kotlin.math.abs abstract class Callback { - fun code(code: Int?, runnable: ((Int) -> Any?)? = null) { + fun code(code: Int?, runnable: ((Int?) -> Any?)? = null) { if (code == null || code < 0) { val newCode = abs(code ?: Constants.ERR_NOT_INITIALIZED) failure(newCode.toString(), RtcEngine.getErrorDescription(newCode)) diff --git a/MediaObserver.kt b/MediaObserver.kt index 1983ecfc4..fef7214f1 100644 --- a/MediaObserver.kt +++ b/MediaObserver.kt @@ -32,9 +32,7 @@ class MediaObserver( override fun onMetadataReceived(buffer: ByteArray, uid: Int, timeStampMs: Long) { emit(hashMapOf( - "buffer" to String(buffer), - "uid" to uid, - "timeStampMs" to timeStampMs + "data" to arrayListOf(String(buffer), uid, timeStampMs) )) } } diff --git a/RtcSurfaceView.kt b/RtcSurfaceView.kt index ba2a292ef..536f7ddaf 100644 --- a/RtcSurfaceView.kt +++ b/RtcSurfaceView.kt @@ -71,6 +71,7 @@ class RtcSurfaceView( surface.setZOrderMediaOverlay(isMediaOverlay) surface.setZOrderOnTop(onTop) addView(surface) + surface.layout(0, 0, width, height) canvas.view = surface if (canvas.uid == 0) { engine.setupLocalVideo(canvas) diff --git a/RtcTextureView.kt b/RtcTextureView.kt index 7dfc4f28e..2ebecae67 100644 --- a/RtcTextureView.kt +++ b/RtcTextureView.kt @@ -45,6 +45,7 @@ class RtcTextureView( removeAllViews() texture = RtcEngine.CreateTextureView(context.applicationContext) addView(texture) + texture.layout(0, 0, width, height) canvas.view = texture if (canvas.uid == 0) { engine.setupLocalVideo(canvas)