|
@@ -62,11 +62,12 @@ public class SuperPlayerView extends RelativeLayout {
|
|
private SuperPlayerModel mCurrentSuperPlayerModel;
|
|
private SuperPlayerModel mCurrentSuperPlayerModel;
|
|
private int mPlayAction;
|
|
private int mPlayAction;
|
|
private int mPlayIndex;
|
|
private int mPlayIndex;
|
|
- private boolean mIsLoopPlayList;
|
|
|
|
private List<SuperPlayerModel> mSuperPlayerModelList;
|
|
private List<SuperPlayerModel> mSuperPlayerModelList;
|
|
|
|
+
|
|
private long mDuration;
|
|
private long mDuration;
|
|
private long mProgress;
|
|
private long mProgress;
|
|
- private boolean mIsPlayInit;
|
|
+
|
|
|
|
+ private boolean mIsPlayInit;
|
|
private boolean isCallResume = false;
|
|
private boolean isCallResume = false;
|
|
private ISuperPlayerListener mSuperPlayerListener;
|
|
private ISuperPlayerListener mSuperPlayerListener;
|
|
|
|
|
|
@@ -171,21 +172,16 @@ public class SuperPlayerView extends RelativeLayout {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+ public void setupModelList(List<SuperPlayerModel> models) {
|
|
- * 播放视频列表
|
|
|
|
- *
|
|
|
|
- * @param models superPlayerModel列表
|
|
|
|
- * @param isLoopPlayList 是否循环
|
|
|
|
- * @param index 开始播放的视频索引
|
|
|
|
- */
|
|
|
|
- public void playWithModelList(List<SuperPlayerModel> models, boolean isLoopPlayList, int index) {
|
|
|
|
mSuperPlayerModelList = models;
|
|
mSuperPlayerModelList = models;
|
|
- mIsLoopPlayList = isLoopPlayList;
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void playIndexModel(int index) {
|
|
playModelInList(index);
|
|
playModelInList(index);
|
|
}
|
|
}
|
|
|
|
|
|
private void playModelInList(int index) {
|
|
private void playModelInList(int index) {
|
|
-
|
|
+ mIsPlayInit = false;
|
|
mSuperPlayer.stop();
|
|
mSuperPlayer.stop();
|
|
mPlayIndex = index;
|
|
mPlayIndex = index;
|
|
updateNextButton();
|
|
updateNextButton();
|
|
@@ -204,25 +200,6 @@ public class SuperPlayerView extends RelativeLayout {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- * 播放视频
|
|
|
|
- *
|
|
|
|
- * @param model
|
|
|
|
- */
|
|
|
|
- public void playWithModel(SuperPlayerModel model, boolean hasNext) {
|
|
|
|
- isCallResume = false;
|
|
|
|
- mIsPlayInit = false;
|
|
|
|
- mSuperPlayer.stop();
|
|
|
|
- mIsLoopPlayList = false;
|
|
|
|
- mWindowPlayer.setPlayNextButtonVisibility(hasNext);
|
|
|
|
- mFullScreenPlayer.setPlayNextButtonVisibility(hasNext);
|
|
|
|
-
|
|
|
|
- mSuperPlayerModelList.clear();
|
|
|
|
- mCurrentSuperPlayerModel = model;
|
|
|
|
- playWithModelInner(mCurrentSuperPlayerModel);
|
|
|
|
- mIsPlayInit = true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void playWithModelInner(SuperPlayerModel model) {
|
|
private void playWithModelInner(SuperPlayerModel model) {
|
|
mPlayAction = mCurrentSuperPlayerModel.playAction;
|
|
mPlayAction = mCurrentSuperPlayerModel.playAction;
|
|
if (mPlayAction == PLAY_ACTION_AUTO_PLAY || mPlayAction == PLAY_ACTION_PRELOAD) {
|
|
if (mPlayAction == PLAY_ACTION_AUTO_PLAY || mPlayAction == PLAY_ACTION_PRELOAD) {
|
|
@@ -439,7 +416,7 @@ public class SuperPlayerView extends RelativeLayout {
|
|
}
|
|
}
|
|
|
|
|
|
private void playIndexVideo(int index) {
|
|
private void playIndexVideo(int index) {
|
|
- if (!mIsLoopPlayList && (index >= mSuperPlayerModelList.size())) {
|
|
+ if ((index >= mSuperPlayerModelList.size())) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -560,17 +537,10 @@ public class SuperPlayerView extends RelativeLayout {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onPlayStop() {
|
|
public void onPlayStop() {
|
|
- playNextVideo();
|
|
+ if (mIsPlayInit) {
|
|
|
|
+ playNextVideo();
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
notifyCallbackPlayEnd();
|
|
notifyCallbackPlayEnd();
|
|
}
|
|
}
|
|
|
|
|