'I generate temp RTC token from the i need to renew token by code how could I do that
Here is my code ................................................................................................
public RtcEngine initializeAndJoinChannel(String appId, String token, String channelName,int
view) {
Log.d(TAG, "initializeAndJoinChannel: ");
try {
mRtcEngine = RtcEngine.create(getBaseContext(), appId, mRtcEventHandler);
} catch (Exception e) {
throw new RuntimeException("Check the error.");
}
// By default, video is disabled, and you need to call enableVideo to start a video stream.
mRtcEngine.enableVideo();
FrameLayout container = findViewById(view);
// Call CreateRendererView to create a SurfaceView object and add it as a child to the FrameLayout.
SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
container.addView(surfaceView);
// Pass the SurfaceView object to Agora so that it renders the local video.
mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT, 0));
// Join the channel with a token.
mRtcEngine.joinChannel(token, channelName, "", 0);
return mRtcEngine;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
