Skip to content

Commit

Permalink
update ad list
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed May 31, 2018
1 parent 3f33b20 commit 4785077
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,13 @@ public void onAutoComplete(String url, Object... objects) {
holder.adVideoPlayer.getCurrentPlayer().release();
holder.adVideoPlayer.onVideoReset();
holder.adVideoPlayer.setVisibility(View.GONE);

//开始播放原视频,根据是否处于全屏状态判断
holder.gsyVideoPlayer.getCurrentPlayer().startAfterPrepared();
int playPosition = holder.gsyVideoPlayer.getGSYVideoManager().getPlayPosition();
if (position == playPosition) {
holder.gsyVideoPlayer.getCurrentPlayer().startAfterPrepared();
}

if (holder.adVideoPlayer.getCurrentPlayer().isIfCurrentIsFullscreen()) {
holder.adVideoPlayer.removeFullWindowViewOnly();
if (!holder.gsyVideoPlayer.getCurrentPlayer().isIfCurrentIsFullscreen()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.content.Context;
import android.util.AttributeSet;

import com.shuyu.gsyvideoplayer.listener.GSYMediaPlayerListener;
import com.shuyu.gsyvideoplayer.utils.Debuger;
import com.shuyu.gsyvideoplayer.video.GSYADVideoPlayer;

public class ListADVideoPlayer extends GSYADVideoPlayer {
Expand All @@ -21,10 +23,20 @@ public ListADVideoPlayer(Context context, AttributeSet attrs) {

@Override
protected void startPrepare() {
if (getGSYVideoManager().listener() != null) {
getGSYVideoManager().listener().onAutoCompletion();
}
GSYMediaPlayerListener listener = getGSYVideoManager().listener();
super.startPrepare();
if (listener != null) {
listener.onAutoCompletion();
}
}

@Override
public void onAutoCompletion() {
super.onAutoCompletion();
if (!isCurrentMediaListener() && mVideoAllCallBack != null) {
Debuger.printfLog("onAutoComplete");
mVideoAllCallBack.onAutoComplete(mOriginUrl, mTitle, this);
}
}

@Override
Expand Down

0 comments on commit 4785077

Please sign in to comment.