I am using zoom video sdk 1.0.3
Here is my scenario that get me into Cannot read property ‘canvas’ of null
I have 2 users (user A and user B) joining zoom. If a user A does a screen sharing, the user B can see it correctly without any issues.
Then user A stops sharing, the user B will see that the screen sharing is stopped.Now, when the user B starts to do screen sharing, everything is messed up. The only way to fix it is by refreshing the browser.
Below is my implementation to listen to any participant’s screen sharing.
I have a “‘active-share-change’” listener that listens to anyone who start sharing a screen.
When a participant starts to share a screen by calling .startShareScreen,
-
on that listener, when the state is active, .startShareView is executed.
-
when the state is Inactive, .stopShareView is executed
client.on('active-share-change',payload=>{ if(payload.state==='Active'){ stream.startShareView(payload.activeUserId,canvasElement); }else if(payload.state==='Inactive'){ stream.stopShareView(); } }).
That logic works perfectly.
Now thing is not working when the participant is trying to share the content startShareScreen after the .stopShareView is executed.
It seems that the canvas is no longer available as it throws the following error message:
TypeError: Cannot read property ‘canvas’ of null
at VM3 bfa6c1a5-9063-4609-9e03-75d27bdb9de6:1
at VM3 bfa6c1a5-9063-4609-9e03-75d27bdb9de6:1
Can someone please help me with this issue?
Thanks,