Closed ebade closed 4 months ago
From where do you trigger the .Wait()
method? Because if you trigger the method from within a event update you're receiving of events is blocked until the ChangeScreenSharingRoleAsync
-Task completed, and ,I'm not too sure about it but, it is possible that the receiving thread is required to complete the ChangeScreenSharingRoleAsync
-Task which would make your code a dead lock. A better praxis instead of using .Wait()
is using Task.Run(...)
.
@1fabi0 thank you for the reply. I am using the skeleton of how the PSIBot handles the screen sharing since I want when the bot to join the meeting to start screen share to show data on the screen.
I meant to post about this earlier in the week. In case someone runs into this in the future. The way the PSIBot code handles how the screen share is actually produced has to do with the generator and the joins. Due to the joins working as part of the process it will not actually run the function within the process unless it has at least 1 video and 1 audio stream in the meeting. I had a very idiot moment when I by happenstance put break points in the audio and video process functions and noticed the video process was not triggering the break point. I flicked my camera on and boom, screen share and everything I needed. I am mostly providing all of this detail so if people in the future run into this hopefully they understand the process.
I am working on a teams bot that involves sharing the screen. I have a setup similar to the PSI bot example. I was working with this code on Monday and was able to share a screen generated by the bot. When attempting to work with the bot today it no longer will share the screen. I am using two environments that I know to be working, and even loading known working code I am still unable to share the screen.
I know that the application is setup and is attempting to share the screen since the code for starting the screen share:
this.Call.ChangeScreenSharingRoleAsync(ScreenSharingRole.Sharer).Wait();
and the event for screen sharing:
this.vbssMediaSendStatus = e.MediaSendStatus;
this returns active when the bot joins the roomMicrosoft.Graph 5.48.0 Microsoft.Graph.Communications.Calls 1.2.0.10115 Microsoft.Graph.Communications.Calls.Media 1.2.0.10115 Microsoft.Graph.Communications.Client 1.2.0.10115 Microsoft.Skype.Bots.Media 1.27.0.2-alpha
Call ID 631f6a00-fe8c-4101-a504-132ed9efa5a1 around 2pm CST