From 5a5bd6136fe8a3d6fb895385b776b37b85516d23 Mon Sep 17 00:00:00 2001 From: acgist <289547414@qq.com> Date: Thu, 8 Jun 2023 07:35:29 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20H5=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taoyao/boot/build.gradle | 14 ++++---- taoyao-client-android/taoyao/build.gradle | 12 +++++++ .../taoyao/client/build.gradle | 18 +++++------ .../taoyao/media/build.gradle | 32 +++++++++---------- taoyao-client-web/src/components/Taoyao.js | 5 +-- .../src/main/resources/application.yml | 4 +-- 6 files changed, 49 insertions(+), 36 deletions(-) diff --git a/taoyao-client-android/taoyao/boot/build.gradle b/taoyao-client-android/taoyao/boot/build.gradle index 79a0ce0..4e533e4 100644 --- a/taoyao-client-android/taoyao/boot/build.gradle +++ b/taoyao-client-android/taoyao/boot/build.gradle @@ -4,12 +4,12 @@ plugins { android { namespace 'com.acgist.client.boot' - compileSdk 32 + compileSdk rootProject.ext.taoyao.compileSdk defaultConfig { - minSdk 28 - targetSdk 32 - versionCode 100 - versionName "1.0.0" + minSdk rootProject.ext.taoyao.minSdk + targetSdk rootProject.ext.taoyao.targetSdk + versionCode rootProject.ext.taoyao.versionCode + versionName rootProject.ext.taoyao.versionName consumerProguardFiles "consumer-rules.pro" } buildTypes { @@ -19,8 +19,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility rootProject.ext.taoyao.javaVersion + targetCompatibility rootProject.ext.taoyao.javaVersion } } diff --git a/taoyao-client-android/taoyao/build.gradle b/taoyao-client-android/taoyao/build.gradle index 212b1d9..01da903 100644 --- a/taoyao-client-android/taoyao/build.gradle +++ b/taoyao-client-android/taoyao/build.gradle @@ -2,3 +2,15 @@ plugins { id 'com.android.library' version '7.4.2' apply false id 'com.android.application' version '7.4.2' apply false } +ext { + taoyao = [ + minSdk : 28, + targetSdk : 32, + compileSdk : 32, + versionCode : 100, + versionName : "1.0.0", + ndkVersion : "23.1.7779620", + javaVersion : JavaVersion.VERSION_17, + cmakeVersion : "3.22.1", + ] +} \ No newline at end of file diff --git a/taoyao-client-android/taoyao/client/build.gradle b/taoyao-client-android/taoyao/client/build.gradle index 0fda6f5..89f3c42 100644 --- a/taoyao-client-android/taoyao/client/build.gradle +++ b/taoyao-client-android/taoyao/client/build.gradle @@ -4,12 +4,12 @@ plugins { android { namespace 'com.acgist.taoyao.client' - compileSdk 32 + compileSdk rootProject.ext.taoyao.compileSdk defaultConfig { - minSdk 28 - targetSdk 32 - versionCode 100 - versionName "1.0.0" + minSdk rootProject.ext.taoyao.minSdk + targetSdk rootProject.ext.taoyao.targetSdk + versionCode rootProject.ext.taoyao.versionCode + versionName rootProject.ext.taoyao.versionName consumerProguardFiles "consumer-rules.pro" applicationId "com.acgist.taoyao.client" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -20,13 +20,13 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { + sourceCompatibility rootProject.ext.taoyao.javaVersion + targetCompatibility rootProject.ext.taoyao.javaVersion + } buildFeatures { viewBinding true } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } } dependencies { diff --git a/taoyao-client-android/taoyao/media/build.gradle b/taoyao-client-android/taoyao/media/build.gradle index f162ae8..1fdb934 100644 --- a/taoyao-client-android/taoyao/media/build.gradle +++ b/taoyao-client-android/taoyao/media/build.gradle @@ -6,14 +6,14 @@ def WEBRTC_INC_PATH = "${projectDir}/deps/webrtc/src" def WEBRTC_LIB_PATH = "${projectDir}/deps/webrtc/lib" android { - namespace 'com.acgist.mediasoup' - compileSdk 32 - ndkVersion "23.1.7779620" + namespace 'com.acgist.taoyao.media' + compileSdk rootProject.ext.taoyao.compileSdk + ndkVersion rootProject.ext.taoyao.ndkVersion defaultConfig { - minSdk 28 - targetSdk 32 - versionCode 100 - versionName "1.0.0" + minSdk rootProject.ext.taoyao.minSdk + targetSdk rootProject.ext.taoyao.targetSdk + versionCode rootProject.ext.taoyao.versionCode + versionName rootProject.ext.taoyao.versionName consumerProguardFiles "consumer-rules.pro" externalNativeBuild { cmake { @@ -37,24 +37,24 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - externalNativeBuild { - cmake { - path file('CMakeLists.txt') - version '3.22.1' - } + sourceCompatibility rootProject.ext.taoyao.javaVersion + targetCompatibility rootProject.ext.taoyao.javaVersion } sourceSets { main { jniLibs.srcDirs = ["libs"] } } + externalNativeBuild { + cmake { + path file('CMakeLists.txt') + version rootProject.ext.taoyao.cmakeVersion + } + } } dependencies { api project(path: ':boot') - implementation 'androidx.annotation:annotation:1.3.0' + api 'androidx.annotation:annotation:1.3.0' testImplementation 'junit:junit:4.13.2' } diff --git a/taoyao-client-web/src/components/Taoyao.js b/taoyao-client-web/src/components/Taoyao.js index 8839f9c..03721a0 100644 --- a/taoyao-client-web/src/components/Taoyao.js +++ b/taoyao-client-web/src/components/Taoyao.js @@ -2285,7 +2285,7 @@ class Taoyao extends RemoteClient { this.callbackError("无效终端"); return; } - me.checkDevice(); + await me.checkDevice(); const response = await me.request( protocol.buildMessage("session::call", { clientId @@ -2298,8 +2298,9 @@ class Taoyao extends RemoteClient { async defaultSessionCall(message) { const me = this; + await me.checkDevice(); const { name, clientId, sessionId } = message.body; - const session = new Session({name, clientId, sessionId}); + const session = new Session({name, clientId, sessionId, audioEnabled: me.audioProduce, videoEnabled: me.videoProduce}); this.sessionClients.set(sessionId, session); await me.buildPeerConnection(session, sessionId); session.peerConnection.createOffer().then(async description => { diff --git a/taoyao-signal-server/taoyao-server/src/main/resources/application.yml b/taoyao-signal-server/taoyao-server/src/main/resources/application.yml index 7ce1b3e..98cbd30 100644 --- a/taoyao-signal-server/taoyao-server/src/main/resources/application.yml +++ b/taoyao-signal-server/taoyao-server/src/main/resources/application.yml @@ -154,7 +154,7 @@ taoyao: s=TaoyaoRecord t=0 0 a=group:BUNDLE video audio - m=video %d RTP/AVP 101 102 + m=video %d RTP/AVP 101 c=IN IP4 0.0.0.0 a=rtpmap:101 VP8/90000 a=recvonly @@ -163,7 +163,7 @@ taoyao: a=rtpmap:100 OPUS/48000/2 a=recvonly # 录像命令 - record: ffmpeg -protocol_whitelist "file,rtp,udp" -y -thread_queue_size 1024 -i %s -c:a aac -c:v h264 %s + record: ffmpeg -y -protocol_whitelist "file,rtp,udp" -thread_queue_size 1024 -i %s -c:a aac -c:v h264 %s # 预览命令 preview: ffmpeg -y -i %s -ss %d -vframes 1 -f image2 %s # 时长命令