swapToShowShareViewOrVideo is not working as intended

Description
Hello,

I am trying to perform the action of below button (in red) using swapToShowShareViewOrVideo but it doesn’t seem to work. It always returns ZoomSDKError(rawValue: 4)

Screenshot 2021-01-13 at 18.52.11

Here is my code for it.

func swapToShowShareViewOrVideo() {
    let shouldSwap = !(sdkMeetingActionController?.isDisplayingShareViewOrVideo() ?? false)
    let result = sdkMeetingActionController?.swap(toShowShareViewOrVideo: shouldSwap)
    print("swap(toShowShareViewOrVideo \(shouldSwap)) result: \(String(describing: result))")
  }

Here are some logs which can be useful.

po sdkMeetingActionController?.isDisplayingShareViewOrVideo()
▿ Optional<Bool>
  - some : true

po sdkMeetingActionController?.canSwapToShowShareViewOrVideo()
▿ Optional<Bool>
  - some : false

swap(toShowShareViewOrVideo false) result: Optional(__C.ZoomSDKError(rawValue: 4))

I checked my code and everything seems to be fine, Can you please let me know what could be the reason for error code 4?
I think this use to work in older version of SDK, but after upgrading to 5.4.54528.1230 it doesn’t work.

Related to that, isDisplayingShareViewOrVideo() is not returning value as false, in case my video is visible in the UI and not the sharing screen.

Please review my code and let me know if I am doing something wrong.

Which version?
5.4.54528.1230

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Join a meeting with multiple participants, with somebody sharing the screen and video.
  2. Call the function swapToShowShareViewOrVideo with true/false based on isDisplayingShareViewOrVideo
  3. Check the response code of function call
  4. See error

I can confirm there are definitely some differences in latest SDK update vs 5.2.42037.1112
I am always getting isDisplayingShareViewOrVideo false in old SDK but in new one it is always true

po sdkMeetingActionController?.isDisplayingShareViewOrVideo()
▿ Optional<Bool>
  - some : false

In both versions calling swapToShowShareViewOrVideo returns ZoomSDKError(rawValue: 4)

@Michael_Condon
Correction: (I can’t edit my previous reply)

In both versions calling swapToShowShareViewOrVideo returns ZoomSDKError(rawValue: 4), even though the user is sharing screen and the video is on

Hi @j_a_z_z, thanks for the post.

I can certainly see where the confusion comes from regarding the methods around this feature. Please allow me some time to gather the requirements internally around the behavior for this so that we can work on making these interfaces clearer.

I am sure that, as we are looking into the expected behavior of these swap-related methods, we will also be able to improve the readability/usability of this flow.

In the meantime, it will take some time to investigate the proper usage of these methods, which will require a bit of testing internally. As soon as we have anything concrete on either front, you will be the first to know. :slightly_smiling_face:

Thanks!

@jon.zoom as @j_a_z_z pointed out this method worked with the previous version of the SDK now it stopped. We cannot however go to previous version because in that version the floating interface calls don’t work.

Hi @tmiskiew,

Thanks for clarifying that this was working properly in the previous release of the SDK.

I think I could have been a little clearer in my explanation, so apologies for that. We are going to investigate what caused this method to stop working and fix it in a future version. In addition to restoring the functionality to match that of the previous version, we will also investigate whether or not we can improve the usability of the swapToShowShareViewOrVideo and isDisplayingShareViewOrVideo methods.

The reasoning for the second action is that we have made note that the wording and return types of these methods are not as intuitive as they could be, so we would like to see if that’s something we can improve significantly without major breaking changes.

Please let me know if any of this is unclear and I will be happy to clarify further.

Thanks!

I think everything is clear it it’s only that the latest sdk update broke our app… if Zoom releases a bug free sdk one day I will copy it to diskettes and lock it in a safe :joy: We would really appreciate if you could get this fixed without breaking anything else. We want to launch our product and we can’t because if this and numerous other bugs.

Hi @tmiskiew,

I think everything is clear it it’s only that the latest sdk update broke our app

Absolutely agreed, we will definitely work on getting the change that introduced this behavior reverted!

We would really appreciate if you could get this fixed without breaking anything else

No need to worry. If we make any additional changes alongside this fix, they would be surface level changes that couldn’t impact the underlying logic. The largest change I could see happening around this would be renaming a couple of methods for the sake of clarity. :slightly_smiling_face:

Thanks!

This bug is still happening for me in v5.5.12511.0420. I’ll add that it returns the appropriate sharing value for the meeting host, I only get ZoomSDKError_WrongUsage (4) for non-hosts.

Hi @stalefishlabs,

Sorry to hear you are running into this issue as well. Usually when you get the WrongUsage error for this method, it means one of two things:

  1. No one is sharing (probably not the case, since you are able to use it as the host)
  2. You are using one of the side-by-side views in the UI. This feature is only supported when using standard view.

Please let me know if neither of these are applicable to your scenario and we can continue looking into this.

Thanks!