com.shuyu.gsyvideoplayer.utils.Debuger Java Examples

The following examples show how to use com.shuyu.gsyvideoplayer.utils.Debuger. 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: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
protected void changeUiToCompleteClear() {
    Debuger.printfLog("changeUiToCompleteClear");

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

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example #2
Source File: SystemPlayerManager.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
private void setSpeed(float speed) {
    if (release) {
        return;
    }
    if (mediaPlayer != null && mediaPlayer.getInternalMediaPlayer() != null && mediaPlayer.isPlayable()) {
        try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                PlaybackParams playbackParams = new PlaybackParams();
                playbackParams.setSpeed(speed);
                mediaPlayer.getInternalMediaPlayer().setPlaybackParams(playbackParams);
            } else {
                Debuger.printfError(" not support setSpeed");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
Example #3
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void changeUiToPauseShow() {
    Debuger.printfLog("changeUiToPauseShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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();
    updatePauseCover();
}
 
Example #4
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.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 #5
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@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
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void changeUiToPauseShow() {
    Debuger.printfLog("changeUiToPauseShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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();
    updatePauseCover();
}
 
Example #7
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
@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 #8
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void changeUiToPlayingShow() {
    Debuger.printfLog("changeUiToPlayingShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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 #9
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.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 #10
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
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 #11
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
protected void changeUiToCompleteClear() {
    Debuger.printfLog("changeUiToCompleteClear");

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

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example #12
Source File: GSYVideoControlView.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
/***
 * 拖动进度条
 */
@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 #13
Source File: StandardGSYVideoPlayer.java    From Aurora with 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 #14
Source File: StandardGSYVideoPlayer.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToPauseShow() {
    Debuger.printfLog("changeUiToPauseShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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();
    updatePauseCover();
}
 
Example #15
Source File: StandardGSYVideoPlayer.java    From Aurora with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToCompleteShow() {
    Debuger.printfLog("changeUiToCompleteShow");

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

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example #16
Source File: StandardVideoOSPlayer.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void changeUiToNormal() {
    Debuger.printfLog("changeUiToNormal");

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

    updateStartImage();
    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
}
 
Example #17
Source File: GSYBaseVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
/**
 * 保存大小和状态
 */
private void saveLocationStatus(Context context, boolean statusBar, boolean actionBar) {
    getLocationOnScreen(mListItemRect);
    if (context instanceof Activity) {
        int statusBarH = getStatusBarHeight(context);
        int actionBerH = getActionBarHeight((Activity) context);
        boolean isTranslucent = ((WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS & ((Activity) context).getWindow().getAttributes().flags)
                == WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        Debuger.printfLog("*************isTranslucent*************** " + isTranslucent);
        if (statusBar && !isTranslucent) {
            mListItemRect[1] = mListItemRect[1] - statusBarH;
        }
        if (actionBar) {
            mListItemRect[1] = mListItemRect[1] - actionBerH;
        }
    }
    mListItemSize[0] = getWidth();
    mListItemSize[1] = getHeight();
}
 
Example #18
Source File: GSYVideoView.java    From GSYVideoPlayer with 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 #19
Source File: StandardGSYVideoPlayer.java    From Aurora with Apache License 2.0 6 votes vote down vote up
protected void changeUiToCompleteClear() {
    Debuger.printfLog("changeUiToCompleteClear");

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

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example #20
Source File: GSYVideoView.java    From GSYVideoPlayer with 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 #21
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToPlayingBufferingShow() {
    Debuger.printfLog("changeUiToPlayingBufferingShow");

    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 #22
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToCompleteShow() {
    Debuger.printfLog("changeUiToCompleteShow");

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

    if (mLoadingProgressBar instanceof ENDownloadView) {
        ((ENDownloadView) mLoadingProgressBar).reset();
    }
    updateStartImage();
}
 
Example #23
Source File: GSYExoPlayerManager.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void initVideoPlayer(Context context, Message msg, List<VideoOptionModel> optionModelList, ICacheManager cacheManager) {
    mediaPlayer = new GSYExo2MediaPlayer(context);
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    if (dummySurface == null) {
        dummySurface = DummySurface.newInstanceV17(context, false);
    }
    try {
        mediaPlayer.setLooping(((GSYExoModel) msg.obj).isLooping());
        Debuger.printfError("###### " + ((GSYExoModel) msg.obj).getOverrideExtension());
        mediaPlayer.setOverrideExtension(((GSYExoModel) msg.obj).getOverrideExtension());
        mediaPlayer.setDataSource(((GSYExoModel) msg.obj).getUrls(), ((GSYExoModel) msg.obj).getMapHeadData(), ((GSYExoModel) msg.obj).index, ((GSYExoModel) msg.obj).isCache());
        //很遗憾,EXO2的setSpeed只能在播放前生效
        if (((GSYExoModel) msg.obj).getSpeed() != 1 && ((GSYExoModel) msg.obj).getSpeed() > 0) {
            mediaPlayer.setSpeed(((GSYExoModel) msg.obj).getSpeed(), 1);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #24
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToPauseShow() {
    Debuger.printfLog("changeUiToPauseShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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();
    updatePauseCover();
}
 
Example #25
Source File: PreViewGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void onProgressChanged(SeekBar seekBar, final int progress, boolean fromUser) {
    super.onProgressChanged(seekBar, progress, fromUser);
    if (fromUser && mOpenPreView) {
        int width = seekBar.getWidth();
        int time = progress * getDuration() / 100;
        int offset = (int) (width - (getResources().getDimension(R.dimen.seek_bar_image) / 2)) / 100 * progress;
        Debuger.printfError("***************** " + progress);
        Debuger.printfError("***************** " + time);
        showPreView(mOriginUrl, time);
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mPreviewLayout.getLayoutParams();
        layoutParams.leftMargin = offset;
        //设置帧预览图的显示位置
        mPreviewLayout.setLayoutParams(layoutParams);
        if (mHadPlay && mOpenPreView) {
            mPreProgress = progress;
        }
    }
}
 
Example #26
Source File: GSYVideoGLViewBaseRender.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
protected void checkGlError(final String op) {
    final int error;
    if ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Debuger.printfError(op + ": glError " + error);
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                if (mGSYVideoGLRenderErrorListener != null) {
                    mGSYVideoGLRenderErrorListener.onError(GSYVideoGLViewBaseRender.this, op + ": glError " + error, error, mChangeProgramSupportError);
                }
                mChangeProgramSupportError = false;
            }
        });
        //throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example #27
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with 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 #28
Source File: FloatingVideo.java    From GSYVideoPlayer with 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 #29
Source File: StandardGSYVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
protected void changeUiToPlayingShow() {
    Debuger.printfLog("changeUiToPlayingShow");

    setViewShowState(mTopContainer, VISIBLE);
    setViewShowState(mBottomContainer, VISIBLE);
    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 #30
Source File: GSYBaseVideoPlayer.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
/**
 * 自动适配在竖屏全屏时,
 * 由于刘海屏或者打孔屏占据空间带来的影响(某些机型在全屏时会自动将布局下移(或者添加padding),
 * 例如三星S10、小米8;但是也有一些机型在全屏时不会处理,此时,就为了兼容这部分机型)
 */
protected void autoAdaptation() {
    Context context = getContext();
    if (isVerticalVideo()) {
        int[] location = new int[2];
        getLocationOnScreen(location);
        /*同时判断系统是否有自动将布局从statusbar下方开始显示,根据在屏幕中的位置判断*/
        //如果系统没有将布局下移,那么此时处理
        if (location[1] == 0) {
            setPadding(0, CommonUtil.getStatusBarHeight(context), 0, 0);
            Debuger.printfLog("竖屏,系统未将布局下移");
        } else {
            Debuger.printfLog("竖屏,系统将布局下移;y:" + location[1]);
        }
    }
}