AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
624 stars 227 forks source link

From example Screen Share not working in iOS for some devices #540

Closed yasvitajoshi309 closed 1 year ago

yasvitajoshi309 commented 1 year ago

Hello all, we are using,

react-native: 0.66.4 react-native-agora: 3.7.1

We have implemented screen sharing with this

await RTCEngine.startScreenCapture({ captureAudio: true, captureVideo: true, videoParams: { bitrate: 500, frameRate: 15, width: MyConstants.windowWidth, height: MyConstants.windowHeight, contentHint: VideoContentHint.Details, }, });

And it's working perfect for android but for ios some devices (iPhone XR (OS 14.0.1), iPhone12) it's not working even i have tested demo sdk project in sdk example also it gives (CaptureInBackground = 6) error code in local video state change event after click on start broadcast popup button and failed to capture screen even app is in foreground state please help!

lienbao commented 1 year ago

iOS replaykit Prompt error ?

yasvitajoshi309 commented 1 year ago

No error is prompting

yasvitajoshi309 commented 1 year ago

Here is the logs for your reference

2022-10-20 11:08:08.742069+0530 AgoraExample[4344:2434148] [native] Running application main ({ initialProps = { }; rootTag = 1; }) 2022-10-20 11:08:08.825451+0530 AgoraExample[4344:2434403] [javascript] Running "main 2022-10-20 11:08:08.851714+0530 AgoraExample[4344:2434148] [native] [GESTURE HANDLER] Initialize gesture handler for root view <RCTRootContentView: 0x12bd0d0d0; reactTag: 1; frame = (0 0; 414 896); gestureRecognizers = <NSArray: 0x28364d440>; layer = <CALayer: 0x283816f80>> 2022-10-20 11:08:39.869794+0530 AgoraExample[4344:2434148] Metal API Validation Enabled 2022-10-20 11:08:40.284874+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:08:41.808366+0530 AgoraExample[4344:2434600] fopen failed for data file: errno = 2 (No such file or directory) 2022-10-20 11:08:41.808773+0530 AgoraExample[4344:2434600] Errors found! Invalidating cache... 2022-10-20 11:08:41.962301+0530 AgoraExample[4344:2434600] fopen failed for data file: errno = 2 (No such file or directory) 2022-10-20 11:08:41.962364+0530 AgoraExample[4344:2434600] Errors found! Invalidating cache... 2022-10-20 11:09:07.577588+0530 AgoraExample[4344:2434403] [javascript] 'JoinChannelSuccess', 'e1346dec-3d8c-48b7-ad4e-df79e884c43b', 3520063520, 399 2022-10-20 11:09:07.585641+0530 AgoraExample[4344:2434403] [javascript] 'UserJoined', 3520012312, 403 2022-10-20 11:09:07.639976+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:09:11.588668+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 2, 0 2022-10-20 11:09:19.385024+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 0, 0 2022-10-20 11:09:19.871763+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:09:20.312328+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 3, 6 2022-10-20 11:09:36.828234+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:09:37.579402+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 2, 0 2022-10-20 11:09:38.979594+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:09:39.580130+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 2, 0 2022-10-20 11:09:39.780068+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 3, 6 2022-10-20 11:09:50.183108+0530 AgoraExample[4344:2434403] [javascript] 'UserOffline', 3520012312, 0 2022-10-20 11:09:52.152256+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:09:53.581486+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 2, 0 2022-10-20 11:09:54.316023+0530 AgoraExample[4344:2434403] [javascript] 'LeaveChannel', { cpuAppUsage: 0, rxAudioKBitRate: 0, duration: 46, gatewayRtt: 0, rxVideoKBitRate: 0, memoryAppUsageRatio: 0, rxBytes: 4163321, txAudioBytes: 362370, memoryAppUsageInKbytes: 0, memoryTotalUsageRatio: 0, txBytes: 2287738, txAudioKBitRate: 0, txPacketLossRate: 0, rxKBitRate: 23, cpuTotalUsage: 0, rxAudioBytes: 57837, lastmileDelay: 24, rxPacketLossRate: 0, txVideoBytes: 875101, txVideoKBitRate: 0, rxVideoBytes: 3435583, txKBitRate: 1127, userCount: 1 } 2022-10-20 11:10:05.364901+0530 AgoraExample[4344:2434403] [javascript] 'JoinChannelSuccess', 'e1346dec-3d8c-48b7-ad4e-df79e884c43b', 3520063520, 283 2022-10-20 11:10:18.662194+0530 AgoraExample[4344:2434403] [javascript] 'UserJoined', 3520012312, 13578 2022-10-20 11:10:18.684686+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 1, 0 2022-10-20 11:10:19.363330+0530 AgoraExample[4344:2434403] [javascript] 'LocalVideoStateChanged', 2, 0 2022-10-20 11:10:19.662897+0530 AgoraExample[4344:2434403] [javascript] 'UserOffline', 3520012312, 0

and please find attached video of the issue

https://user-images.githubusercontent.com/108728980/196868381-ca64b039-e6fe-4b3a-a642-376211c587b2.mp4

Thank you so much for your support!

lienbao commented 1 year ago

replaykit process is not started from video , you can xcode debug replaykit, need to make sure