ACS Calling SDK (JS): Stopping RawMedia stream with transformations causes Simulcast issue

Joaquín Paz 20 Reputation points
2023-10-11T17:16:50.8233333+00:00

Hi,

We're working on a video calls application using ACS Calling SDK in Typescript. We are using RawMedia to apply custom transformations to the stream. I'll try to be as detailed as possible regarding the issue, but just for context, the setup was working correctly, and we can start/stop streams with no issue (if not applying transformations).

We start the call with this.call.startVideo(LocalVideoStream) The local video stream is created with new LocalVideoStream(camera), camera being type VideoDeviceInfo

Everything works perfectly at this point. We proceed to transform the stream, pipe it through a transformer and generate a new stream. We then set this stream with LocalVideoStream.setMediaStream(transformedStream) and everything works perfectly.

We then proceed to this.call.stopVideo(LocalVideoStream) and that's when we get a Simulcast error in the console:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'mediaType')
    at SimulcastMediaStreamClient.get...

For reference: everything works perfectly, the video does stop, and there are no apparent issues other than the log. Can we please get help with this issue? Do we know why this error throws? Should we be doing something different when the stream was set with setMediaStream to stop the video?

Thanks for the help!

Kind regards,

Joaquin Paz

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,251 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. brtrach-MSFT 17,741 Reputation points Microsoft Employee Moderator
    2023-10-11T18:39:38.36+00:00

    @Joaquín Paz Thank you for reaching out to us. Based on the information you provided, it seems that the issue is related to the SimulcastMediaStreamClient. The error message indicates that it is trying to read properties of null, which means that the mediaType property is null. This could be caused by a few different things, such as a bug in the SDK or an issue with the configuration of the service.

    To help us better understand the issue, could you please provide us with more information about the transformations you are applying to the stream? Also, could you please share the version of the ACS Calling SDK you are using?

    In the meantime, you can try the following steps to see if they resolve the issue:

    1. Make sure that you are using the latest version of the ACS Calling SDK.
    2. Try stopping the video stream before setting the new transformed stream with LocalVideoStream.setMediaStream(transformedStream).
    3. Check if the issue persists when you remove the transformer and use the original stream.

  2. Joaquín Paz 20 Reputation points
    2023-11-13T23:21:00.72+00:00

    As a followup to this issue, aside from the log (that persists) we are having occasional bugs when ending calls where the camera remains in use (the stream doesn't close correctly). We are stopping the call with the LocalVideoStream call.stopVideo(localVideoStream)

    Probably this issue could be locking/throwing the stream cleanup process. This bug usually happens when we start a lot of different calls in various tabs and stop them. Usually the first tabs close correctly, but after a couple the camera starts failing to release from the tabs (remaining in a locked state with the light on and the red-dot indicating it's in use by the browser).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.