-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screen sharing showing black screen for local video on iOS #1071
Comments
Did you create your own broadcast extension? Unlike Android, screen-sharing does not work out of the box without cooperation from the app. |
Yes I created my own broadcast extension with the following steps : I have also checked other threads in which they are referring to other pages for setting it up but its still not clear for a non iOS guy. i.e
Can you please help ? |
You need to follow the steps in here: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ios-sdk#screen-sharing-integration Yes, it's native iOS, there is no way around that. |
One more question, |
This does not work on the simulator, you need a physical device. |
I have any question this issue.I followed this steps. I cannot see share screen on my physical device. Actually , starting broadcast extensions, but I cannot see shared screen on my device's screen or participant's screen. Do I have to run it in release mode? Or why cannot see ? |
You should be able to run in debug mode, not using the Chrome debugger though. |
@saghul thank you . |
@SabihaCetin No luck so far, Tried a lot, the documentation on jitsi documentation are not that much clear for a non-iOS guy but still I tried them. |
@saghul Followed exactly the same steps, but getting |
Is any simulator involved? |
@saghul Nope. Running it on a physical device in debug mode. Also, I was looking at Jitsi code and I couldn't find reference to I know, you can't debug my code but do you have any idea why someone could be seeing red-screen on physical device? I am using iPhone 12 mini running iOS 15. Jitsi App works fine. |
No idea TBH. We run a vanilla version of this plugin, with no changes. |
@saghul got it.
like these logs
Does this point to anything? |
Yep, that sounds like the broadcast extension is connecting to the wrong place. Did you correctly set the app group ID in the correct Info.plist file? |
@irohitb |
It's described with great detail in the link here: #1071 (comment) |
@saghul Double checked everything on the app (app group seems to be correct). From my broadcast extension logs, It seems to be failing here: https://github.com/jitsi/jitsi-meet-sdk-samples/blob/master/ios/swift-screensharing/JitsiSDKScreenSharingTest/Broadcast%20Extension/SocketConnection.swift#L143 Getting |
That means the listener was not ready yet. In what order are you running the operations? |
@saghul Yeah, My bad I was doing brute force approach and trying different things. Here the new logs I am getting
Made a small repo (with very minimal code) for the same as well |
@saghul Couple of questions, what is this value? And what it does? like what should someone set this to? |
That's just a name assigned to the dispatch queue thread. You can set it to anything, it has no implications. |
@saghul
but in xcode project it shows this Is this correct? |
Hi @saghul Following are the topics in the link, Can you let me know upto which topic are we supposed to follow ?
Should we follow all the above steps even if we are not using jitsi and only the webrtc plugin ? and as simple as that, I am only trying to show the screen recorded video locally in the same screen. Another question, `To enable data sharing, use Xcode or the Developer portal to enable app groups for the containing app and its contained app extensions. Next, register the app group in the portal and specify the app group to use in the containing app. To learn about working with app groups, see Adding an App to an App Group.` TIA |
YEs, those steps apply to any app, not just jitsi. |
We have to follow all the 6 steps ? and again, |
Yes and yes. |
Hey @saghul I integrated the library and followed the steps mentioned in the jitsi meet link. Any clue of whats going wrong here ? |
What iOS version are you tearing on? Our trick to programmatically click the button seems to only work on iOS >= 14 |
The iOS version that I am using is 15.1. For more refrence, if I add print("example") commands at any place in the copied files like samplehandler etc, they are never printed. Will they print ? Can this be the reason ? Can you tell me of any place where the print statement will surely print when I actually cal navigator. getDisplayMedia "Our trick to programmatically click the button" -> Is this something that comes itself by the code of jitsi or we have to do this separately ? |
You can do this: https://github.com/jitsi/jitsi-meet/blob/d651ecb166fdd5b3914614b2be2a183876496e64/react/features/toolbox/components/native/ScreenSharingIosButton.js#L86 Create your own button, and when the user taps it do the same thing we do to show the system picker. |
Ok, Thanks, |
That really worked @saghul |
There is a retry mechanism, it shouldn't matter. Are you running into issues? |
@saghul Not running into an issue, basically, I call "NativeModules.ScreenCapturePickerViewManager.show(handle);" and Navigator.getdiplaymedia at the same time and in the success of Navigator.getdiplaymedia, I connect to the socket. Now there is a scenario, lets say I click the start streaming button and both the native picker and the navigator.displaymedia are called and I might land into a situation where the user does not click on the start broadcast button from the picker but the user actually is connected to the socket with a black screen shown to the other users, untill he clicks the black screen. |
I think I understand. I don't think we currently have a way to know when the user pressed the button, alas. I mean, we do know it on the native side, but not in JS. A patch would be welcome. |
@saghul
|
Ah wait. While looking into answer you I realized how we do it :-) In the app part, we post notifications when the user pressed the start button, when as a result of that we create the track: https://github.com/jitsi/jitsi-meet/blob/8456a63a23fdfc1b00a5115e9bb609b1722def5f/ios/sdk/src/ScheenshareEventEmiter.m#L60 |
Wow thats great, I will give it a try, Thanks man. |
@saghul |
You need some native code yes. |
Hey @saghul |
What I linked earlier. It's what we use in Jitsi Meet. |
Hey @saghul Sorry for bothering again, but I am trying to achieve the maximum I can from the library and will try to help people in future also who face issue in this library. lets say I have a button on the react native side to stop the screen share/streaming etc , how do I stop the iOS native side replaykit recording ( the red notification bar - which we have to click manually and click stop broadcast ) |
Unfortunately I don't think that's possible. |
Hey @irohitb. Did you resolve red screen issue? will be appreciative for answer |
Hey @TarasDumych Unfortunately no, Haven't looked at in a while but will try it over the weekend again. |
@singhagam1 How to implement to know if the broadcast has started/user has clicked the start broadcast ? |
@peeratattt did u find solution? |
Hi brother, have you found a solution for this? Can you teach me |
Expected behavior
The screen share i.e getDisplayMedia() should work as working on android i.e show the local screen
Observerd behavior
The screen sharing is not working on ios no matter real device or simulator, but works fine for the same code on android
Steps to reproduce the problem
create a dummy react native project, install the latest react native webrtc library and replace the app.js code with the code below
Now run the app on iOS and click start recording, no pop up to start broad cast is shown and also, the screen or RTCView is black in color.
Please let me know if I have to do some extra setting to have this working in iOS. As of now, I just want to show the iOS local video only !
Platform information
iOS Real device
The text was updated successfully, but these errors were encountered: