com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer Java Examples

The following examples show how to use com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VideoDetailActivity.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
public void onBackPressed() {
    if (dragBottomView.getVisibility() == View.VISIBLE) {
        startAnimate(dragBottomView,false);
        return;
    }
    if (replyDragBottomView.getVisibility() == View.VISIBLE) {
        startAnimate(replyDragBottomView,false);
        return;
    }

    if (orientationUtils != null) {
        orientationUtils.backToProtVideo();
    }

    if (StandardGSYVideoPlayer.backFromWindowFull(this)) {
        return;
    }
    super.onBackPressed();
}
 
Example #2
Source File: FlutterVideoDetailActivity.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
public void onBackPressed() {
    if (dragBottomView.getVisibility() == View.VISIBLE) {
        startAnimate(dragBottomView,false);
        return;
    }
    if (replyDragBottomView.getVisibility() == View.VISIBLE) {
        startAnimate(replyDragBottomView,false);
        return;
    }

    if (orientationUtils != null) {
        orientationUtils.backToProtVideo();
    }

    if (StandardGSYVideoPlayer.backFromWindowFull(this)) {
        return;
    }
    super.onBackPressed();
}
 
Example #3
Source File: GSYVideoOptionBuilder.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
public void build(StandardGSYVideoPlayer gsyVideoPlayer) {
    if (mBottomShowProgressDrawable != null && mBottomShowProgressThumbDrawable != null) {
        gsyVideoPlayer.setBottomShowProgressBarDrawable(mBottomShowProgressDrawable, mBottomShowProgressThumbDrawable);
    }
    if (mBottomProgressDrawable != null) {
        gsyVideoPlayer.setBottomProgressBarDrawable(mBottomProgressDrawable);
    }
    if (mVolumeProgressDrawable != null) {
        gsyVideoPlayer.setDialogVolumeProgressBar(mVolumeProgressDrawable);
    }

    if (mDialogProgressBarDrawable != null) {
        gsyVideoPlayer.setDialogProgressBar(mDialogProgressBarDrawable);
    }

    if (mDialogProgressHighLightColor > 0 && mDialogProgressNormalColor > 0) {
        gsyVideoPlayer.setDialogProgressColor(mDialogProgressHighLightColor, mDialogProgressNormalColor);
    }

    build((GSYBaseVideoPlayer) gsyVideoPlayer);
}
 
Example #4
Source File: ListNormalAdapter.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
private void initOrientationUtils(StandardGSYVideoPlayer standardGSYVideoPlayer, boolean full) {
    orientationUtils = new OrientationUtils((Activity) context, standardGSYVideoPlayer);
    //是否需要跟随系统旋转设置
    //orientationUtils.setRotateWithSystem(false);
    orientationUtils.setEnable(false);
    orientationUtils.setIsLand((full) ? 1 : 0);
}
 
Example #5
Source File: VideoPlayActivity.java    From OpenEyes with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_play);
    StatusBarUtil.setTranslucent(this);
    videoPlayer =  (StandardGSYVideoPlayer)findViewById(R.id.video_player);
    init();
}
 
Example #6
Source File: VideoListFragment.java    From DoingDaily with Apache License 2.0 5 votes vote down vote up
@Override
protected void onBack() {
    if (StandardGSYVideoPlayer.backFromWindowFull(getContext())) {
        return;
    }
    super.onBack();
}
 
Example #7
Source File: GifCreateHelper.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
/**
 * @param delay          每一帧之间的延时
 * @param inSampleSize   采样率,越大图片越小,越大图片越模糊,需要处理的时长越短
 * @param scaleSize      缩减尺寸比例,对生成的截图进行缩减,越大图片越模糊,需要处理的时长越短
 * @param frequencyCount 截图频率,毫秒,用在定时获取帧图片,越大获取的越少
 */
public GifCreateHelper(StandardGSYVideoPlayer standardGSYVideoPlayer, GSYVideoGifSaveListener gsyVideoGifSaveListener,
                       int delay, int inSampleSize, int scaleSize, int frequencyCount) {
    mPlayer = standardGSYVideoPlayer;
    mGSYVideoGifSaveListener = gsyVideoGifSaveListener;
    mDelay = delay;
    mSampleSize = inSampleSize;
    mScaleSize = scaleSize;
    mFrequencyCount = frequencyCount;
}
 
Example #8
Source File: SimpleDetailActivityMode1.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_simple_detail_player);

    detailPlayer = (StandardGSYVideoPlayer) findViewById(R.id.detail_player);
    //增加title
    detailPlayer.getTitleTextView().setVisibility(View.GONE);
    detailPlayer.getBackButton().setVisibility(View.GONE);

    initVideoBuilderMode();

}
 
Example #9
Source File: VideoContentCell.java    From YcShareElement with Apache License 2.0 5 votes vote down vote up
@Override
protected void onBindViewHolder(BasePagerViewHolder viewHolder) {
    //COVER
    final ImageView coverImg = viewHolder.getView(R.id.content_item_video_cover);
    ViewCompat.setTransitionName(coverImg, mData.url);
    Glide.with(coverImg)
            .load(mData.url+"?vframe/jpg/offset/0")
            .apply(new RequestOptions()
                    .diskCacheStrategy(DiskCacheStrategy.NONE)
                    .transform(new FitCenter())
                    .placeholder(new ColorDrawable(Color.GRAY)))
            .into(coverImg);
    //VIDEO
    StandardGSYVideoPlayer videoView = viewHolder.getView(R.id.content_item_video);
    GSYVideoOptionBuilder gsyVideoOption = new GSYVideoOptionBuilder();
    gsyVideoOption
            .setIsTouchWiget(true)
            .setRotateViewAuto(false)
            .setLockLand(false)
            .setAutoFullWithSize(true)
            .setShowFullAnimation(false)
            .setNeedLockFull(true)
            .setUrl(mData.url)
            .setCacheWithPlay(true)
            .setLooping(true)
            .setGSYVideoProgressListener(new GSYVideoProgressListener() {
                @Override
                public void onProgress(int progress, int secProgress, int currentPosition, int duration) {
                    if (progress > 0) {
                        coverImg.setVisibility(View.GONE);
                    }
                }
            })
            .build(videoView);
    if (mStartPlay) {
        mStartPlay = false;
        videoView.startPlayLogic();
    }
}
 
Example #10
Source File: ListNormalAdapter.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    if (getListNeedAutoLand() && orientationUtils != null) {
        resolveFull();
    }
    standardGSYVideoPlayer.startWindowFullscreen(context, false, true);
}
 
Example #11
Source File: ListADVideoActivity2.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
/**
 * 显示播放广告
 */
public void startAdPlay(GSYADVideoPlayer gsyadVideoPlayer, StandardGSYVideoPlayer normalPlayer) {
    gsyadVideoPlayer.setVisibility(View.VISIBLE);
    gsyadVideoPlayer.startPlayLogic();
    if (normalPlayer.getCurrentPlayer().isIfCurrentIsFullscreen()) {
        resolveFullBtn(gsyadVideoPlayer);
        gsyadVideoPlayer.setSaveBeforeFullSystemUiVisibility(normalPlayer.getSaveBeforeFullSystemUiVisibility());
    }
}
 
Example #12
Source File: VideoContentCell.java    From YcShareElement with Apache License 2.0 5 votes vote down vote up
public void startPlay() {
    if (mViewHolder == null || mViewHolder.itemView == null) {
        mStartPlay = true;
        return;
    }
    StandardGSYVideoPlayer videoView = mViewHolder.getView(R.id.content_item_video);
    videoView.startPlayLogic();
}
 
Example #13
Source File: ListADVideoActivity.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
/**
 * 显示播放广告
 */
public void startAdPlay(GSYADVideoPlayer gsyadVideoPlayer, StandardGSYVideoPlayer normalPlayer) {
    gsyadVideoPlayer.setVisibility(View.VISIBLE);
    gsyadVideoPlayer.startPlayLogic();
    if (normalPlayer.getCurrentPlayer().isIfCurrentIsFullscreen()) {
        resolveFullBtn(gsyadVideoPlayer);
        gsyadVideoPlayer.setSaveBeforeFullSystemUiVisibility(normalPlayer.getSaveBeforeFullSystemUiVisibility());
    }
}
 
Example #14
Source File: GSYVideoHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public GSYVideoHelper(Context context, StandardGSYVideoPlayer player) {
    mGsyVideoPlayer = player;
    this.mContext = context;
    this.mWindowViewContainer = (ViewGroup) (CommonUtil.scanForActivity(context)).findViewById(Window.ID_ANDROID_CONTENT);

}
 
Example #15
Source File: VideoListFragment.java    From DoingDaily with Apache License 2.0 4 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    standardGSYVideoPlayer.startWindowFullscreen(mContext, true, true);
}
 
Example #16
Source File: ListADVideoActivity.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    standardGSYVideoPlayer.startWindowFullscreen(context, false, true);
}
 
Example #17
Source File: DetailControlActivity.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public StandardGSYVideoPlayer getGSYVideoPlayer() {
    return detailPlayer;
}
 
Example #18
Source File: GifCreateHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public GifCreateHelper(StandardGSYVideoPlayer standardGSYVideoPlayer, GSYVideoGifSaveListener gsyVideoGifSaveListener) {
    this(standardGSYVideoPlayer, gsyVideoGifSaveListener, 0, 1, 5, 50);
}
 
Example #19
Source File: ListVideoUtil.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 获取播放器,直接拿播放器,根据需要自定义配置
 */
public StandardGSYVideoPlayer getGsyVideoPlayer() {
    return gsyVideoPlayer;
}
 
Example #20
Source File: ListVideoUtil.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public ListVideoUtil(Context context) {
    gsyVideoPlayer = new StandardGSYVideoPlayer(context);
    this.context = context;
}
 
Example #21
Source File: GSYVideoHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 获取播放器,直接拿播放器,根据需要自定义配置
 */
public StandardGSYVideoPlayer getGsyVideoPlayer() {
    return mGsyVideoPlayer;
}
 
Example #22
Source File: ListADVideoActivity2.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    standardGSYVideoPlayer.startWindowFullscreen(context, false, true);
}
 
Example #23
Source File: GSYVideoHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public GSYVideoHelper(Context context) {
    this(context, new StandardGSYVideoPlayer(context));
}
 
Example #24
Source File: DetailFilterActivity.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public StandardGSYVideoPlayer getGSYVideoPlayer() {
    return detailPlayer;
}
 
Example #25
Source File: SimpleDetailActivityMode1.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public StandardGSYVideoPlayer getGSYVideoPlayer() {
    return detailPlayer;
}
 
Example #26
Source File: RecyclerItemNormalHolder.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    standardGSYVideoPlayer.startWindowFullscreen(context, true, true);
}
 
Example #27
Source File: ListMultiNormalAdapter.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
/**
 * 全屏幕按键处理
 */
private void resolveFullBtn(final StandardGSYVideoPlayer standardGSYVideoPlayer) {
    standardGSYVideoPlayer.startWindowFullscreen(context, false, true);
}
 
Example #28
Source File: SmallVideoHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public SmallVideoHelper(Context context) {
    this(context, new StandardGSYVideoPlayer(context));
}
 
Example #29
Source File: SmallVideoHelper.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public SmallVideoHelper(Context context, StandardGSYVideoPlayer player) {
    gsyVideoPlayer = player;
    this.context = context;
    this.windowViewContainer = (ViewGroup) (CommonUtil.scanForActivity(context)).findViewById(Window.ID_ANDROID_CONTENT);

}
 
Example #30
Source File: WebDetailActivity.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public StandardGSYVideoPlayer getGSYVideoPlayer() {
    return webPlayer;
}