Java Code Examples for com.shuyu.gsyvideoplayer.utils.Debuger#printfLog()

The following examples show how to use com.shuyu.gsyvideoplayer.utils.Debuger#printfLog() . These examples are extracted from open source projects. 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
protected void changeUiToPlayingBufferingClear() {
    Debuger.printfLog("changeUiToPlayingBufferingClear");

    setViewShowState(mTopContainer, INVISIBLE);
    setViewShowState(mBottomContainer, INVISIBLE);
    setViewShowState(mStartButton, INVISIBLE);
    setViewShowState(mLoadingProgressBar, VISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, VISIBLE);
    setViewShowState(mLockScreen, GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ENDownloadView enDownloadView = (ENDownloadView) mLoadingProgressBar;
        if (enDownloadView.getCurrentState() == ENDownloadView.STATE_PRE) {
            ((ENDownloadView) mLoadingProgressBar).start();
        }
    }
    updateStartImage();
}
 
Example 2
/***
 * 拖动进度条
 */
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    if (mVideoAllCallBack != null && isCurrentMediaListener()) {
        if (isIfCurrentIsFullscreen()) {
            Debuger.printfLog("onClickSeekbarFullscreen");
            mVideoAllCallBack.onClickSeekbarFullscreen(mOriginUrl, mTitle, this);
        } else {
            Debuger.printfLog("onClickSeekbar");
            mVideoAllCallBack.onClickSeekbar(mOriginUrl, mTitle, this);
        }
    }
    if (getGSYVideoManager() != null && mHadPlay) {
        try {
            int time = seekBar.getProgress() * getDuration() / 100;
            getGSYVideoManager().seekTo(time);
        } catch (Exception e) {
            Debuger.printfWarning(e.toString());
        }
    }
    mHadSeekTouch = false;
}
 
Example 3
Source Project: Aurora   File: StandardGSYVideoPlayer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToPreparingShow() {
    Debuger.printfLog("changeUiToPreparingShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    setViewShowState(mStartButton, INVISIBLE);
    setViewShowState(mLoadingProgressBar, VISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, INVISIBLE);
    setViewShowState(mLockScreen, GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ENDownloadView enDownloadView = (ENDownloadView) mLoadingProgressBar;
        if (enDownloadView.getCurrentState() == ENDownloadView.STATE_PRE) {
            ((ENDownloadView) mLoadingProgressBar).start();
        }
    }
}
 
Example 4
Source Project: GSYVideoPlayer   File: GSYVideoView.java    License: Apache License 2.0 6 votes vote down vote up
protected void startPrepare() {
    if (getGSYVideoManager().listener() != null) {
        getGSYVideoManager().listener().onCompletion();
    }
    if (mVideoAllCallBack != null) {
        Debuger.printfLog("onStartPrepared");
        mVideoAllCallBack.onStartPrepared(mOriginUrl, mTitle, this);
    }
    getGSYVideoManager().setListener(this);
    getGSYVideoManager().setPlayTag(mPlayTag);
    getGSYVideoManager().setPlayPosition(mPlayPosition);
    mAudioManager.requestAudioFocus(onAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
    try {
        if (mContext instanceof Activity) {
            ((Activity) mContext).getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    mBackUpPlayingBufferState = -1;
    getGSYVideoManager().prepare(mUrl, (mMapHeadData == null) ? new HashMap<String, String>() : mMapHeadData, mLooping, mSpeed, mCache, mCachePath, mOverrideExtension);
    setStateAndUi(CURRENT_STATE_PREPAREING);
}
 
Example 5
@Override
protected void changeUiToError() {
    Debuger.printfLog("changeUiToError");

    setViewShowState(mTopContainer, INVISIBLE);
    setViewShowState(mBottomContainer, INVISIBLE);
    setViewShowState(mStartButton, VISIBLE);
    setViewShowState(mLoadingProgressBar, INVISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, INVISIBLE);
    setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example 6
/**
 * 是否竖屏模式的竖屏
 */
protected boolean isVerticalVideo() {
    boolean isVertical = false;
    int videoHeight = getCurrentVideoHeight();
    int videoWidth = getCurrentVideoWidth();
    Debuger.printfLog("GSYVideoBase isVerticalVideo  videoHeight " + videoHeight + " videoWidth " + videoWidth);
    Debuger.printfLog("GSYVideoBase isVerticalVideo  mRotate " + mRotate);
    if (videoHeight > 0 && videoWidth > 0) {
        if (mRotate == 90 || mRotate == 270) {
            isVertical = videoWidth > videoHeight;
        } else {
            isVertical = videoHeight > videoWidth;
        }
    }
    return isVertical;
}
 
Example 7
Source Project: GSYVideoPlayer   File: GSYVideoView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onInfo(int what, int extra) {
    if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
        mBackUpPlayingBufferState = mCurrentState;
        //避免在onPrepared之前就进入了buffering,导致一只loading
        if (mHadPlay && mCurrentState != CURRENT_STATE_PREPAREING && mCurrentState > 0)
            setStateAndUi(CURRENT_STATE_PLAYING_BUFFERING_START);

    } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (mBackUpPlayingBufferState != -1) {
            if (mBackUpPlayingBufferState == CURRENT_STATE_PLAYING_BUFFERING_START) {
                mBackUpPlayingBufferState = CURRENT_STATE_PLAYING;
            }
            if (mHadPlay && mCurrentState != CURRENT_STATE_PREPAREING && mCurrentState > 0)
                setStateAndUi(mBackUpPlayingBufferState);

            mBackUpPlayingBufferState = -1;
        }
    } else if (what == getGSYVideoManager().getRotateInfoFlag()) {
        mRotate = extra;
        Debuger.printfLog("Video Rotate Info " + extra);
        if (mTextureView != null)
            mTextureView.setRotation(mRotate);
    }
}
 
Example 8
@Override
protected void changeUiToPreparingShow() {
    Debuger.printfLog("changeUiToPreparingShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    setViewShowState(mStartButton, INVISIBLE);
    setViewShowState(mLoadingProgressBar, VISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, INVISIBLE);
    setViewShowState(mLockScreen, GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ENDownloadView enDownloadView = (ENDownloadView) mLoadingProgressBar;
        if (enDownloadView.getCurrentState() == ENDownloadView.STATE_PRE) {
            ((ENDownloadView) mLoadingProgressBar).start();
        }
    }
}
 
Example 9
Source Project: GSYVideoPlayer   File: FloatingVideo.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onAutoCompletion() {
    setStateAndUi(CURRENT_STATE_AUTO_COMPLETE);

    mSaveChangeViewTIme = 0;

    if (mTextureViewContainer.getChildCount() > 0) {
        mTextureViewContainer.removeAllViews();
    }

    if (!mIfCurrentIsFullscreen)
        getGSYVideoManager().setLastListener(null);
    mAudioManager.abandonAudioFocus(onAudioFocusChangeListener);
    //((Activity) getActivityContext()).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    releaseNetWorkState();

    if (mVideoAllCallBack != null && isCurrentMediaListener()) {
        Debuger.printfLog("onAutoComplete");
        mVideoAllCallBack.onAutoComplete(mOriginUrl, mTitle, this);
    }
}
 
Example 10
Source Project: GSYVideoPlayer   File: GSYVideoView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onPrepared() {

    if (mCurrentState != CURRENT_STATE_PREPAREING) return;

    mHadPrepared = true;

    if (mVideoAllCallBack != null && isCurrentMediaListener()) {
        Debuger.printfLog("onPrepared");
        mVideoAllCallBack.onPrepared(mOriginUrl, mTitle, this);
    }

    if (!mStartAfterPrepared) {
        setStateAndUi(CURRENT_STATE_PAUSE);
        onVideoPause();//todo 加上这个
        return;
    }

    startAfterPrepared();
}
 
Example 11
protected void changeUiToPrepareingClear() {
    Debuger.printfLog("changeUiToPrepareingClear");

    setViewShowState(mTopContainer, INVISIBLE);
    setViewShowState(mBottomContainer, INVISIBLE);
    setViewShowState(mStartButton, INVISIBLE);
    setViewShowState(mLoadingProgressBar, INVISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, INVISIBLE);
    setViewShowState(mLockScreen, GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
}
 
Example 12
@Override
protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();

    Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss onDetachedFromWindow");
    cancelProgressTimer();
    cancelDismissControlViewTimer();
}
 
Example 13
Source Project: Aurora   File: StandardGSYVideoPlayer.java    License: Apache License 2.0 5 votes vote down vote up
protected void changeUiToClear() {
    Debuger.printfLog("changeUiToClear");

    setViewShowState(mTopContainer, INVISIBLE);
    setViewShowState(mBottomContainer, INVISIBLE);
    setViewShowState(mStartButton, INVISIBLE);
    setViewShowState(mLoadingProgressBar, INVISIBLE);
    setViewShowState(mThumbImageViewLayout, INVISIBLE);
    setViewShowState(mBottomProgressBar, INVISIBLE);
    setViewShowState(mLockScreen, GONE);

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
}
 
Example 14
Source Project: GSYVideoPlayer   File: GSYVideoView.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 开始播放逻辑
 */
protected void startButtonLogic() {
    if (mVideoAllCallBack != null && (mCurrentState == CURRENT_STATE_NORMAL
            || mCurrentState == CURRENT_STATE_AUTO_COMPLETE)) {
        Debuger.printfLog("onClickStartIcon");
        mVideoAllCallBack.onClickStartIcon(mOriginUrl, mTitle, this);
    } else if (mVideoAllCallBack != null) {
        Debuger.printfLog("onClickStartError");
        mVideoAllCallBack.onClickStartError(mOriginUrl, mTitle, this);
    }
    prepareVideo();
}
 
Example 15
@Override
public void onAutoCompletion() {
    super.onAutoCompletion();
    if (!isCurrentMediaListener() && mVideoAllCallBack != null) {
        Debuger.printfLog("onAutoComplete");
        mVideoAllCallBack.onAutoComplete(mOriginUrl, mTitle, this);
    }
}
 
Example 16
Source Project: GSYVideoPlayer   File: GSYSurfaceView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void onRenderPause() {
    Debuger.printfLog(getClass().getSimpleName() + " not support onRenderPause now");
}
 
Example 17
/**
 * 设置播放显示状态
 *
 * @param state
 */
@Override
protected void setStateAndUi(int state) {
    mCurrentState = state;
    if ((state == CURRENT_STATE_NORMAL && isCurrentMediaListener())
            || state == CURRENT_STATE_AUTO_COMPLETE || state == CURRENT_STATE_ERROR) {
        mHadPrepared = false;
    }

    switch (mCurrentState) {
        case CURRENT_STATE_NORMAL:
            if (isCurrentMediaListener()) {
                Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss CURRENT_STATE_NORMAL");
                cancelProgressTimer();
                getGSYVideoManager().releaseMediaPlayer();
                releasePauseCover();
                mBufferPoint = 0;
                mSaveChangeViewTIme = 0;
                if (mAudioManager != null) {
                    mAudioManager.abandonAudioFocus(onAudioFocusChangeListener);
                }
            }
            releaseNetWorkState();
            break;
        case CURRENT_STATE_PREPAREING:
            resetProgressAndTime();
            break;
        case CURRENT_STATE_PLAYING:
            if (isCurrentMediaListener()) {
                Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ CURRENT_STATE_PLAYING");
                startProgressTimer();
            }
            break;
        case CURRENT_STATE_PAUSE:
            Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ CURRENT_STATE_PAUSE");
            startProgressTimer();
            break;
        case CURRENT_STATE_ERROR:
            if (isCurrentMediaListener()) {
                getGSYVideoManager().releaseMediaPlayer();
            }
            break;
        case CURRENT_STATE_AUTO_COMPLETE:
            Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss CURRENT_STATE_AUTO_COMPLETE");
            cancelProgressTimer();
            if (mProgressBar != null) {
                mProgressBar.setProgress(100);
            }
            if (mCurrentTimeTextView != null && mTotalTimeTextView != null) {
                mCurrentTimeTextView.setText(mTotalTimeTextView.getText());
            }
            if (mBottomProgressBar != null) {
                mBottomProgressBar.setProgress(100);
            }
            break;
    }
    resolveUIState(state);
}
 
Example 18
@Override
public void setRenderMode(int mode) {
    Debuger.printfLog(getClass().getSimpleName() + " not support setRenderMode now");
}
 
Example 19
@Override
public void onRenderPause() {
    Debuger.printfLog(getClass().getSimpleName() + " not support onRenderPause now");
}
 
Example 20
Source Project: GSYVideoPlayer   File: GSYTextureView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderMode(int mode) {
    Debuger.printfLog(getClass().getSimpleName() + " not support setRenderMode now");
}