修复声网直播间会白屏问题
调整模块间的引用
This commit is contained in:
@@ -227,4 +227,7 @@ dependencies {
|
|||||||
//声网SDK
|
//声网SDK
|
||||||
//api 'io.agora.rtc:agora-special-full:4.2.6.245'
|
//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'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ ext {
|
|||||||
]
|
]
|
||||||
manifestPlaceholders = [
|
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")),
|
buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")),
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ dependencies {
|
|||||||
api "$AGORA_RTC_SDK"
|
api "$AGORA_RTC_SDK"
|
||||||
}
|
}
|
||||||
api project(path: ':FaceUnity')
|
api project(path: ':FaceUnity')
|
||||||
|
api project(path: ':common')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Because the components are created only during the afterEvaluate phase, you must
|
// Because the components are created only during the afterEvaluate phase, you must
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package io.agora.beautyapi.faceunity.agora;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.SurfaceView;
|
import android.view.TextureView;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
|
||||||
@@ -166,8 +166,8 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
*/
|
*/
|
||||||
public void updateMyChannelView(FrameLayout frameLayout, int uid) {
|
public void updateMyChannelView(FrameLayout frameLayout, int uid) {
|
||||||
mRtcEngine.setupLocalVideo(null);
|
mRtcEngine.setupLocalVideo(null);
|
||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
TextureView surfaceView = new TextureView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
//surfaceView.setZOrderMediaOverlay(true);
|
||||||
frameLayout.addView(surfaceView);
|
frameLayout.addView(surfaceView);
|
||||||
|
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
|
||||||
@@ -185,8 +185,8 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
} else {
|
} else {
|
||||||
uid = Integer.parseInt(strUid);
|
uid = Integer.parseInt(strUid);
|
||||||
}
|
}
|
||||||
// 创建一个 SurfaceView 对象,并将其作为 FrameLayout 的子对象
|
// 创建一个 TextureView 对象,并将其作为 FrameLayout 的子对象
|
||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
TextureView surfaceView = new TextureView(mContext);
|
||||||
audienceContainer.addView(surfaceView);
|
audienceContainer.addView(surfaceView);
|
||||||
|
|
||||||
// 启用视频模块
|
// 启用视频模块
|
||||||
@@ -228,8 +228,8 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
L.eSw("onJoinChannelSuccess:" + channel + " uid " + uid + " elapsed: " + elapsed);
|
L.eSw("onJoinChannelSuccess:" + channel + " uid " + uid + " elapsed: " + elapsed);
|
||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
TextureView surfaceView = new TextureView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
// surfaceView.setZOrderMediaOverlay(true);
|
||||||
pkContainer1.addView(surfaceView);
|
pkContainer1.addView(surfaceView);
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, strUid);
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, strUid);
|
||||||
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
||||||
@@ -308,8 +308,8 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
mContext.runOnUiThread(new Runnable() {
|
mContext.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
TextureView surfaceView = new TextureView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
// surfaceView.setZOrderMediaOverlay(true);
|
||||||
frameLayout.addView(surfaceView);
|
frameLayout.addView(surfaceView);
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, Integer.parseInt(toUid));
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, Integer.parseInt(toUid));
|
||||||
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
||||||
@@ -389,10 +389,10 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
|
|
||||||
//设置对方主播视图
|
//设置对方主播视图
|
||||||
public void setupRemoteVideo(int uid) {
|
public void setupRemoteVideo(int uid) {
|
||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
TextureView surfaceView = new TextureView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
// surfaceView.setZOrderMediaOverlay(true);
|
||||||
audienceContainer.addView(surfaceView);
|
audienceContainer.addView(surfaceView);
|
||||||
// 将 SurfaceView 对象传入声网实时互动 SDK,设置远端视图
|
// 将 TextureView 对象传入声网实时互动 SDK,设置远端视图
|
||||||
mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
|
mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
Reference in New Issue
Block a user