1、删除腾讯IM、腾讯播放器jar+so文件
2、注释+删除使用了腾讯SDK的地方
This commit is contained in:
@@ -9,11 +9,6 @@ import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.tencent.rtmp.ITXVodPlayListener;
|
||||
import com.tencent.rtmp.TXLiveConstants;
|
||||
import com.tencent.rtmp.TXVodPlayConfig;
|
||||
import com.tencent.rtmp.TXVodPlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
|
||||
@@ -23,13 +18,13 @@ import java.util.List;
|
||||
* Created by Haoxuan Chen on 2022/05/4.
|
||||
* Description:查看视频
|
||||
*/
|
||||
public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListener, View.OnClickListener {
|
||||
public class PreviewVideoActivity extends AbsActivity implements View.OnClickListener {
|
||||
|
||||
View v_back;
|
||||
private List<ImageEntity> mSelectedImages;
|
||||
private TXCloudVideoView mTXCloudVideoView;
|
||||
private TXVodPlayer mPlayer;
|
||||
private TXVodPlayConfig mTXVodPlayConfig;
|
||||
// private TXCloudVideoView mTXCloudVideoView;
|
||||
// private TXVodPlayer mPlayer;
|
||||
// private TXVodPlayConfig mTXVodPlayConfig;
|
||||
private boolean mStartPlay;
|
||||
private String mCachePath;
|
||||
private boolean mPaused;//生命周期暂停
|
||||
@@ -43,7 +38,7 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
public void main(Bundle savedInstanceState) {
|
||||
mSelectedImages = getIntent().getParcelableArrayListExtra("preview_images");
|
||||
v_back = findViewById(R.id.v_back);
|
||||
mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
// mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
|
||||
v_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -65,7 +60,7 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
*/
|
||||
private void playAdVideo() {
|
||||
mCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
/* mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
mTXCloudVideoView.setRenderMode(TXLiveConstants.RENDER_MODE_FULL_FILL_SCREEN);
|
||||
mPlayer = new TXVodPlayer(mContext);
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
@@ -74,7 +69,7 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
mPlayer.setAutoPlay(true);
|
||||
mPlayer.setVodListener(this);
|
||||
mPlayer.setPlayerView(mTXCloudVideoView);
|
||||
mPlayer.setPlayerView(mTXCloudVideoView);*/
|
||||
findViewById(R.id.root).setOnClickListener(this);
|
||||
mVideoCover = findViewById(R.id.video_cover);
|
||||
mPlayBtn = findViewById(R.id.btn_play);
|
||||
@@ -104,7 +99,7 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return;
|
||||
}
|
||||
if (mTXVodPlayConfig == null) {
|
||||
/* if (mTXVodPlayConfig == null) {
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
mTXVodPlayConfig.setMaxCacheItems(15);
|
||||
mTXVodPlayConfig.setProgressInterval(200);
|
||||
@@ -117,14 +112,14 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
if (mPlayer != null) {
|
||||
mPlayer.startPlay(url);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到视频宽高回调
|
||||
*/
|
||||
public void onVideoSizeChanged(float videoWidth, float videoHeight) {
|
||||
if (mTXCloudVideoView != null && videoWidth > 0 && videoHeight > 0) {
|
||||
/*if (mTXCloudVideoView != null && videoWidth > 0 && videoHeight > 0) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mTXCloudVideoView.getLayoutParams();
|
||||
int targetH = 0;
|
||||
if (videoWidth / videoHeight > 0.5625f) {//横屏 9:16=0.5625
|
||||
@@ -139,26 +134,26 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
if (mVideoCover != null && mVideoCover.getVisibility() == View.VISIBLE) {
|
||||
mVideoCover.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止播放
|
||||
*/
|
||||
public void stopPlay() {
|
||||
if (mPlayer != null) {
|
||||
/* if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 循环播放
|
||||
*/
|
||||
private void replay() {
|
||||
if (mPlayer != null) {
|
||||
/* if (mPlayer != null) {
|
||||
mPlayer.seek(0);
|
||||
mPlayer.resume();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,13 +189,13 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
if (!mStartPlay) {
|
||||
return;
|
||||
}
|
||||
if (mPlayer != null) {
|
||||
/* if (mPlayer != null) {
|
||||
if (mClickPaused) {
|
||||
mPlayer.resume();
|
||||
} else {
|
||||
mPlayer.pause();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
mClickPaused = !mClickPaused;
|
||||
if (mClickPaused) {
|
||||
showPlayBtn();
|
||||
@@ -212,52 +207,13 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放器事件回调
|
||||
*/
|
||||
@Override
|
||||
public void onPlayEvent(TXVodPlayer txVodPlayer, int e, Bundle bundle) {
|
||||
switch (e) {
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_BEGIN://加载完成,开始播放的回调
|
||||
mStartPlay = true;
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPlayBegin();
|
||||
}
|
||||
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_LOADING: //开始加载的回调
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPlayLoading();
|
||||
}
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_END://获取到视频播放完毕的回调
|
||||
replay();
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_RCV_FIRST_I_FRAME://获取到视频首帧回调
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onFirstFrame();
|
||||
}
|
||||
if (mPaused && mPlayer != null) {
|
||||
mPlayer.pause();
|
||||
}
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_CHANGE_RESOLUTION://获取到视频宽高回调
|
||||
onVideoSizeChanged(bundle.getInt("EVT_PARAM1", 0), bundle.getInt("EVT_PARAM2", 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(TXVodPlayer txVodPlayer, Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if (mPlayer != null) {
|
||||
/* if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
mPlayer.setPlayListener(null);
|
||||
}
|
||||
mPlayer = null;
|
||||
mPlayer = null;*/
|
||||
mActionListener = null;
|
||||
}
|
||||
|
||||
@@ -279,9 +235,9 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
*/
|
||||
public void pausePlay() {
|
||||
mPaused = true;
|
||||
if (!mClickPaused && mPlayer != null) {
|
||||
/* if (!mClickPaused && mPlayer != null) {
|
||||
mPlayer.pause();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,9 +245,9 @@ public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListe
|
||||
*/
|
||||
public void resumePlay() {
|
||||
if (mPaused) {
|
||||
if (!mClickPaused && mPlayer != null) {
|
||||
/* if (!mClickPaused && mPlayer != null) {
|
||||
mPlayer.resume();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
mPaused = false;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,11 +49,11 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="72dp">
|
||||
|
||||
<com.tencent.rtmp.ui.TXCloudVideoView
|
||||
<!-- <com.google.android.exoplayer2.ui.StyledPlayerView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true" />
|
||||
android:layout_centerInParent="true" />-->
|
||||
|
||||
<View
|
||||
android:id="@+id/video_cover"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<com.tencent.rtmp.ui.TXCloudVideoView
|
||||
<com.google.android.exoplayer2.ui.StyledPlayerView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
Reference in New Issue
Block a user