Java Code Examples for com.shuyu.gsyvideoplayer.utils.Debuger

The following examples show how to use com.shuyu.gsyvideoplayer.utils.Debuger. 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
@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 2
@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 3
@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 4
@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 5
@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 6
Source Project: GSYVideoPlayer   Source File: GSYVideoView.java    License: Apache License 2.0 6 votes vote down vote up
protected void initInflate(Context context) {
    try {
        View.inflate(context, getLayoutId(), this);
    } catch (InflateException e) {
        if (e.toString().contains("GSYImageCover")) {
            Debuger.printfError("********************\n" +
                    "*****   注意   *****" +
                    "********************\n" +
                    "*该版本需要清除布局文件中的GSYImageCover\n" +
                    "****  Attention  ***\n" +
                    "*Please remove GSYImageCover from Layout in this Version\n" +
                    "********************\n");
            e.printStackTrace();
            throw new InflateException("该版本需要清除布局文件中的GSYImageCover,please remove GSYImageCover from your layout");
        } else {
            e.printStackTrace();
        }
    }
}
 
Example 7
@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 Project: GSYVideoPlayer   Source File: StandardGSYVideoPlayer.java    License: 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 9
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 10
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 11
Source Project: GSYVideoPlayer   Source File: SystemPlayerManager.java    License: 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 12
@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 13
@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 14
@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 15
@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
@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 17
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 18
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 19
Source Project: GSYVideoPlayer   Source File: GSYVideoControlView.java    License: 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 20
Source Project: Aurora   Source 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 21
Source Project: Aurora   Source File: StandardGSYVideoPlayer.java    License: 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 22
Source Project: Aurora   Source File: StandardGSYVideoPlayer.java    License: 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 Project: GSYVideoPlayer   Source File: StandardGSYVideoPlayer.java    License: 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 24
Source Project: GSYVideoPlayer   Source File: GSYBaseVideoPlayer.java    License: 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 25
Source Project: GSYVideoPlayer   Source 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 26
Source Project: Aurora   Source File: StandardGSYVideoPlayer.java    License: 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 27
Source Project: GSYVideoPlayer   Source 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 28
Source Project: GSYVideoPlayer   Source File: StandardGSYVideoPlayer.java    License: 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 29
Source Project: GSYVideoPlayer   Source File: StandardGSYVideoPlayer.java    License: 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 30
Source Project: GSYVideoPlayer   Source File: GSYExoPlayerManager.java    License: 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();
    }
}