Commit 2421ac1e authored by jyx's avatar jyx

代码优化

parent dfb91e38
...@@ -62,8 +62,6 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -62,8 +62,6 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
DPHolderManager.initDpSdk(MintsApplication.getContext()); DPHolderManager.initDpSdk(MintsApplication.getContext());
ExpressManager.instance.preLoadAd()
audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
contentLayout = findViewById(R.id.content_layout) contentLayout = findViewById(R.id.content_layout)
......
...@@ -218,9 +218,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe ...@@ -218,9 +218,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
public void startPlay() { public void startPlay() {
if (mTXVodPlayerWrapper != null) { if (mTXVodPlayerWrapper != null) {
if (mIvCover.getVisibility() == View.VISIBLE) {
mIvCover.setVisibility(View.GONE);
}
mPauseImageView.setVisibility(View.GONE); mPauseImageView.setVisibility(View.GONE);
mTXVodPlayerWrapper.setVodChangeListener(this); mTXVodPlayerWrapper.setVodChangeListener(this);
mTXVodPlayerWrapper.resumePlay(); mTXVodPlayerWrapper.resumePlay();
......
...@@ -115,6 +115,9 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener { ...@@ -115,6 +115,9 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
|| mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PAUSED) { || mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PAUSED) {
mVodPlayer.resume(); mVodPlayer.resume();
playerStatusChanged(TxVodStatus.TX_VIDEO_PLAYER_STATUS_PLAYING); playerStatusChanged(TxVodStatus.TX_VIDEO_PLAYER_STATUS_PLAYING);
if (mOnPlayEventChangedListener != null) {
mOnPlayEventChangedListener.onResume();
}
} else { } else {
mStartOnPrepare = true; mStartOnPrepare = true;
} }
......
...@@ -102,7 +102,7 @@ class TxRecommendVideo2Adapter : ...@@ -102,7 +102,7 @@ class TxRecommendVideo2Adapter :
super.onViewDetachedFromWindow(holder) super.onViewDetachedFromWindow(holder)
if (holder.itemViewType == MULTI_ITEM_1) { if (holder.itemViewType == MULTI_ITEM_1) {
val tXVideoBaseView = holder.getView<TXVideoBaseView>(R.id.baseItemView) 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) { if (tXVideoBaseView.player.url != data[mCurrentPosition].video!!.recommendUrl) {
tXVideoBaseView.stopForPlaying() 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