Commit b9dd1b14 authored by jyx's avatar jyx

代码优化

parent c64bce5a
......@@ -9,6 +9,7 @@ import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import com.mints.helivideo.utils.LogUtil;
import com.tencent.rtmp.ITXVodPlayListener;
import com.tencent.rtmp.TXPlayerGlobalSetting;
import com.tencent.rtmp.TXVodConstants;
......@@ -104,7 +105,7 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
public void resumePlay() {
Log.i(TAG, "[resumePlay] , startOnPrepare, " + mStartOnPrepare
+ " mVodPlayer " + mVodPlayer.hashCode() + " url " + mUrl);
+ " mVodPlayer " + mVodPlayer.hashCode() + " url " + mUrl + " status " + mStatus);
if (mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_STOPPED) {
mVodPlayer.setAutoPlay(true);
mVodPlayer.startVodPlay(mUrl);
......@@ -113,11 +114,11 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
}
if (mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PREPARED
|| mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PAUSED) {
mVodPlayer.resume();
playerStatusChanged(TxVodStatus.TX_VIDEO_PLAYER_STATUS_PLAYING);
if (mOnPlayEventChangedListener != null) {
if (mStatus == TxVodStatus.TX_VIDEO_PLAYER_STATUS_PAUSED && mOnPlayEventChangedListener != null) {
mOnPlayEventChangedListener.onResume();
}
mVodPlayer.resume();
playerStatusChanged(TxVodStatus.TX_VIDEO_PLAYER_STATUS_PLAYING);
} 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 || tXVideoBaseView.player != null) {
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