桌面推流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() mediaProjectionManager.createScreenCaptureIntent()
) { resultCode, data -> ) { resultCode, data ->
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
ContextCompat.startForegroundService(context, Intent(context, ScreenShareService::class.java)) ContextCompat.startForegroundService(context, Intent(context, ScreenShareService::class.java))
val screenCapturerAndroid = val screenCapturerAndroid =
ScreenCapturerAndroid(data, object : MediaProjection.Callback() { ScreenCapturerAndroid(data, object : MediaProjection.Callback() {
}) })
peerConnectionClient?.createPeerConnection(screenCapturerAndroid, localHandleId) peerConnectionClient?.createPeerConnection(screenCapturerAndroid, localHandleId)
peerConnectionClient?.createOffer(localHandleId) peerConnectionClient?.createOffer(localHandleId)
} }
} }