triniwiz / nativescript-webrtc

Apache License 2.0
42 stars 25 forks source link

iOS screen share is not working on background #16

Open ahmetceylan opened 5 years ago

ahmetceylan commented 5 years ago

Which platform(s) does your issue occur on?

Please, tell us how to recreate the issue in as much detail as possible.

Start screen share with TNSRTCMediaDevices.getDisplayMedia function then press home button to send the application to background. you will see that screen sharing is paused when the application is on background. SS continues when the app comes to foreground again.

here is the short log regarding this issue

RPDaemonProxy: connection: handleInvocation: did not recieve reply for invocation RPDaemonProxy: captureHandlerWithSample: RPDaemonProxy: connection: handleInvocation: RPDaemonProxy: connection: handleInvocation: did not recieve reply for invocation RPDaemonProxy: captureHandlerWithAudioSample: RPBroadcastSampleHandler: broadcast extension recieved audio payload from replayd RPDaemonProxy: connection: handleInvocation: RPDaemonProxy: connection: handleInvocation: did not recieve reply for invocation RPDaemonProxy: captureHandlerWithSample: RPDaemonProxy: pauseRecording RPDaemonProxy: clientDidResignActiveWithBundleID [FBSDisplaySource 2-2] KVO: did change connectionSeed [FBSDisplaySource 2-2] KVO: did change uniqueId [FBSDisplaySource 2-2] KVO: did change availableModes [FBSDisplaySource 2-2] KVO: did change currentMode [FBSDisplaySource 2-2] KVO: did change preferredMode [FBSDisplaySource 2-2] KVO: did change bounds [FBSDisplaySource 2-2] KVO: did change frame [FBSDisplaySource 2-2] KVO: did change cloningSupported [FBSDisplaySource 2-2] KVO: did change tag Task <89AFF847-5A18-4F1E-B6D1-67C3FC5EEE85>.<1> resuming, QOS(0x9) Task <89AFF847-5A18-4F1E-B6D1-67C3FC5EEE85>.<1> {strength 1, tls 8, ct 0, sub 0, sig 0, ciphers 1, bundle 0, builtin 0} TIC Enabling TLS [12:0x2825f8900] TIC TCP Conn Start [12:0x2825f8900] [C12 Hostname#6067e03f:443 tcp, url hash: 6f2f5351, tls] start nw_connection_report_state_with_handler_locked [C12] reporting state preparing Task <89AFF847-5A18-4F1E-B6D1-67C3FC5EEE85>.<1> setting up Connection 12 nw_endpoint_flow_protocol_connected [C12.1 IPv4#e5edded0:443 in_progress channel-flow (satisfied)] Transport protocol connected TIC TLS Event [12:0x2825f8900]: 1, Pending(0) TIC TLS Event [12:0x2825f8900]: 11, Pending(0) TIC TLS Event [12:0x2825f8900]: 14, Pending(0) System Trust Evaluation yielded status(0)

RobinKamps commented 4 years ago

it might be posible with replayKit2 Broadcast - did you find a workaround?

ReplayKit only works in the foreground and when it needs to work in the background, 
it requires background mode to access the video buffer so that the SDK could fetch
 and keep broadcasting while the SDK app is in the background.

https://stackoverflow.com/questions/54485367/screen-recording-when-my-ios-app-is-in-background-with-replaykit

triniwiz commented 4 years ago

No I haven’t been on this project in a while but with the new {N} release I’ll be updating it soon