Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to apply the server URL to the project #62

Open
ChenBigFish opened this issue Oct 21, 2022 · 4 comments
Open

How to apply the server URL to the project #62

ChenBigFish opened this issue Oct 21, 2022 · 4 comments

Comments

@ChenBigFish
Copy link

Hi,
According to the tutorial in this link, the server has been deployed successfully, but how to replace the url of the server into the project?

[https://github.com/AgoraIO-Community/Agora-Node-TokenServer]

@SunGiantor
Copy link
Collaborator

It is not necessary to replace the server's url to the project. You only need your background server to provide an interface to obtain the rtmtoken. You can obtain the rtmToken in your project and use it in the launch interface.

@ChenBigFish
Copy link
Author

It is not necessary to replace the server's url to the project. You only need your background server to provide an interface to obtain the rtmtoken. You can obtain the rtmToken in your project and use it in the launch interface.

Sorry, I'm a beginner. Can you tell me where the "launch interface" is? I read the code for a long time and can't find the place where the token can be replaced

@SunGiantor
Copy link
Collaborator

@SunGiantor
Copy link
Collaborator

fun startClassRoom() {
val appId = "" // Pass your App ID
val rtmToken = "" // Pass your Token
val streamState = AgoraEduStreamState(videoState = 1, audioState = 1)

val config = AgoraEduLaunchConfig(
    "xiaoming", // The user name
    "xiaoming2", // The user ID
    "agoraclass", // The room name
    "agoraclass4", // The room ID
    2,  // The user role
    4,  // The room type
    rtmToken,
    System.currentTimeMillis(), // The class start time
    1800L, // The class duration
    AgoraEduRegion.na, // The region
    null,
    null,
    streamState, // Whether students automatically send audio or video streams after they "go onto the stage"
    AgoraEduLatencyLevel.AgoraEduLatencyLevelUltraLow, // The latency level
    null,
    null
)

config.appId = appId
AgoraClassroomSDK.setConfig(AgoraClassSdkConfig(appId))
AgoraClassroomSDK.launch(this, config, AgoraEduLaunchCallback { event ->
    Log.e(TAG, ":launch-Classroom State:" + event.name)
})

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants