Commit 2421ac1e authored by jyx's avatar jyx

代码优化

parent dfb91e38
......@@ -62,8 +62,6 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() {
DPHolderManager.initDpSdk(MintsApplication.getContext());
ExpressManager.instance.preLoadAd()
audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
contentLayout = findViewById(R.id.content_layout)
......
......@@ -218,9 +218,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
public void startPlay() {
if (mTXVodPlayerWrapper != null) {
if (mIvCover.getVisibility() == View.VISIBLE) {
mIvCover.setVisibility(View.GONE);
}
mPauseImageView.setVisibility(View.GONE);
mTXVodPlayerWrapper.setVodChangeListener(this);
mTXVodPlayerWrapper.resumePlay();
......
......@@ -115,6 +115,9 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
|| mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PAUSED) {
mVodPlayer.resume();
playerStatusChanged(TxVodStatus.TX_VIDEO_PLAYER_STATUS_PLAYING);
if (mOnPlayEventChangedListener != null) {
mOnPlayEventChangedListener.onResume();
}
} else {
mStartOnPrepare = true;
}
......
......@@ -102,7 +102,7 @@ class TxRecommendVideo2Adapter :
super.onViewDetachedFromWindow(holder)
if (holder.itemViewType == MULTI_ITEM_1) {
val tXVideoBaseView = holder.getView<TXVideoBaseView>(R.id.baseItemView)
if (data[mCurrentPosition].itemType == MULTI_ITEM_1) {
if (data[mCurrentPosition].itemType == MULTI_ITEM_1 || tXVideoBaseView.player != null) {
if (tXVideoBaseView.player.url != data[mCurrentPosition].video!!.recommendUrl) {
tXVideoBaseView.stopForPlaying()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment