amazon-chime-sdk-ios
amazon-chime-sdk-ios copied to clipboard
Local video stop/start after `videoAtCapacityViewOnly` status not triggering expected observer callbacks
Describe the bug
Hello, wondering if we could get some help answering a question about the AudioVideoObserver
in iOS SDK? The question is about the status code videoAtCapacityViewOnly
that is triggered from videoSessionDidStartWithStatus
when over 16 videos are streaming.
We are noticing this is posted only once, and that the video tile is still added via videoTileDidAdd
just after this status code is posted. Then, after getting videoAtCapacityViewOnly
status, later calls to audioVideoFacade.stopLocalVideo()
do not trigger videoTileDidRemove
. Also noticing that if a stream opens up (someone stops video or leaves) then the previously blocked stream starts coming through.
Is there a way to stop the local video when hitting videoAtCapacityViewOnly
such that future attempts to start local (via audioVideo.startLocalVideo()) will trigger videoTileDidAdd
if space allows, or videoAtCapacityViewOnly
if still full?
I have read #243 and it doesn't provide context for this use case.
To Reproduce Steps to reproduce the behavior:
- Run meeting with 16 video streams
- Add a 17 video stream
- Attempt to stop the local video after receiving
videoAtCapacityViewOnly
Expected behavior
When receiving videoAtCapacityViewOnly
no video tile would be added via videoTileDidAdd
, or added tile would be removed with call to audioVideoFacade.stopLocalVideo()
AND, each attempt to start video when past max streams would trigger videoAtCapacityViewOnly
status
Logs N/A
Screenshots N/A
Test environment Info (please complete the following information):
- Device: [e.g. iPhone12]
- OS: [e.g. iOS14]
- Version AmazonChimeSDK: [e.g. 0.16.1]
- Version AmazonChimeSDKMedia: [e.g. 0.11.2]
Additional context N/A
Hi @tiltem, sorry for the late reply. Before making any suggestion, I'd like to understand more about your reproduce steps.
You mentioned that in step 2 you add the 17th video stream, were there already 16 video streams ongoing from other attendees?
Immediately you received videoAtCapacityVideoOnly
? And were you able to confirm the 17th video stream is received from other ends?
Also noticing that if a stream opens up (someone stops video or leaves) then the previously blocked stream starts coming through
Which stream is blocked in the above example?
Hello @linsang21 ,
Yes, 16 streams already running, and 17th stream added results in videoAtCapacityVideoOnly
status. The videoTileDidAdd
is only received for the local video, right after the videoAtCapacityVideoOnly
message. However, after receiving videoAtCapacityVideoOnly
status, any calls to audioVideoFacade.stopLocalVideo()
and audioVideoFacade.startLocalVideo()
do not trigger related videoTileDidRemove
/videoTileDidAdd
callbacks for that user even if number of streams is below 16.
The "blocked" stream is referring to what was the 17th stream.
Hi @tiltem, thanks for the info. If I understand correctly, the 17th stream is only happened for local video, and it's only subscribed locally (means you got videoTileDidAdd
for this local video, nobody else is able to receive it). My current suspicion is that internally local video subscription is different from remote videos, may because of a shortcut. We'll look further into this. Out of curious, have you seen this issue on Android?
Hi @linsang21, Yes issue is seen in iOS SDK, haven't tested Android
I was able to reproduce the issue using demo app. While we're looking further into this, you may consider protecting the app by disabling start local video call at app level once reaching the limit temporarily.
It's important to note that StartLocalVideo and StopLocalVideo are idempotent. VideoTileDidAdd won't be triggered on the second consecutive StartLocalVideo and VideoTileDidStop won't be triggered on the second consecutive StopLocalVideo. If you are calling StartLocalVideo then StopLocalVideo once, but still not seeing VideoTileDidRemove, then I think that's unexpected. That error videoAtCapacityViewOnly is kicked back from the server if either the server or the SDK are at capacity for videos turned on. There is also another callback that is not technically supported yet, but its in the internal directory so use with caution. It could change at any time. This callback tells you whether any attendee has hit their local video rendering limit and is invoked when attendees update their videos. You could use this callback to know when to restart local video after hitting the limit.
Hello @dylonChime, When StartLocalVideo
triggers error videoAtCapacityViewOnly
, VideoTileDidAdd
follows (for local video only). After this there is no way to trigger VideoTileDidRemove
, a call to StopLocalVideo
does not do it.
Ok then this is the heart of the issue I think. Other behavior looks expected. We will continue to investigate.
Just wanted to escalate this issue as we've been encountering it as well. We've imposed an internal app limit of 24 tiles that we are jumping through a few hoops to reinforce but it would be great for us to be able to rely on the SDK. Additionally we'd love to see the methods videoSendDidBecomeUnavailable
supported in the iOS SDK like it is here as well as videoAvailabilityDidChange
here. Let me know if you like a separate ticket for those or if that doesn't make sense.
Hi @jatindervrify,
I don't think you need to open another issue, since those callbacks are closely related to the behavior of this edge case. We will post here when we have an update.
The fix has been released in v.0.22.3. @jatindervrify @tiltem Feel free to try it out.