Hello, i’m making a demo app with Video SDK.
I didn’t know it was changed to InstantSDK instead of VideoSDK, so I struggled a lot at first Plz update api documentation…
Anyway, when trying to create a session, I don’t know what’s wrong.
The docs says, if no matching session, SDK will create session for me.
I create a JWT token like this with jjwt
using kotlin.
Token is no problem when i checked in https://jwt.io/#libraries-io
.
val headers = HashMap<String, Any>().apply {
put("alg", "HS256")
put("typ", "JWT")
}
Timber.tag("JWT").d("headers : $headers")
val payloads = HashMap<String, Any>().apply {
putAll(
arrayOf(
"app_key" to sdkKey, "version" to 1, "user_identity" to userName,
"iat" to iat, "exp" to exp, "tpc" to sessionName
)
)
}
Timber.tag("JWT").d("payloads : $payloads")
val key = Keys.hmacShaKeyFor(sdkSecret.toByteArray())
val jwt = Jwts.builder()
.setHeader(headers)
.setClaims(payloads)
.signWith(key, SignatureAlgorithm.HS256)
.compact()
Timber.tag("JWT").d(jwt)
sdkKey
is my app’s SDK Key, and sdkSecret
is my app’s SDK secret.
val sessionContext = ZoomInstantSDKSessionContext().apply {
sessionName = "mysession_oneboard"
userName = "ricky"
token = createJWT(sessionName, userName)
audioOption = ZoomInstantSDKAudioOption().apply {
connect = true
mute = true
}
videoOption = ZoomInstantSDKVideoOption().apply {
localVideoOn = false
}
}
zoom.joinSession(sessionContext)
zoom.session?.run {
Timber.tag("Session").d("name : $sessionName")
Timber.tag("Session").d("password: $sessionPassword")
Timber.tag("Session").d("host : $sessionHost")
Timber.tag("Session").d("mySelf : ${mySelf.userName}")
// Timber.tag("Session").d("hostname : $sessionHostName")
}
And this is the source code, when i use joinSession()
. I know sessionName
, userName
, token
are required, but i don’t find a problem. So add audioOption
, videoOption
And my log says below.
D/JWT: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfa2V5IjoiVDBXRHlGM0gxaGxDMzBKRUsyc2ZUVzlTOXZ3Wm01ZVFRWU5vIiwidHBjIjoibXlzZXNzaW9uX29uZWJvYXJkIiwidXNlcl9pZGVudGl0eSI6InJpY2t5IiwiZXhwIjoxNjM2MzUzODI3LCJ2ZXJzaW9uIjoxLCJpYXQiOjE2MzYzMzk0Mjd9.bf0fXMNscPkxySM5DPFYNOm-UNGMksGMk7JKc_LFRlA
D/Session: name : mysession_oneboard
password: null
host : null
D/Session: mySelf :
D/ZoomListener: onError(2014)
D/ZoomListener: onSessionLeave()
I found the error code 2014
means Errors_Session_Invalid_Param
. But i don’t know what is problem.
I don’t know English well, so I’m sorry if I said it rudely.
Please solve it quickly. Thank you.