Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuoSmall committed Jun 4, 2018
2 parents ca9e915 + 4785077 commit edaad70
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 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
@@ -0,0 +1,46 @@
package com.example.gsyvideoplayer.video;

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 {

public ListADVideoPlayer(Context context, Boolean fullFlag) {
super(context, fullFlag);
}

public ListADVideoPlayer(Context context) {
super(context);
}

public ListADVideoPlayer(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
protected void startPrepare() {
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
public void onCompletion() {
super.onCompletion();
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/list_video_item_ad.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:layout_height="@dimen/post_media_height" />


<com.shuyu.gsyvideoplayer.video.GSYADVideoPlayer
<com.example.gsyvideoplayer.video.ListADVideoPlayer
android:id="@+id/video_ad_player"
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height"
Expand Down

0 comments on commit edaad70

Please sign in to comment.