[Improvement Request] Screen share needs token, but it's not clear to how set it.
Problem: Agora App is Certificate enabled and joins a channel with token. Screen share not working:
out.framework.js:3 JoinChannel 8UrstKmaioPqo9RXSlX7kyMB80M2 Success: uid = 1001
clientmanager.js:506 EnableLocalVideo (clientManager):0
clientmanager.js:506 EnableLocalVideo (clientManager):1
out.framework.js:3 SDK startNewScreenCaptureForWeb
agorartcenginev2.js:333 agora engine startNewScreenCaptureForWeb
clientmanager.js:821 Screen Share Track track-scrcb68dc95
AgoraRTC_N.js:14 Uncaught (in promise) AgoraRTCException: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: flag: 4096, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key
at gJ (https://dreamspace-internal.web.app/AgoraRTC_N.js:14:15743)
at e.gatewayInfo.wV.joinChooseServer.lts (https://dreamspace-internal.web.app/AgoraRTC_N.js:14:13141)
at async https://dreamspace-internal.web.app/AgoraRTC_N.js:13:38265
Reason: https://docs.agora.io/en/Agora%20Platform/faq/token_error
Request:
In the demo, the only token-related code is mRtcEngine.JoinChannel. It's not easy to find out how to set token for other features like screen sharing. We need a method to start screen share with token.
My walkaround:
Change IRtcEngine.GetEngine(appId) to IRtcEngine.GetEngine(token) solved my problem.
If it need token, it's mean it need to direct to an exist channel. If you create project on agora.io with not secure option, you only get app id. (with out token and channel) put that app id into these demo. it's work. ortherwise, if you still wanna to use token, replace Join() by JoinByKey() if you still wanna access by token. But it's not right way;
@liyaozhong this is common Agora knowledge of using tokens. Our WebGL demo gets straight to the point using test mode AppIDs to avoid complications. To further understand how to use Certificate enabled AppIDs, it is recommended to read this tutorial.