From 5ae55f87faf5aefe796d39e35e7f428dbbcf8382 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 11 Jun 2024 14:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A3=B0=E7=BD=91=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E4=BC=9A=E7=99=BD=E5=B1=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E6=A8=A1=E5=9D=97=E9=97=B4=E7=9A=84?= =?UTF-8?q?=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/build.gradle | 3 +++ config.gradle | 4 +-- lib_faceunity/build.gradle | 1 + .../faceunity/agora/SWAuManager.java | 26 +++++++++---------- live/build.gradle | 2 +- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index dfc910ce1..75a00d20a 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -227,4 +227,7 @@ dependencies { //声网SDK //api 'io.agora.rtc:agora-special-full:4.2.6.245' + //ExoPlayer,腾讯的播放器不支持无缝切换 + api 'com.google.android.exoplayer:exoplayer:2.18.2' + api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar' } diff --git a/config.gradle b/config.gradle index b809fb2cd..1b62950f7 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")), diff --git a/lib_faceunity/build.gradle b/lib_faceunity/build.gradle index cfa97aa94..ae0f6f9cb 100644 --- a/lib_faceunity/build.gradle +++ b/lib_faceunity/build.gradle @@ -40,6 +40,7 @@ dependencies { api "$AGORA_RTC_SDK" } api project(path: ':FaceUnity') + api project(path: ':common') } // Because the components are created only during the afterEvaluate phase, you must diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java index f64ea9637..43960605d 100644 --- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java @@ -3,7 +3,7 @@ package io.agora.beautyapi.faceunity.agora; import android.app.Activity; import android.content.Context; import android.util.Log; -import android.view.SurfaceView; +import android.view.TextureView; import android.widget.FrameLayout; @@ -166,8 +166,8 @@ public class SWAuManager extends BaseCacheManager { */ public void updateMyChannelView(FrameLayout frameLayout, int uid) { mRtcEngine.setupLocalVideo(null); - SurfaceView surfaceView = new SurfaceView(mContext); - surfaceView.setZOrderMediaOverlay(true); + TextureView surfaceView = new TextureView(mContext); + //surfaceView.setZOrderMediaOverlay(true); frameLayout.addView(surfaceView); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid); @@ -185,8 +185,8 @@ public class SWAuManager extends BaseCacheManager { } else { uid = Integer.parseInt(strUid); } - // 创建一个 SurfaceView 对象,并将其作为 FrameLayout 的子对象 - SurfaceView surfaceView = new SurfaceView(mContext); + // 创建一个 TextureView 对象,并将其作为 FrameLayout 的子对象 + TextureView surfaceView = new TextureView(mContext); audienceContainer.addView(surfaceView); // 启用视频模块 @@ -228,8 +228,8 @@ public class SWAuManager extends BaseCacheManager { @Override public void run() { L.eSw("onJoinChannelSuccess:" + channel + " uid " + uid + " elapsed: " + elapsed); - SurfaceView surfaceView = new SurfaceView(mContext); - surfaceView.setZOrderMediaOverlay(true); + TextureView surfaceView = new TextureView(mContext); + // surfaceView.setZOrderMediaOverlay(true); pkContainer1.addView(surfaceView); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, strUid); mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection); @@ -308,8 +308,8 @@ public class SWAuManager extends BaseCacheManager { mContext.runOnUiThread(new Runnable() { @Override public void run() { - SurfaceView surfaceView = new SurfaceView(mContext); - surfaceView.setZOrderMediaOverlay(true); + TextureView surfaceView = new TextureView(mContext); + // surfaceView.setZOrderMediaOverlay(true); frameLayout.addView(surfaceView); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, Integer.parseInt(toUid)); mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection); @@ -389,10 +389,10 @@ public class SWAuManager extends BaseCacheManager { //设置对方主播视图 public void setupRemoteVideo(int uid) { - SurfaceView surfaceView = new SurfaceView(mContext); - surfaceView.setZOrderMediaOverlay(true); + TextureView surfaceView = new TextureView(mContext); + // surfaceView.setZOrderMediaOverlay(true); audienceContainer.addView(surfaceView); - // 将 SurfaceView 对象传入声网实时互动 SDK,设置远端视图 + // 将 TextureView 对象传入声网实时互动 SDK,设置远端视图 mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid)); } @@ -422,7 +422,7 @@ public class SWAuManager extends BaseCacheManager { public void preloadChannel(List uids){ for (int i = 0; i