桌面推流ok

This commit is contained in:
li 2024-05-30 16:38:23 +08:00
parent ff8769f4ac
commit bebeee07d3

View File

@ -163,17 +163,13 @@ class ZLMRTCPusherImpl(val context: FragmentActivity) : ZLMRTCPusher(),
mediaProjectionManager.createScreenCaptureIntent()
) { resultCode, data ->
if (resultCode == Activity.RESULT_OK) {
ContextCompat.startForegroundService(context, Intent(context, ScreenShareService::class.java))
val screenCapturerAndroid =
ScreenCapturerAndroid(data, object : MediaProjection.Callback() {
})
peerConnectionClient?.createPeerConnection(screenCapturerAndroid, localHandleId)
peerConnectionClient?.createOffer(localHandleId)
}
}