还原成腾讯播放器

This commit is contained in:
zlzw 2022-10-31 17:53:09 +08:00
parent 7e169e882d
commit b5ebc085b4
5 changed files with 137 additions and 59 deletions

View File

@ -1 +1 @@
apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' android { compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" "lib/armeabi/libyuvutils.so" "lib/armeabi/libyuvutils.so" "lib/armeabi/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libMediaEncoder.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/arm64-v8a/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" pickFirst "lib/arm64-v8a/libyuvutils.so" exclude "lib/arm64-v8a/libMediaEncoder.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" } "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" minifyEnabled false pickFirst "lib/armeabi-v7a/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" } "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" allWarningsAsErrors = true "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/armeabi/libyuvtools.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvutils.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" repositories { flatDir { pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" mavenCentral() pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/armeabi/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" implementation 'androidx.constraintlayout:constraintlayout:2.0.0' "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" "lib/armeabi/libyuvutils.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" api project(path: ':common') pickFirst "lib/arm64-v8a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" annotationProcessor rootProject.ext.dependencies["arouter-compiler"] "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" //工具 pickFirst "lib/armeabi-v7a/libyuvtools.so" "lib/armeabi/libyuvutils.so" implementation 'com.eightbitlab:blurview:1.6.6' "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" implementation "com.getkeepsafe.relinker:relinker:1.4.4" "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" implementation 'com.google.android.exoplayer:exoplayer-core:2.18.1' implementation 'com.google.android.exoplayer:exoplayer-rtsp:2.17.1' implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.1' } apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' android { compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" } defaultConfig { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a" } javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } kotlinOptions { allWarningsAsErrors = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } repositories { flatDir { dirs 'libs', '../libs' } mavenCentral() } dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.0' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation (name:'../libs/beautysdk-202202241203',ext:'aar') implementation (name:'../libs/svgaplayer-release-v1.2.1',ext:'aar') //socket.io implementation('io.socket:socket.io-client:1.0.0') { exclude group: 'org.json', module: 'json' } //common api project(path: ':common') api project(path:':FaceUnity')//新娱美颜 annotationProcessor rootProject.ext.dependencies["arouter-compiler"] //工具 api rootProject.ext.dependencies["blank-utilcode"] implementation 'com.eightbitlab:blurview:1.6.6' implementation 'com.google.code.gson:gson:2.8.6' implementation "com.getkeepsafe.relinker:relinker:1.4.4" }

View File

@ -18,10 +18,6 @@ import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.ui.StyledPlayerView;
import com.lzy.okserver.OkDownload; import com.lzy.okserver.OkDownload;
import com.lzy.okserver.download.DownloadTask; import com.lzy.okserver.download.DownloadTask;
import com.tencent.live2.V2TXLiveDef; import com.tencent.live2.V2TXLiveDef;
@ -82,7 +78,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
private ViewGroup mLeftContainer; private ViewGroup mLeftContainer;
private ViewGroup mRightContainer; private ViewGroup mRightContainer;
private RelativeLayout mPkContainer; private RelativeLayout mPkContainer;
public static StyledPlayerView mVideoView; public static TXCloudVideoView mVideoView;
private View mLoading; private View mLoading;
private ImageView mCover; private ImageView mCover;
@ -94,7 +90,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
private boolean mPausedPlay;//是否被动暂停了播放 private boolean mPausedPlay;//是否被动暂停了播放
public static int landscape; //1h 2s public static int landscape; //1h 2s
public static Context contexts; public static Context contexts;
public ExoPlayer mPlayer; public V2TXLivePlayer mPlayer;
public static FrameLayout ry_view; public static FrameLayout ry_view;
@ -138,7 +134,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
mLeftContainer = (ViewGroup) findViewById(R.id.left_container); mLeftContainer = (ViewGroup) findViewById(R.id.left_container);
mRightContainer = (ViewGroup) findViewById(R.id.right_container); mRightContainer = (ViewGroup) findViewById(R.id.right_container);
mPkContainer = (RelativeLayout) findViewById(R.id.pk_container); mPkContainer = (RelativeLayout) findViewById(R.id.pk_container);
mVideoView = (StyledPlayerView) findViewById(R.id.video_view); mVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
ry_view = (FrameLayout) findViewById(R.id.ry_view); ry_view = (FrameLayout) findViewById(R.id.ry_view);
leave = (ImageView) findViewById(R.id.leave); leave = (ImageView) findViewById(R.id.leave);
mLoading = findViewById(R.id.loading); mLoading = findViewById(R.id.loading);
@ -150,11 +146,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams(); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams();
params.height = vHeight; params.height = vHeight;
mPkContainer.requestLayout(); mPkContainer.requestLayout();
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer = new ExoPlayer.Builder(mContext) mPlayer.setRenderView(mVideoView);
.build();
mVideoView.setPlayer(mPlayer);
} }
@Override @Override
@ -205,14 +198,103 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
return; return;
} }
//mPlayer.setCacheParams(1.0f, 5.0f); //mPlayer.setCacheParams(1.0f, 5.0f);
if(mPlayer.isPlaying()){ mPlayer.setObserver(new V2TXLivePlayerObserver() {
mPlayer.stop(); String TAG = "播放流";
}
@Override
public void onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onError(player, code, msg, extraInfo);
Log.i(TAG, "onError: player = " + player + ", code = " + code + ", msg = " + msg + ", extraInfo = " + extraInfo);
}
@Override
public void onWarning(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onWarning(player, code, msg, extraInfo);
Log.i(TAG, "onWarning: " + "player = " + player + ", code = " + code + ", msg = " + msg + ", extraInfo = " + extraInfo);
if (code == 2105) {
// mPlayer.resumeVideo();
// mPlayer.resumeAudio();
mPlayer.stopPlay();
mPlayer.startPlay(purl);
}
}
@Override
public void onVideoPlayStatusUpdate(V2TXLivePlayer player, V2TXLiveDef.V2TXLivePlayStatus status, V2TXLiveDef.V2TXLiveStatusChangeReason reason, Bundle extraInfo) {
super.onVideoPlayStatusUpdate(player, status, reason, extraInfo);
//Log.i(TAG, "onVideoPlayStatusUpdate: " + "player = " + player + ", status = " + status + ", reason = " + reason + ", extraInfo = " + extraInfo);
}
@Override
public void onAudioPlayStatusUpdate(V2TXLivePlayer player, V2TXLiveDef.V2TXLivePlayStatus status, V2TXLiveDef.V2TXLiveStatusChangeReason reason, Bundle extraInfo) {
super.onAudioPlayStatusUpdate(player, status, reason, extraInfo);
//Log.i(TAG, "onAudioPlayStatusUpdate: " + "player = " + player + ", status = " + status + ", reason = " + reason + ", extraInfo = " + extraInfo);
}
@Override
public void onPlayoutVolumeUpdate(V2TXLivePlayer player, int volume) {
super.onPlayoutVolumeUpdate(player, volume);
}
@Override
public void onStatisticsUpdate(V2TXLivePlayer player, V2TXLiveDef.V2TXLivePlayerStatistics statistics) {
super.onStatisticsUpdate(player, statistics);
Map<String, DownloadTask> taskMap = OkDownload.getInstance().getTaskMap();
StringBuilder buffer = new StringBuilder();
buffer.append("|");
for (String key : taskMap.keySet()) {
DownloadTask task = taskMap.get(key);
buffer.append(task.progress.fileName).append(":");
int status = task.progress.status;
switch (status) {
case 0:
buffer.append("无状态");
break;
case 1:
buffer.append("等待");
break;
case 2:
buffer.append("下载中:").append(task.progress.fraction);
break;
case 3:
buffer.append("暂停");
break;
case 4:
buffer.append("错误");
break;
case 5:
buffer.append("完成");
break;
}
buffer.append("|");
}
//Log.i(TAG, "onStatisticsUpdate: " + JSON.toJSONString(statistics) + " |当前下载数 : " + OkDownload.getInstance().getTaskMap().size() + buffer);
if (statistics.fps == 0) {
OkDownload.getInstance().pauseAll();
} else {
OkDownload.getInstance().startAll();
}
}
@Override
public void onSnapshotComplete(V2TXLivePlayer player, Bitmap image) {
super.onSnapshotComplete(player, image);
}
@Override
public void onRenderVideoFrame(V2TXLivePlayer player, V2TXLiveDef.V2TXLiveVideoFrame videoFrame) {
super.onRenderVideoFrame(player, videoFrame);
}
@Override
public void onReceiveSeiMessage(V2TXLivePlayer player, int payloadType, byte[] data) {
super.onReceiveSeiMessage(player, payloadType, data);
}
});
purl = url; purl = url;
MediaItem item = MediaItem.fromUri(url); mPlayer.startPlay(url);
mPlayer.setMediaItem(item);
mPlayer.prepare();
mPlayer.play();
onPrepared(); onPrepared();
} }
@ -223,8 +305,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
mEnd = true; mEnd = true;
mStarted = false; mStarted = false;
if (mPlayer != null) { if (mPlayer != null) {
mPlayer.stop(); mPlayer.stopPlay();
mPlayer.release();
} }
L.e(TAG, "release------->"); L.e(TAG, "release------->");
} }
@ -238,7 +319,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} }
} }
if (mPlayer != null) { if (mPlayer != null) {
mPlayer.stop(); mPlayer.stopPlay();
} }
stopPlay2(); stopPlay2();
} }
@ -427,7 +508,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
params.height = RelativeLayout.LayoutParams.MATCH_PARENT; params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
params.topMargin = 0; params.topMargin = 0;
params.addRule(RelativeLayout.ALIGN_TOP); params.addRule(RelativeLayout.ALIGN_TOP);
// mPlayer.setRenderRotation(V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation270); mPlayer.setRenderRotation(V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation270);
mVideoView.requestLayout(); mVideoView.requestLayout();
} }
@ -437,7 +518,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = vHeight; params.height = vHeight;
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
// mPlayer.setRenderRotation(V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation0); mPlayer.setRenderRotation(V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation0);
params.addRule(RelativeLayout.ALIGN_TOP); params.addRule(RelativeLayout.ALIGN_TOP);
mVideoView.requestLayout(); mVideoView.requestLayout();
} }
@ -484,11 +565,10 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Log.e("ry", "退出多人房间成功"); Log.e("ry", "退出多人房间成功");
new Handler(Looper.getMainLooper()).post(new Runnable() { new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() { public void run() {
mPlayer.setMediaItem(MediaItem.fromUri(purl)); mPlayer.startPlay(purl);
Log.e("ry", mPlayer.isPlaying() + "purl" + purl); Log.e("ry", mPlayer.isPlaying() + "purl" + purl);
if (!mPlayer.isPlaying()) { if (mPlayer.isPlaying() != 1) {
mPlayer.prepare(); mPlayer.startPlay(purl);
mPlayer.play();
} }
ry_view.removeAllViews(); ry_view.removeAllViews();
onPrepared(); onPrepared();
@ -550,7 +630,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
for (RCRTCInputStream stream : data.getLiveStreams()) { for (RCRTCInputStream stream : data.getLiveStreams()) {
if (stream.getMediaType() == RCRTCMediaType.VIDEO) { if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
//暂停播放 //暂停播放
mPlayer.stop(); mPlayer.stopPlay();
//如果远端用户发布的是视频流创建显示视图RCRTCVideoView并添加到布局中显示 //如果远端用户发布的是视频流创建显示视图RCRTCVideoView并添加到布局中显示
//如果远端用户发布的是视频流创建显示视图RCRTCVideoView并添加到布局中显示 //如果远端用户发布的是视频流创建显示视图RCRTCVideoView并添加到布局中显示

View File

@ -1056,6 +1056,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveChatAdapter.clear(); mLiveChatAdapter.clear();
} }
} }
public void clearGuardIcon(){
if(userGuard!=null){
userGuard.setImageResource(R.mipmap.img_guardian_empty);
}
}
public synchronized void showStart(StarChallengeStatusModel data) { public synchronized void showStart(StarChallengeStatusModel data) {
boolean upData = false; boolean upData = false;
if (mBannerList2 != null && mBannerList2.size() == 0) { if (mBannerList2 != null && mBannerList2.size() == 0) {

View File

@ -221,7 +221,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
liveBack = mRootContainer.findViewById(R.id.live_back); liveBack = mRootContainer.findViewById(R.id.live_back);
mask = mRootContainer.findViewById(R.id.mask); mask = mRootContainer.findViewById(R.id.mask);
} }
private static boolean test=true;
@Override @Override
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) {
openParametersModel = new OpenParametersModel(); openParametersModel = new OpenParametersModel();
@ -239,8 +238,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
.setParametersModel(openParametersModel .setParametersModel(openParametersModel
.setmLiveType(mLiveType) .setmLiveType(mLiveType)
.setmLiveTypeVal(mLiveTypeVal))); .setmLiveTypeVal(mLiveTypeVal)));
if (mLivePlayViewHolder == null && test) { if (mLivePlayViewHolder == null) {
test=false;
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0)); mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0));
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer);
@ -253,30 +251,28 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveAudienceViewHolder.addToParent(); mLiveAudienceViewHolder.addToParent();
mLiveRoomViewHolder.addToParent(); mLiveRoomViewHolder.addToParent();
mLiveAudienceViewHolder.subscribeActivityLifeCycle(); mLiveAudienceViewHolder.subscribeActivityLifeCycle();
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this);
} }
if(true) { //直播间背景
//直播间背景 ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600); //ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack);
//ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack); mask.setVisibility(View.VISIBLE);
mask.setVisibility(View.VISIBLE); mLivePlayViewHolder.setCover(data.getThumb());
mLivePlayViewHolder.setCover(data.getThumb()); mLivePlayViewHolder.play(data.getPull());
mLivePlayViewHolder.play(data.getPull()); mLiveRoomViewHolder.clearChat();
mLiveRoomViewHolder.clearChat(); mLiveRoomViewHolder.setAvatar(data.getAvatar());
mLiveRoomViewHolder.setAvatar(data.getAvatar()); mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor()); mLiveRoomViewHolder.setName(data.getUserNiceName());
mLiveRoomViewHolder.setName(data.getUserNiceName()); mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip()); mLiveRoomViewHolder.setTitle(data.getTitle());
mLiveRoomViewHolder.setTitle(data.getTitle()); mLiveRoomViewHolder.clearGuardIcon();
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), ""); mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
mLiveRoomViewHolder.setLiveUid(data.getUid()); mLiveRoomViewHolder.setLiveUid(data.getUid());
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this); mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this);
if (mLiveLinkMicPresenter != null) { if (mLiveLinkMicPresenter != null) {
mLiveLinkMicPresenter.setSocketClient(mSocketClient); mLiveLinkMicPresenter.setSocketClient(mSocketClient);
}
} }
//心愿单 //心愿单
LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() { LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() {
@ -304,10 +300,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
}); });
enterRoom(); enterRoom();
if(true) { mLiveRoomViewHolder.initHourRankList();
mLiveRoomViewHolder.initHourRankList(); mLiveRoomViewHolder.showLiveRoomActivityBanner();
mLiveRoomViewHolder.showLiveRoomActivityBanner();
}
} }
}); });

View File

@ -8,10 +8,9 @@
> >
<com.google.android.exoplayer2.ui.StyledPlayerView <com.tencent.rtmp.ui.TXCloudVideoView
android:id="@+id/video_view" android:id="@+id/video_view"
android:layout_width="match_parent" android:layout_width="match_parent"
app:use_controller="false"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
<ImageView <ImageView