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