This commit is contained in:
li 2024-05-29 17:59:19 +08:00
parent 8b83220ccd
commit b5df0c6374
2 changed files with 13 additions and 0 deletions

View File

@ -81,4 +81,15 @@ Java_com_zlm_rtc_NativeLib_makePushUrl(JNIEnv *env, jobject thiz, jstring app, j
char url[100];
sprintf(url,"https://zlmediakit.com/index/api/webrtc?app=%s&stream=%s&type=push",appString,streamIdString);
return env->NewStringUTF(url);
}
extern "C"
JNIEXPORT jstring JNICALL
Java_com_zlm_rtc_NativeLib_makeEchoUrl(JNIEnv *env, jobject thiz, jstring app, jstring stream_id) {
const char *appString = env->GetStringUTFChars(app, 0);
const char *streamIdString = env->GetStringUTFChars(stream_id, 0);
char url[100];
sprintf(url,"https://zlmediakit.com/index/api/webrtc?app=%s&stream=%s&type=echo",appString,streamIdString);
return env->NewStringUTF(url);
}

View File

@ -14,6 +14,8 @@ class NativeLib {
external fun makePushUrl(app:String,streamId:String): String
external fun makeEchoUrl(app:String,streamId:String): String
companion object {
// Used to load the 'rtc' library on application startup.
init {