skip to Main Content

I am using the MyVideoSDKAppSample for zoom video calling and screen sharing, the video calling and screen sharing is working fine, the problem is occuring when i am trying to annotate on the view. The annotations are just not showing up. I have tried to initialize the ZoomVideoSDKAnnotationHelper object using createAnnotationHelper method on the ZoomSDKVideoShareHelper object and i have set the toolType and toolWidth on the ZoomVideoSDKAnnotationHelper object but when i log the properties it always shows both properties as 0 and the annotations don’t show up on the view when i try to annotate.

this is the code that i am using to show annotations

 if let shareHelper = ZoomVideoSDK.shareInstance()?.getShareHelper() {
                // Call startSharewith: to begin sharing the loading label.
                
                let returnValue = shareHelper.startShare(with: self.canvasView)
                if returnValue == .Errors_Success {
                    // Your view is now being shared.
                    print("Sharing succeeded")
//                    self.shareView.isHidden = false
                    print("shareHelper.isAnnotationFeatureSupport() = (shareHelper.isAnnotationFeatureSupport())")
    //this logs : shareHelper.isAnnotationFeatureSupport() = true
                    
                    let error1 = shareHelper.disableViewerAnnotation(false)
                    print("shareHelper.enableViewerAnnotation == (error1 == .Errors_Success)" )
//this logs: shareHelper.enableViewerAnnotation == true
                    
                    print("shareHelper.isViewerAnnotationDisabled() = (shareHelper.isViewerAnnotationDisabled())")
    //this logs: shareHelper.isViewerAnnotationDisabled() = false
                    
                    if let annoHelper = self.annoHelper {
                        shareHelper.destroy(annoHelper)
                    }
                    self.annoHelper = nil
                    self.annoHelper = shareHelper.createAnnotationHelper(nil)
                    self.annoHelper?.setToolColor(.systemRed)
                    self.annoHelper?.setToolType(.pen)
                    self.annoHelper?.setToolWidth(10)

    //this if let executes , means the annotation is started                    
                    if let err = self.annoHelper?.startAnnotation(), err == .Errors_Success { 

                        print("annotation started") 
                    }
                    print("annohelper is :(self.annoHelper!)")
                    print(self.annoHelper?.getToolColor())
                    print(self.annoHelper?.getToolWidth())
                    print(self.annoHelper?.getToolType().rawValue)


    //these above 4 lines gives these logs :
    annohelper is :<ZoomVideoSDKAnnotationHelper: 0x281415f40>
    Optional(UIExtendedSRGBColorSpace 0 0 0 1)
    Optional(0)
    Optional(0)
                } else {
                    print("Sharing failed")
                }
            }

2

Answers


  1. Chosen as BEST ANSWER

    So, After hours of digging around, i got the real problem, it was with the zoom's video SDK version. Annotation started working with the version 5.11


  2. The java.lang.NumberFormatException you’re encountering is an unchecked exception in Java that occurs when an attempt is made to convert a string with an incorrect format into a numeric value. This particular exception is thrown when the conversion of a string to a numeric type, like an int or float, is not possible because the string does not have an appropriate format for conversion (1) .

    In your case, "247345 " might be causing an issue due to the trailing whitespace. Java’s parsing methods for numeric conversions expect strings to be strictly in numeric format without any leading or trailing spaces or non-numeric characters. To resolve this, you can trim the string before attempting the conversion:

    String input = "247345 ";
    int number = Integer.parseInt(input.trim());
    

    This code snippet uses the trim() method to remove any leading or trailing spaces from the input string, ensuring that the string can be successfully parsed into a numeric type.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search